hash
stringlengths
40
40
date
stringdate
2022-11-17 13:04:47
2025-03-21 17:04:41
author
stringclasses
141 values
commit_message
stringlengths
22
166
is_merge
bool
1 class
git_diff
stringlengths
238
9.63M
type
stringclasses
17 values
masked_commit_message
stringlengths
6
143
fed7b697995b37bf3ef198121de571c6e338863c
2024-06-24 17:49:03
Sampras Lopes
feat(ci): add vector to handle logs pipeline (#5021)
false
diff --git a/config/dashboard.toml b/config/dashboard.toml index 9bb2b6bf336..c00b167315a 100644 --- a/config/dashboard.toml +++ b/config/dashboard.toml @@ -31,7 +31,7 @@ surcharge=false dispute_evidence_upload=false paypal_automatic_flow=false threeds_authenticator=false -global_search=false +global_search=true dispute_analytics=true configure_pmts=false branding=false diff --git a/config/prometheus.yaml b/config/prometheus.yaml index 574c9dcce7a..85f6335c838 100644 --- a/config/prometheus.yaml +++ b/config/prometheus.yaml @@ -35,3 +35,11 @@ scrape_configs: static_configs: - targets: ["otel-collector:8888"] + + - job_name: "vector" + + # metrics_path defaults to '/metrics' + # scheme defaults to 'http'. + + static_configs: + - targets: ["vector:9598"] \ No newline at end of file diff --git a/config/vector.yaml b/config/vector.yaml new file mode 100644 index 00000000000..d8f5da34666 --- /dev/null +++ b/config/vector.yaml @@ -0,0 +1,134 @@ +acknowledgements: + enabled: true + +api: + enabled: true + address: 0.0.0.0:8686 + +sources: + kafka_tx_events: + type: kafka + bootstrap_servers: kafka0:29092 + group_id: sessionizer + topics: + - hyperswitch-payment-attempt-events + - hyperswitch-payment-intent-events + - hyperswitch-refund-events + - hyperswitch-dispute-events + decoding: + codec: json + + app_logs: + type: docker_logs + include_labels: + - "logs=promtail" + + vector_metrics: + type: internal_metrics + + node_metrics: + type: host_metrics + +transforms: + plus_1_events: + type: filter + inputs: + - kafka_tx_events + condition: ".sign_flag == 1" + + hs_server_logs: + type: filter + inputs: + - app_logs + condition: '.labels."com.docker.compose.service" == "hyperswitch-server"' + + parsed_hs_server_logs: + type: remap + inputs: + - app_logs + source: |- + .message = parse_json!(.message) + + events: + type: remap + inputs: + - plus_1_events + source: |- + .timestamp = from_unix_timestamp!(.created_at, unit: "seconds") + +sinks: + opensearch_events: + type: elasticsearch + inputs: + - events + endpoints: + - "https://opensearch:9200" + id_key: message_key + api_version: v7 + tls: + verify_certificate: false + verify_hostname: false + auth: + strategy: basic + user: admin + password: 0penS3arc# + encoding: + except_fields: + - message_key + - offset + - partition + - topic + bulk: + # Add a date prefixed index for better grouping + # index: "vector-{{ .topic }}-%Y-%m-%d" + index: "{{ .topic }}" + + opensearch_logs: + type: elasticsearch + inputs: + - parsed_hs_server_logs + endpoints: + - "https://opensearch:9200" + api_version: v7 + tls: + verify_certificate: false + verify_hostname: false + auth: + strategy: basic + user: admin + password: 0penS3arc# + bulk: + # Add a date prefixed index for better grouping + # index: "vector-{{ .topic }}-%Y-%m-%d" + index: "logs-{{ .container_name }}-%Y-%m-%d" + + log_events: + type: loki + inputs: + - kafka_tx_events + endpoint: http://loki:3100 + labels: + source: vector + topic: "{{ .topic }}" + job: kafka + encoding: + codec: json + + log_app_loki: + type: loki + inputs: + - parsed_hs_server_logs + endpoint: http://loki:3100 + labels: + source: vector + job: app_logs + container: "{{ .container_name }}" + stream: "{{ .stream }}" + encoding: + codec: json + + metrics: + type: prometheus_exporter + inputs: + - vector_metrics + - node_metrics diff --git a/crates/analytics/src/clickhouse.rs b/crates/analytics/src/clickhouse.rs index fd1746c4b9e..47294c108f3 100644 --- a/crates/analytics/src/clickhouse.rs +++ b/crates/analytics/src/clickhouse.rs @@ -262,6 +262,7 @@ impl TryInto<RefundFilterRow> for serde_json::Value { )) } } + impl TryInto<DisputeMetricRow> for serde_json::Value { type Error = Report<ParsingError>; diff --git a/docker-compose.yml b/docker-compose.yml index 57f7ccde1cd..aff7ab54f45 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -245,18 +245,6 @@ services: - ./config/grafana.ini:/etc/grafana/grafana.ini - ./config/grafana-datasource.yaml:/etc/grafana/provisioning/datasources/datasource.yml - promtail: - image: grafana/promtail:latest - volumes: - - ./logs:/var/log/router - - ./config:/etc/promtail - - /var/run/docker.sock:/var/run/docker.sock - command: -config.file=/etc/promtail/promtail.yaml - profiles: - - monitoring - networks: - - router_net - loki: image: grafana/loki:latest ports: @@ -387,21 +375,13 @@ services: soft: 262144 hard: 262144 - fluentd: - build: ./docker/fluentd - volumes: - - ./docker/fluentd/conf:/fluentd/etc - networks: - - router_net - profiles: - - olap - opensearch: - image: public.ecr.aws/opensearchproject/opensearch:1.3.14 + image: opensearchproject/opensearch:2 container_name: opensearch hostname: opensearch environment: - "discovery.type=single-node" + - OPENSEARCH_INITIAL_ADMIN_PASSWORD=0penS3arc# profiles: - olap ports: @@ -410,7 +390,7 @@ services: - router_net opensearch-dashboards: - image: opensearchproject/opensearch-dashboards:1.3.14 + image: opensearchproject/opensearch-dashboards:2 ports: - 5601:5601 profiles: @@ -419,3 +399,18 @@ services: OPENSEARCH_HOSTS: '["https://opensearch:9200"]' networks: - router_net + + vector: + image: timberio/vector:latest-debian + ports: + - "8686" + - "9598" + profiles: + - olap + environment: + KAFKA_HOST: 'kafka0:29092' + networks: + - router_net + volumes: + - ./config/vector.yaml:/etc/vector/vector.yaml + - /var/run/docker.sock:/var/run/docker.sock \ No newline at end of file
feat
add vector to handle logs pipeline (#5021)
8d337bf34f1cc02a7821318eada125ed1709203f
2024-05-06 05:44:50
github-actions
chore(version): 2024.05.06.0
false
diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e961ee0b79..6f4da0ae086 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,30 @@ All notable changes to HyperSwitch will be documented here. - - - +## 2024.05.06.0 + +### Features + +- **core:** Add profile level config to toggle extended card bin ([#4445](https://github.com/juspay/hyperswitch/pull/4445)) ([`0304e8e`](https://github.com/juspay/hyperswitch/commit/0304e8e76a8ca1f602305991c4129107b20d148e)) +- **euclid_wasm:** Add configs for new payout connectors ([#4528](https://github.com/juspay/hyperswitch/pull/4528)) ([`9f41919`](https://github.com/juspay/hyperswitch/commit/9f41919094638baf9ea405a5acb89d69ecf1e2b7)) + +### Bug Fixes + +- **connector:** [BAMBORA] Restrict Card Expiry Year to 2 Digits and pass Amount in Decimal Format ([#4536](https://github.com/juspay/hyperswitch/pull/4536)) ([`d5d9006`](https://github.com/juspay/hyperswitch/commit/d5d9006fbd8e32f822f1e84d486b8a4483164baa)) +- **users:** Revert add password validations ([#4542](https://github.com/juspay/hyperswitch/pull/4542)) ([`bcce8b0`](https://github.com/juspay/hyperswitch/commit/bcce8b0489aad8455748e0945127f0a7447e8fb1)) + +### Refactors + +- **connector:** [NMI] Change fields for external auth due to API contract changes ([#4531](https://github.com/juspay/hyperswitch/pull/4531)) ([`7417250`](https://github.com/juspay/hyperswitch/commit/74172509e3b9c0af04bb2fe8a5192ab7f7fd37b5)) + +### Documentation + +- **cypress:** Update cypress docs ([#4505](https://github.com/juspay/hyperswitch/pull/4505)) ([`17b369c`](https://github.com/juspay/hyperswitch/commit/17b369cfabc42d4d06f65b92e967057dba348731)) + +**Full Changelog:** [`2024.05.03.1...2024.05.06.0`](https://github.com/juspay/hyperswitch/compare/2024.05.03.1...2024.05.06.0) + +- - - + ## 2024.05.03.1 ### Bug Fixes
chore
2024.05.06.0
bca9d5013b902d813a41f04286ea6cb645e1f199
2023-08-23 18:42:47
Hrithikesh
feat(connector): fail payment authorize when capture_method is manual_method (#1893)
false
diff --git a/Cargo.lock b/Cargo.lock index e8a55d61a9a..ce46b6c6e95 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -516,18 +516,18 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.28", ] [[package]] name = "async-trait" -version = "0.1.73" +version = "0.1.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +checksum = "cc6dde6e4ed435a4c1ee4e73592f5ba9da2151af10076cc04858746af9352d09" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.28", ] [[package]] @@ -1340,7 +1340,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.28", ] [[package]] @@ -1606,7 +1606,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.29", + "syn 2.0.28", ] [[package]] @@ -1628,7 +1628,7 @@ checksum = "29a358ff9f12ec09c3e61fef9b5a9902623a695a46a917b07f269bff1445611a" dependencies = [ "darling_core 0.20.1", "quote", - "syn 2.0.29", + "syn 2.0.28", ] [[package]] @@ -1644,22 +1644,6 @@ dependencies = [ "parking_lot_core", ] -[[package]] -name = "data_models" -version = "0.1.0" -dependencies = [ - "api_models", - "async-trait", - "common_enums", - "common_utils", - "error-stack", - "serde", - "serde_json", - "strum 0.25.0", - "thiserror", - "time 0.3.22", -] - [[package]] name = "deadpool" version = "0.9.5" @@ -1738,7 +1722,7 @@ dependencies = [ "diesel_table_macro_syntax", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.28", ] [[package]] @@ -1768,7 +1752,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5" dependencies = [ - "syn 2.0.29", + "syn 2.0.28", ] [[package]] @@ -1840,9 +1824,9 @@ dependencies = [ [[package]] name = "dyn-clone" -version = "1.0.13" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbfc4744c1b8f2a09adc0e55242f60b1af195d88596bd8700be74418c056c555" +checksum = "68b0cf012f1230e43cd00ebb729c6bb58707ecfa8ad08b52ef3a4ccd2697fc30" [[package]] name = "either" @@ -2201,7 +2185,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.28", ] [[package]] @@ -3014,9 +2998,9 @@ dependencies = [ [[package]] name = "moka" -version = "0.11.3" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa6e72583bf6830c956235bff0d5afec8cf2952f579ebad18ae7821a917d950f" +checksum = "206bf83f415b0579fd885fe0804eb828e727636657dc1bf73d80d2f1218e14a1" dependencies = [ "async-io", "async-lock", @@ -3182,7 +3166,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.28", ] [[package]] @@ -3396,7 +3380,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.28", ] [[package]] @@ -3447,7 +3431,7 @@ checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.28", ] [[package]] @@ -3658,9 +3642,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" dependencies = [ "proc-macro2", ] @@ -3984,7 +3968,7 @@ dependencies = [ "clap", "common_utils", "config", - "data_models", + "crc32fast", "derive_deref", "diesel", "diesel_models", @@ -4004,6 +3988,7 @@ dependencies = [ "maud", "mimalloc", "mime", + "moka", "nanoid", "num_cpus", "once_cell", @@ -4111,7 +4096,7 @@ dependencies = [ "quote", "rust-embed-utils", "shellexpand", - "syn 2.0.29", + "syn 2.0.28", "walkdir", ] @@ -4319,7 +4304,7 @@ checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.28", ] [[package]] @@ -4382,7 +4367,7 @@ checksum = "bcec881020c684085e55a25f7fd888954d56609ef363479dc5a1305eb0d40cab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.28", ] [[package]] @@ -4431,7 +4416,7 @@ dependencies = [ "darling 0.20.1", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.28", ] [[package]] @@ -4456,7 +4441,7 @@ checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.28", ] [[package]] @@ -4603,24 +4588,11 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" name = "storage_impl" version = "0.1.0" dependencies = [ - "api_models", "async-bb8-diesel", "async-trait", "bb8", - "common_utils", - "crc32fast", - "data_models", "diesel", - "diesel_models", - "dyn-clone", - "error-stack", - "futures", "masking", - "moka", - "once_cell", - "redis_interface", - "router_env", - "tokio", ] [[package]] @@ -4679,7 +4651,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.29", + "syn 2.0.28", ] [[package]] @@ -4701,9 +4673,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.29" +version = "2.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a" +checksum = "04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567" dependencies = [ "proc-macro2", "quote", @@ -4862,7 +4834,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.28", ] [[package]] @@ -4976,7 +4948,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.28", ] [[package]] @@ -5380,7 +5352,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.28", ] [[package]] @@ -5519,7 +5491,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.28", "wasm-bindgen-shared", ] @@ -5553,7 +5525,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.28", "wasm-bindgen-backend", "wasm-bindgen-shared", ] diff --git a/connector-template/mod.rs b/connector-template/mod.rs index af58abbf923..3a66db6682a 100644 --- a/connector-template/mod.rs +++ b/connector-template/mod.rs @@ -10,7 +10,7 @@ use crate::{ core::{ errors::{self, CustomResult}, }, - headers, services::{self, ConnectorIntegration, request::{self, Mask}}, + headers, services::{self, ConnectorIntegration, ConnectorValidation, request::{self, Mask}}, types::{ self, api::{self, ConnectorCommon, ConnectorCommonExt}, @@ -102,6 +102,11 @@ impl ConnectorCommon for {{project-name | downcase | pascal_case}} { } } +impl ConnectorValidation for {{project-name | downcase | pascal_case}} +{ + //TODO: implement functions when support enabled +} + impl ConnectorIntegration< api::Session, @@ -156,6 +161,7 @@ impl req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/aci.rs b/crates/router/src/connector/aci.rs index ab6a6a4fb44..5e13bf31a97 100644 --- a/crates/router/src/connector/aci.rs +++ b/crates/router/src/connector/aci.rs @@ -14,6 +14,7 @@ use crate::{ services::{ self, request::{self, Mask}, + ConnectorValidation, }, types::{ self, @@ -79,6 +80,8 @@ impl ConnectorCommon for Aci { } } +impl ConnectorValidation for Aci {} + impl api::Payment for Aci {} impl api::PaymentAuthorize for Aci {} @@ -295,6 +298,7 @@ impl >, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/adyen.rs b/crates/router/src/connector/adyen.rs index df47395f219..bb957920399 100644 --- a/crates/router/src/connector/adyen.rs +++ b/crates/router/src/connector/adyen.rs @@ -4,7 +4,7 @@ use std::fmt::Debug; use api_models::webhooks::IncomingWebhookEvent; use base64::Engine; -use diesel_models::enums as storage_enums; +use diesel_models::{enums as storage_enums, enums}; use error_stack::{IntoReport, ResultExt}; use ring::hmac; use router_env::{instrument, tracing}; @@ -12,6 +12,7 @@ use router_env::{instrument, tracing}; use self::transformers as adyen; use crate::{ configs::settings, + connector::utils as connector_utils, consts, core::{ self, @@ -22,6 +23,7 @@ use crate::{ services::{ self, request::{self, Mask}, + ConnectorValidation, }, types::{ self, @@ -72,6 +74,21 @@ impl ConnectorCommon for Adyen { } } +impl ConnectorValidation for Adyen { + fn validate_capture_method( + &self, + capture_method: Option<storage_enums::CaptureMethod>, + ) -> CustomResult<(), errors::ConnectorError> { + let capture_method = capture_method.unwrap_or_default(); + match capture_method { + enums::CaptureMethod::Automatic | enums::CaptureMethod::Manual => Ok(()), + enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err( + connector_utils::construct_not_implemented_error_report(capture_method, self.id()), + ), + } + } +} + impl api::Payment for Adyen {} impl api::PaymentAuthorize for Adyen {} impl api::PaymentSync for Adyen {} @@ -582,6 +599,7 @@ impl req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; check_for_payment_method_balance(req)?; Ok(Some( services::RequestBuilder::new() diff --git a/crates/router/src/connector/airwallex.rs b/crates/router/src/connector/airwallex.rs index 2fb171eb9fc..8f3cf8efeb4 100644 --- a/crates/router/src/connector/airwallex.rs +++ b/crates/router/src/connector/airwallex.rs @@ -3,6 +3,7 @@ pub mod transformers; use std::fmt::Debug; use common_utils::ext_traits::{ByteSliceExt, ValueExt}; +use diesel_models::enums; use error_stack::{IntoReport, ResultExt}; use masking::PeekInterface; use transformers as airwallex; @@ -10,6 +11,7 @@ use transformers as airwallex; use super::utils::{AccessTokenRequestInfo, RefundsRequestData}; use crate::{ configs::settings, + connector::utils as connector_utils, core::{ errors::{self, CustomResult}, payments, @@ -18,7 +20,7 @@ use crate::{ services::{ self, request::{self, Mask}, - ConnectorIntegration, + ConnectorIntegration, ConnectorValidation, }, types::{ self, @@ -91,6 +93,21 @@ impl ConnectorCommon for Airwallex { } } +impl ConnectorValidation for Airwallex { + fn validate_capture_method( + &self, + capture_method: Option<enums::CaptureMethod>, + ) -> CustomResult<(), errors::ConnectorError> { + let capture_method = capture_method.unwrap_or_default(); + match capture_method { + enums::CaptureMethod::Automatic | enums::CaptureMethod::Manual => Ok(()), + enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err( + connector_utils::construct_not_supported_error_report(capture_method, self.id()), + ), + } + } +} + impl api::Payment for Airwallex {} impl api::PaymentsCompleteAuthorize for Airwallex {} impl api::PreVerify for Airwallex {} @@ -242,6 +259,7 @@ impl req: &types::PaymentsInitRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/authorizedotnet.rs b/crates/router/src/connector/authorizedotnet.rs index 5669c7843dc..44eee1e1811 100644 --- a/crates/router/src/connector/authorizedotnet.rs +++ b/crates/router/src/connector/authorizedotnet.rs @@ -3,18 +3,20 @@ pub mod transformers; use std::fmt::Debug; use common_utils::{crypto, ext_traits::ByteSliceExt}; +use diesel_models::enums; use error_stack::{IntoReport, ResultExt}; use transformers as authorizedotnet; use crate::{ configs::settings, + connector::utils as connector_utils, consts, core::{ errors::{self, CustomResult}, payments, }, headers, - services::{self, request, ConnectorIntegration}, + services::{self, request, ConnectorIntegration, ConnectorValidation}, types::{ self, api::{self, ConnectorCommon, ConnectorCommonExt, PaymentsCompleteAuthorize}, @@ -56,6 +58,21 @@ impl ConnectorCommon for Authorizedotnet { } } +impl ConnectorValidation for Authorizedotnet { + fn validate_capture_method( + &self, + capture_method: Option<enums::CaptureMethod>, + ) -> CustomResult<(), errors::ConnectorError> { + let capture_method = capture_method.unwrap_or_default(); + match capture_method { + enums::CaptureMethod::Automatic | enums::CaptureMethod::Manual => Ok(()), + enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err( + connector_utils::construct_not_supported_error_report(capture_method, self.id()), + ), + } + } +} + impl api::Payment for Authorizedotnet {} impl api::PaymentAuthorize for Authorizedotnet {} impl api::PaymentSync for Authorizedotnet {} @@ -313,6 +330,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P >, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/bambora.rs b/crates/router/src/connector/bambora.rs index 19c3acaf420..a8f660bb738 100644 --- a/crates/router/src/connector/bambora.rs +++ b/crates/router/src/connector/bambora.rs @@ -2,13 +2,17 @@ pub mod transformers; use std::fmt::Debug; +use diesel_models::enums; use error_stack::{IntoReport, ResultExt}; use transformers as bambora; use super::utils::RefundsRequestData; use crate::{ configs::settings, - connector::utils::{to_connector_meta, PaymentsAuthorizeRequestData, PaymentsSyncRequestData}, + connector::{ + utils as connector_utils, + utils::{to_connector_meta, PaymentsAuthorizeRequestData, PaymentsSyncRequestData}, + }, core::{ errors::{self, CustomResult}, payments, @@ -17,7 +21,7 @@ use crate::{ services::{ self, request::{self, Mask}, - ConnectorIntegration, + ConnectorIntegration, ConnectorValidation, }, types::{ self, @@ -95,6 +99,21 @@ impl ConnectorCommon for Bambora { } } +impl ConnectorValidation for Bambora { + fn validate_capture_method( + &self, + capture_method: Option<enums::CaptureMethod>, + ) -> CustomResult<(), errors::ConnectorError> { + let capture_method = capture_method.unwrap_or_default(); + match capture_method { + enums::CaptureMethod::Automatic | enums::CaptureMethod::Manual => Ok(()), + enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err( + connector_utils::construct_not_implemented_error_report(capture_method, self.id()), + ), + } + } +} + impl api::Payment for Bambora {} impl api::PaymentToken for Bambora {} @@ -430,6 +449,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/bitpay.rs b/crates/router/src/connector/bitpay.rs index 50873f8811a..52fd574b381 100644 --- a/crates/router/src/connector/bitpay.rs +++ b/crates/router/src/connector/bitpay.rs @@ -16,7 +16,7 @@ use crate::{ services::{ self, request::{self, Mask}, - ConnectorIntegration, + ConnectorIntegration, ConnectorValidation, }, types::{ self, @@ -120,6 +120,8 @@ impl ConnectorCommon for Bitpay { } } +impl ConnectorValidation for Bitpay {} + impl ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData> for Bitpay { @@ -178,6 +180,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/bluesnap.rs b/crates/router/src/connector/bluesnap.rs index 1dddead0f5a..6ffc2a6dc4e 100644 --- a/crates/router/src/connector/bluesnap.rs +++ b/crates/router/src/connector/bluesnap.rs @@ -7,6 +7,7 @@ use common_utils::{ crypto, ext_traits::{StringExt, ValueExt}, }; +use diesel_models::enums; use error_stack::{IntoReport, ResultExt}; use masking::PeekInterface; use transformers as bluesnap; @@ -27,14 +28,12 @@ use crate::{ services::{ self, request::{self, Mask}, - ConnectorIntegration, + ConnectorIntegration, ConnectorValidation, }, types::{ self, api::{self, ConnectorCommon, ConnectorCommonExt}, - domain, - storage::enums, - ErrorResponse, Response, + domain, ErrorResponse, Response, }, utils::{self, BytesExt}, }; @@ -141,6 +140,21 @@ impl ConnectorCommon for Bluesnap { } } +impl ConnectorValidation for Bluesnap { + fn validate_capture_method( + &self, + capture_method: Option<enums::CaptureMethod>, + ) -> CustomResult<(), errors::ConnectorError> { + let capture_method = capture_method.unwrap_or_default(); + match capture_method { + enums::CaptureMethod::Automatic | enums::CaptureMethod::Manual => Ok(()), + enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err( + connector_utils::construct_not_supported_error_report(capture_method, self.id()), + ), + } + } +} + impl api::Payment for Bluesnap {} impl api::PaymentToken for Bluesnap {} @@ -645,6 +659,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/boku.rs b/crates/router/src/connector/boku.rs index f9dec8a7e2b..70c296c4343 100644 --- a/crates/router/src/connector/boku.rs +++ b/crates/router/src/connector/boku.rs @@ -3,6 +3,7 @@ pub mod transformers; use std::fmt::Debug; use common_utils::ext_traits::XmlExt; +use diesel_models::enums; use error_stack::{IntoReport, Report, ResultExt}; use masking::{ExposeInterface, PeekInterface, Secret, WithType}; use ring::hmac; @@ -12,6 +13,7 @@ use transformers as boku; use crate::{ configs::settings, + connector::utils as connector_utils, consts, core::errors::{self, CustomResult}, headers, logger, @@ -19,7 +21,7 @@ use crate::{ services::{ self, request::{self, Mask}, - ConnectorIntegration, + ConnectorIntegration, ConnectorValidation, }, types::{ self, @@ -134,6 +136,21 @@ impl ConnectorCommon for Boku { } } +impl ConnectorValidation for Boku { + fn validate_capture_method( + &self, + capture_method: Option<enums::CaptureMethod>, + ) -> CustomResult<(), errors::ConnectorError> { + let capture_method = capture_method.unwrap_or_default(); + match capture_method { + enums::CaptureMethod::Automatic | enums::CaptureMethod::Manual => Ok(()), + enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err( + connector_utils::construct_not_supported_error_report(capture_method, self.id()), + ), + } + } +} + impl ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData> for Boku { @@ -200,6 +217,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/braintree.rs b/crates/router/src/connector/braintree.rs index 2b2dd3814e6..ad732442734 100644 --- a/crates/router/src/connector/braintree.rs +++ b/crates/router/src/connector/braintree.rs @@ -2,18 +2,21 @@ pub mod transformers; use std::fmt::Debug; +use diesel_models::enums; use error_stack::{IntoReport, Report, ResultExt}; use masking::PeekInterface; use self::transformers as braintree; use crate::{ configs::settings, + connector::utils as connector_utils, consts, core::errors::{self, CustomResult}, headers, logger, services::{ self, request::{self, Mask}, + ConnectorValidation, }, types::{ self, @@ -95,6 +98,21 @@ impl ConnectorCommon for Braintree { } } +impl ConnectorValidation for Braintree { + fn validate_capture_method( + &self, + capture_method: Option<enums::CaptureMethod>, + ) -> CustomResult<(), errors::ConnectorError> { + let capture_method = capture_method.unwrap_or_default(); + match capture_method { + enums::CaptureMethod::Automatic | enums::CaptureMethod::Manual => Ok(()), + enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err( + connector_utils::construct_not_implemented_error_report(capture_method, self.id()), + ), + } + } +} + impl api::Payment for Braintree {} impl api::PaymentAuthorize for Braintree {} @@ -406,6 +424,7 @@ impl req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/cashtocode.rs b/crates/router/src/connector/cashtocode.rs index 21f9b5267f7..cdba0ca6c40 100644 --- a/crates/router/src/connector/cashtocode.rs +++ b/crates/router/src/connector/cashtocode.rs @@ -2,20 +2,21 @@ pub mod transformers; use std::fmt::Debug; +use diesel_models::enums; use error_stack::{IntoReport, ResultExt}; use masking::PeekInterface; use transformers as cashtocode; use crate::{ configs::settings, - connector::utils as conn_utils, + connector::{utils as connector_utils, utils as conn_utils}, core::errors::{self, CustomResult}, db::StorageInterface, headers, services::{ self, request::{self, Mask}, - ConnectorIntegration, + ConnectorIntegration, ConnectorValidation, }, types::{ self, @@ -127,6 +128,21 @@ impl ConnectorCommon for Cashtocode { } } +impl ConnectorValidation for Cashtocode { + fn validate_capture_method( + &self, + capture_method: Option<enums::CaptureMethod>, + ) -> CustomResult<(), errors::ConnectorError> { + let capture_method = capture_method.unwrap_or_default(); + match capture_method { + enums::CaptureMethod::Automatic | enums::CaptureMethod::Manual => Ok(()), + enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err( + connector_utils::construct_not_supported_error_report(capture_method, self.id()), + ), + } + } +} + impl ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData> for Cashtocode { @@ -201,6 +217,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/checkout.rs b/crates/router/src/connector/checkout.rs index b6d15c26c94..3515533baa4 100644 --- a/crates/router/src/connector/checkout.rs +++ b/crates/router/src/connector/checkout.rs @@ -3,6 +3,7 @@ pub mod transformers; use std::fmt::Debug; use common_utils::{crypto, ext_traits::ByteSliceExt}; +use diesel_models::enums; use error_stack::{IntoReport, ResultExt}; use masking::PeekInterface; @@ -12,6 +13,7 @@ use super::utils::{ }; use crate::{ configs::settings, + connector::utils as connector_utils, consts, core::{ errors::{self, CustomResult}, @@ -21,7 +23,7 @@ use crate::{ services::{ self, request::{self, Mask}, - ConnectorIntegration, + ConnectorIntegration, ConnectorValidation, }, types::{ self, @@ -129,6 +131,21 @@ impl ConnectorCommon for Checkout { } } +impl ConnectorValidation for Checkout { + fn validate_capture_method( + &self, + capture_method: Option<enums::CaptureMethod>, + ) -> CustomResult<(), errors::ConnectorError> { + let capture_method = capture_method.unwrap_or_default(); + match capture_method { + enums::CaptureMethod::Automatic | enums::CaptureMethod::Manual => Ok(()), + enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err( + connector_utils::construct_not_implemented_error_report(capture_method, self.id()), + ), + } + } +} + impl api::Payment for Checkout {} impl api::PaymentAuthorize for Checkout {} @@ -454,6 +471,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P >, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/coinbase.rs b/crates/router/src/connector/coinbase.rs index 2d6411ccfd7..f1abe79ee02 100644 --- a/crates/router/src/connector/coinbase.rs +++ b/crates/router/src/connector/coinbase.rs @@ -3,6 +3,7 @@ pub mod transformers; use std::fmt::Debug; use common_utils::{crypto, ext_traits::ByteSliceExt}; +use diesel_models::enums; use error_stack::{IntoReport, ResultExt}; use transformers as coinbase; @@ -10,12 +11,13 @@ use self::coinbase::CoinbaseWebhookDetails; use super::utils; use crate::{ configs::settings, + connector::utils as connector_utils, core::errors::{self, CustomResult}, headers, services::{ self, request::{self, Mask}, - ConnectorIntegration, + ConnectorIntegration, ConnectorValidation, }, types::{ self, @@ -110,6 +112,21 @@ impl ConnectorCommon for Coinbase { } } +impl ConnectorValidation for Coinbase { + fn validate_capture_method( + &self, + capture_method: Option<enums::CaptureMethod>, + ) -> CustomResult<(), errors::ConnectorError> { + let capture_method = capture_method.unwrap_or_default(); + match capture_method { + enums::CaptureMethod::Automatic | enums::CaptureMethod::Manual => Ok(()), + enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err( + connector_utils::construct_not_supported_error_report(capture_method, self.id()), + ), + } + } +} + impl ConnectorIntegration< api::PaymentMethodToken, @@ -177,6 +194,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/cryptopay.rs b/crates/router/src/connector/cryptopay.rs index cbc33d7cee6..deaa79711aa 100644 --- a/crates/router/src/connector/cryptopay.rs +++ b/crates/router/src/connector/cryptopay.rs @@ -23,7 +23,7 @@ use crate::{ services::{ self, request::{self, Mask}, - ConnectorIntegration, + ConnectorIntegration, ConnectorValidation, }, types::{ self, @@ -167,6 +167,8 @@ impl ConnectorCommon for Cryptopay { } } +impl ConnectorValidation for Cryptopay {} + impl ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData> for Cryptopay { @@ -223,6 +225,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/cybersource.rs b/crates/router/src/connector/cybersource.rs index ac19553fdfe..1efda3fc149 100644 --- a/crates/router/src/connector/cybersource.rs +++ b/crates/router/src/connector/cybersource.rs @@ -3,6 +3,7 @@ pub mod transformers; use std::fmt::Debug; use base64::Engine; +use diesel_models::enums; use error_stack::{IntoReport, ResultExt}; use masking::{ExposeInterface, PeekInterface}; use ring::{digest, hmac}; @@ -12,14 +13,14 @@ use url::Url; use crate::{ configs::settings, - connector::utils::RefundsRequestData, + connector::{utils as connector_utils, utils::RefundsRequestData}, consts, core::errors::{self, CustomResult}, headers, services::{ self, request::{self, Mask}, - ConnectorIntegration, + ConnectorIntegration, ConnectorValidation, }, types::{ self, @@ -135,6 +136,21 @@ impl ConnectorCommon for Cybersource { } } +impl ConnectorValidation for Cybersource { + fn validate_capture_method( + &self, + capture_method: Option<enums::CaptureMethod>, + ) -> CustomResult<(), errors::ConnectorError> { + let capture_method = capture_method.unwrap_or_default(); + match capture_method { + enums::CaptureMethod::Automatic | enums::CaptureMethod::Manual => Ok(()), + enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err( + connector_utils::construct_not_implemented_error_report(capture_method, self.id()), + ), + } + } +} + impl<Flow, Request, Response> ConnectorCommonExt<Flow, Request, Response> for Cybersource where Self: ConnectorIntegration<Flow, Request, Response>, @@ -462,6 +478,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; let request = services::RequestBuilder::new() .method(services::Method::Post) .url(&types::PaymentsAuthorizeType::get_url( diff --git a/crates/router/src/connector/dlocal.rs b/crates/router/src/connector/dlocal.rs index c773316179b..17990792059 100644 --- a/crates/router/src/connector/dlocal.rs +++ b/crates/router/src/connector/dlocal.rs @@ -6,6 +6,7 @@ use common_utils::{ crypto::{self, SignMessage}, date_time, }; +use diesel_models::enums; use error_stack::{IntoReport, ResultExt}; use hex::encode; use masking::PeekInterface; @@ -13,12 +14,13 @@ use transformers as dlocal; use crate::{ configs::settings, + connector::utils as connector_utils, core::errors::{self, CustomResult}, headers, logger, services::{ self, request::{self, Mask}, - ConnectorIntegration, + ConnectorIntegration, ConnectorValidation, }, types::{ self, @@ -133,6 +135,21 @@ impl ConnectorCommon for Dlocal { } } +impl ConnectorValidation for Dlocal { + fn validate_capture_method( + &self, + capture_method: Option<enums::CaptureMethod>, + ) -> CustomResult<(), errors::ConnectorError> { + let capture_method = capture_method.unwrap_or_default(); + match capture_method { + enums::CaptureMethod::Automatic | enums::CaptureMethod::Manual => Ok(()), + enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err( + connector_utils::construct_not_supported_error_report(capture_method, self.id()), + ), + } + } +} + impl ConnectorIntegration< api::PaymentMethodToken, @@ -200,6 +217,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/dummyconnector.rs b/crates/router/src/connector/dummyconnector.rs index 6e7f47249f2..8f3f3181012 100644 --- a/crates/router/src/connector/dummyconnector.rs +++ b/crates/router/src/connector/dummyconnector.rs @@ -8,12 +8,13 @@ use error_stack::{IntoReport, ResultExt}; use super::utils::RefundsRequestData; use crate::{ configs::settings, + connector::utils as connector_utils, core::errors::{self, CustomResult}, headers, services::{ self, request::{self, Mask}, - ConnectorIntegration, + ConnectorIntegration, ConnectorValidation, }, types::{ self, @@ -114,6 +115,21 @@ impl<const T: u8> ConnectorCommon for DummyConnector<T> { } } +impl<const T: u8> ConnectorValidation for DummyConnector<T> { + fn validate_capture_method( + &self, + capture_method: Option<enums::CaptureMethod>, + ) -> CustomResult<(), errors::ConnectorError> { + let capture_method = capture_method.unwrap_or_default(); + match capture_method { + enums::CaptureMethod::Automatic | enums::CaptureMethod::Manual => Ok(()), + enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err( + connector_utils::construct_not_supported_error_report(capture_method, self.id()), + ), + } + } +} + impl<const T: u8> ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData> for DummyConnector<T> @@ -183,6 +199,7 @@ impl<const T: u8> req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/fiserv.rs b/crates/router/src/connector/fiserv.rs index 95e3238dd98..2a4093a24aa 100644 --- a/crates/router/src/connector/fiserv.rs +++ b/crates/router/src/connector/fiserv.rs @@ -3,6 +3,7 @@ pub mod transformers; use std::fmt::Debug; use base64::Engine; +use diesel_models::enums; use error_stack::{IntoReport, ResultExt}; use masking::{ExposeInterface, PeekInterface}; use ring::hmac; @@ -12,6 +13,7 @@ use uuid::Uuid; use crate::{ configs::settings, + connector::utils as connector_utils, consts, core::errors::{self, CustomResult}, headers, logger, @@ -19,6 +21,7 @@ use crate::{ self, api::ConnectorIntegration, request::{self, Mask}, + ConnectorValidation, }, types::{ self, @@ -155,6 +158,21 @@ impl ConnectorCommon for Fiserv { } } +impl ConnectorValidation for Fiserv { + fn validate_capture_method( + &self, + capture_method: Option<enums::CaptureMethod>, + ) -> CustomResult<(), errors::ConnectorError> { + let capture_method = capture_method.unwrap_or_default(); + match capture_method { + enums::CaptureMethod::Automatic | enums::CaptureMethod::Manual => Ok(()), + enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err( + connector_utils::construct_not_implemented_error_report(capture_method, self.id()), + ), + } + } +} + impl api::ConnectorAccessToken for Fiserv {} impl ConnectorIntegration<api::AccessTokenAuth, types::AccessTokenRequestData, types::AccessToken> @@ -497,6 +515,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; let request = Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/forte.rs b/crates/router/src/connector/forte.rs index 2984dce72ab..f94b2c4945b 100644 --- a/crates/router/src/connector/forte.rs +++ b/crates/router/src/connector/forte.rs @@ -3,20 +3,24 @@ pub mod transformers; use std::fmt::Debug; use base64::Engine; +use diesel_models::enums; use error_stack::{IntoReport, ResultExt}; use masking::PeekInterface; use transformers as forte; use crate::{ configs::settings, - connector::utils::{PaymentsSyncRequestData, RefundsRequestData}, + connector::{ + utils as connector_utils, + utils::{PaymentsSyncRequestData, RefundsRequestData}, + }, consts, core::errors::{self, CustomResult}, headers, services::{ self, request::{self, Mask}, - ConnectorIntegration, + ConnectorIntegration, ConnectorValidation, }, types::{ self, @@ -130,6 +134,21 @@ impl ConnectorCommon for Forte { } } +impl ConnectorValidation for Forte { + fn validate_capture_method( + &self, + capture_method: Option<enums::CaptureMethod>, + ) -> CustomResult<(), errors::ConnectorError> { + let capture_method = capture_method.unwrap_or_default(); + match capture_method { + enums::CaptureMethod::Automatic | enums::CaptureMethod::Manual => Ok(()), + enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err( + connector_utils::construct_not_supported_error_report(capture_method, self.id()), + ), + } + } +} + impl ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData> for Forte { @@ -192,6 +211,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/globalpay.rs b/crates/router/src/connector/globalpay.rs index e045c4b3739..ba4afa73e47 100644 --- a/crates/router/src/connector/globalpay.rs +++ b/crates/router/src/connector/globalpay.rs @@ -5,6 +5,7 @@ pub mod transformers; use std::fmt::Debug; use ::common_utils::{errors::ReportSwitchExt, ext_traits::ByteSliceExt}; +use diesel_models::enums; use error_stack::{IntoReport, ResultExt}; use masking::PeekInterface; use serde_json::Value; @@ -19,7 +20,7 @@ use self::{ use super::utils::RefundsRequestData; use crate::{ configs::settings, - connector::utils as conn_utils, + connector::{utils as connector_utils, utils as conn_utils}, core::{ errors::{self, CustomResult}, payments, @@ -28,7 +29,7 @@ use crate::{ services::{ self, request::{self, Mask}, - ConnectorIntegration, + ConnectorIntegration, ConnectorValidation, }, types::{ self, @@ -107,6 +108,21 @@ impl ConnectorCommon for Globalpay { } } +impl ConnectorValidation for Globalpay { + fn validate_capture_method( + &self, + capture_method: Option<enums::CaptureMethod>, + ) -> CustomResult<(), errors::ConnectorError> { + let capture_method = capture_method.unwrap_or_default(); + match capture_method { + enums::CaptureMethod::Automatic | enums::CaptureMethod::Manual => Ok(()), + enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err( + connector_utils::construct_not_implemented_error_report(capture_method, self.id()), + ), + } + } +} + impl PaymentsCompleteAuthorize for Globalpay {} impl @@ -609,6 +625,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/globepay.rs b/crates/router/src/connector/globepay.rs index 002d06fa0cf..68b8e8b67e3 100644 --- a/crates/router/src/connector/globepay.rs +++ b/crates/router/src/connector/globepay.rs @@ -3,6 +3,7 @@ pub mod transformers; use std::fmt::Debug; use common_utils::crypto::{self, GenerateDigest}; +use diesel_models::enums; use error_stack::{IntoReport, ResultExt}; use hex::encode; use masking::ExposeInterface; @@ -15,11 +16,10 @@ use crate::{ consts, core::errors::{self, CustomResult}, headers, - services::{self, request, ConnectorIntegration}, + services::{self, request, ConnectorIntegration, ConnectorValidation}, types::{ self, api::{self, ConnectorCommon, ConnectorCommonExt}, - storage::enums, ErrorResponse, Response, }, utils::{self, BytesExt}, @@ -126,6 +126,8 @@ impl ConnectorCommon for Globepay { } } +impl ConnectorValidation for Globepay {} + impl ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData> for Globepay { @@ -196,6 +198,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Put) diff --git a/crates/router/src/connector/iatapay.rs b/crates/router/src/connector/iatapay.rs index b3025363dc4..298f9967cc8 100644 --- a/crates/router/src/connector/iatapay.rs +++ b/crates/router/src/connector/iatapay.rs @@ -18,7 +18,7 @@ use crate::{ services::{ self, request::{self, Mask}, - ConnectorIntegration, + ConnectorIntegration, ConnectorValidation, }, types::{ self, @@ -124,6 +124,8 @@ impl ConnectorCommon for Iatapay { } } +impl ConnectorValidation for Iatapay {} + impl ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData> for Iatapay { @@ -279,6 +281,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/klarna.rs b/crates/router/src/connector/klarna.rs index f6cb701e5c3..9724a00edfe 100644 --- a/crates/router/src/connector/klarna.rs +++ b/crates/router/src/connector/klarna.rs @@ -14,6 +14,7 @@ use crate::{ services::{ self, request::{self, Mask}, + ConnectorValidation, }, types::{ self, @@ -74,6 +75,8 @@ impl ConnectorCommon for Klarna { } } +impl ConnectorValidation for Klarna {} + impl api::Payment for Klarna {} impl api::PaymentAuthorize for Klarna {} @@ -314,6 +317,7 @@ impl req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/mollie.rs b/crates/router/src/connector/mollie.rs index e49b6deeda3..a9a82c4d45e 100644 --- a/crates/router/src/connector/mollie.rs +++ b/crates/router/src/connector/mollie.rs @@ -17,7 +17,7 @@ use crate::{ services::{ self, request::{self, Mask}, - ConnectorIntegration, + ConnectorIntegration, ConnectorValidation, }, types::{ self, @@ -98,6 +98,8 @@ impl ConnectorCommon for Mollie { } } +impl ConnectorValidation for Mollie {} + impl ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData> for Mollie { @@ -237,6 +239,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/multisafepay.rs b/crates/router/src/connector/multisafepay.rs index cf3e83d5909..21bbb3745af 100644 --- a/crates/router/src/connector/multisafepay.rs +++ b/crates/router/src/connector/multisafepay.rs @@ -13,11 +13,12 @@ use crate::{ services::{ self, request::{self, Mask}, - ConnectorIntegration, + ConnectorIntegration, ConnectorValidation, }, types::{ self, api::{self, ConnectorCommon, ConnectorCommonExt}, + storage::enums, ErrorResponse, Response, }, utils::{self, BytesExt}, @@ -82,6 +83,24 @@ impl ConnectorCommon for Multisafepay { } } +impl ConnectorValidation for Multisafepay { + fn validate_capture_method( + &self, + capture_method: Option<enums::CaptureMethod>, + ) -> CustomResult<(), errors::ConnectorError> { + let capture_method = capture_method.unwrap_or_default(); + match capture_method { + enums::CaptureMethod::Automatic => Ok(()), + enums::CaptureMethod::Manual + | enums::CaptureMethod::ManualMultiple + | enums::CaptureMethod::Scheduled => Err(errors::ConnectorError::NotImplemented( + format!("{} for {}", capture_method, self.id()), + ) + .into()), + } + } +} + impl api::Payment for Multisafepay {} impl api::PaymentToken for Multisafepay {} @@ -248,6 +267,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/nexinets.rs b/crates/router/src/connector/nexinets.rs index c62a8dae446..2ff4e0648bc 100644 --- a/crates/router/src/connector/nexinets.rs +++ b/crates/router/src/connector/nexinets.rs @@ -7,13 +7,16 @@ use transformers as nexinets; use crate::{ configs::settings, - connector::utils::{to_connector_meta, PaymentsSyncRequestData}, + connector::{ + utils as connector_utils, + utils::{to_connector_meta, PaymentsSyncRequestData}, + }, core::errors::{self, CustomResult}, headers, services::{ self, request::{self, Mask}, - ConnectorIntegration, + ConnectorIntegration, ConnectorValidation, }, types::{ self, @@ -131,6 +134,21 @@ impl ConnectorCommon for Nexinets { } } +impl ConnectorValidation for Nexinets { + fn validate_capture_method( + &self, + capture_method: Option<enums::CaptureMethod>, + ) -> CustomResult<(), errors::ConnectorError> { + let capture_method = capture_method.unwrap_or_default(); + match capture_method { + enums::CaptureMethod::Automatic | enums::CaptureMethod::Manual => Ok(()), + enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err( + connector_utils::construct_not_implemented_error_report(capture_method, self.id()), + ), + } + } +} + impl ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData> for Nexinets { @@ -192,6 +210,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/nmi.rs b/crates/router/src/connector/nmi.rs index c7b34d9ff2f..85b7b1da054 100644 --- a/crates/router/src/connector/nmi.rs +++ b/crates/router/src/connector/nmi.rs @@ -3,14 +3,16 @@ pub mod transformers; use std::fmt::Debug; use common_utils::ext_traits::ByteSliceExt; +use diesel_models::enums; use error_stack::{IntoReport, ResultExt}; use transformers as nmi; use self::transformers::NmiCaptureRequest; use crate::{ configs::settings, + connector::utils as connector_utils, core::errors::{self, CustomResult}, - services::{self, request, ConnectorIntegration}, + services::{self, request, ConnectorIntegration, ConnectorValidation}, types::{ self, api::{self, ConnectorCommon, ConnectorCommonExt}, @@ -77,6 +79,21 @@ impl ConnectorCommon for Nmi { } } +impl ConnectorValidation for Nmi { + fn validate_capture_method( + &self, + capture_method: Option<enums::CaptureMethod>, + ) -> CustomResult<(), errors::ConnectorError> { + let capture_method = capture_method.unwrap_or_default(); + match capture_method { + enums::CaptureMethod::Automatic | enums::CaptureMethod::Manual => Ok(()), + enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err( + connector_utils::construct_not_supported_error_report(capture_method, self.id()), + ), + } + } +} + impl ConnectorIntegration< api::PaymentMethodToken, @@ -205,6 +222,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/noon.rs b/crates/router/src/connector/noon.rs index 2fe526a6bd9..ce8aa36fb00 100644 --- a/crates/router/src/connector/noon.rs +++ b/crates/router/src/connector/noon.rs @@ -4,6 +4,7 @@ use std::fmt::Debug; use base64::Engine; use common_utils::{crypto, ext_traits::ByteSliceExt}; +use diesel_models::enums; use error_stack::{IntoReport, ResultExt}; use masking::PeekInterface; use transformers as noon; @@ -11,6 +12,7 @@ use transformers as noon; use super::utils::PaymentsSyncRequestData; use crate::{ configs::settings, + connector::utils as connector_utils, consts, core::{ errors::{self, CustomResult}, @@ -20,7 +22,7 @@ use crate::{ services::{ self, request::{self, Mask}, - ConnectorIntegration, + ConnectorIntegration, ConnectorValidation, }, types::{ self, @@ -130,6 +132,21 @@ impl ConnectorCommon for Noon { } } +impl ConnectorValidation for Noon { + fn validate_capture_method( + &self, + capture_method: Option<enums::CaptureMethod>, + ) -> CustomResult<(), errors::ConnectorError> { + let capture_method = capture_method.unwrap_or_default(); + match capture_method { + enums::CaptureMethod::Automatic | enums::CaptureMethod::Manual => Ok(()), + enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err( + connector_utils::construct_not_implemented_error_report(capture_method, self.id()), + ), + } + } +} + impl ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData> for Noon { @@ -187,6 +204,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/nuvei.rs b/crates/router/src/connector/nuvei.rs index 2c90077f09c..8286d148f18 100644 --- a/crates/router/src/connector/nuvei.rs +++ b/crates/router/src/connector/nuvei.rs @@ -18,7 +18,7 @@ use crate::{ payments, }, headers, - services::{self, request, ConnectorIntegration}, + services::{self, request, ConnectorIntegration, ConnectorValidation}, types::{ self, api::{self, ConnectorCommon, ConnectorCommonExt, InitPayment}, @@ -69,6 +69,21 @@ impl ConnectorCommon for Nuvei { } } +impl ConnectorValidation for Nuvei { + fn validate_capture_method( + &self, + capture_method: Option<enums::CaptureMethod>, + ) -> CustomResult<(), errors::ConnectorError> { + let capture_method = capture_method.unwrap_or_default(); + match capture_method { + enums::CaptureMethod::Automatic | enums::CaptureMethod::Manual => Ok(()), + enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err( + utils::construct_not_supported_error_report(capture_method, self.id()), + ), + } + } +} + impl api::Payment for Nuvei {} impl api::PaymentToken for Nuvei {} @@ -552,6 +567,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/opayo.rs b/crates/router/src/connector/opayo.rs index fd28cebf674..47a0c331705 100644 --- a/crates/router/src/connector/opayo.rs +++ b/crates/router/src/connector/opayo.rs @@ -2,18 +2,20 @@ mod transformers; use std::fmt::Debug; +use diesel_models::enums; use error_stack::{IntoReport, ResultExt}; use masking::ExposeInterface; use transformers as opayo; use crate::{ configs::settings, + connector::utils as connector_utils, core::errors::{self, CustomResult}, headers, services::{ self, request::{self, Mask}, - ConnectorIntegration, + ConnectorIntegration, ConnectorValidation, }, types::{ self, @@ -109,6 +111,21 @@ impl ConnectorCommon for Opayo { } } +impl ConnectorValidation for Opayo { + fn validate_capture_method( + &self, + capture_method: Option<enums::CaptureMethod>, + ) -> CustomResult<(), errors::ConnectorError> { + let capture_method = capture_method.unwrap_or_default(); + match capture_method { + enums::CaptureMethod::Automatic | enums::CaptureMethod::Manual => Ok(()), + enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err( + connector_utils::construct_not_supported_error_report(capture_method, self.id()), + ), + } + } +} + impl ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData> for Opayo { @@ -166,6 +183,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/opennode.rs b/crates/router/src/connector/opennode.rs index 96e1b8654be..af6b6d7e034 100644 --- a/crates/router/src/connector/opennode.rs +++ b/crates/router/src/connector/opennode.rs @@ -15,7 +15,7 @@ use crate::{ services::{ self, request::{self, Mask}, - ConnectorIntegration, + ConnectorIntegration, ConnectorValidation, }, types::{ self, @@ -110,6 +110,8 @@ impl ConnectorCommon for Opennode { } } +impl ConnectorValidation for Opennode {} + impl ConnectorIntegration< api::PaymentMethodToken, @@ -177,6 +179,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/payeezy.rs b/crates/router/src/connector/payeezy.rs index 823bd60c158..c02b1dc2844 100644 --- a/crates/router/src/connector/payeezy.rs +++ b/crates/router/src/connector/payeezy.rs @@ -3,6 +3,7 @@ mod transformers; use std::fmt::Debug; use base64::Engine; +use diesel_models::enums; use error_stack::{IntoReport, ResultExt}; use masking::ExposeInterface; use rand::distributions::DistString; @@ -11,13 +12,14 @@ use transformers as payeezy; use crate::{ configs::settings, + connector::utils as connector_utils, consts, core::errors::{self, CustomResult}, headers, services::{ self, request::{self, Mask}, - ConnectorIntegration, + ConnectorIntegration, ConnectorValidation, }, types::{ self, @@ -121,6 +123,21 @@ impl ConnectorCommon for Payeezy { } } +impl ConnectorValidation for Payeezy { + fn validate_capture_method( + &self, + capture_method: Option<enums::CaptureMethod>, + ) -> CustomResult<(), errors::ConnectorError> { + let capture_method = capture_method.unwrap_or_default(); + match capture_method { + enums::CaptureMethod::Automatic | enums::CaptureMethod::Manual => Ok(()), + enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err( + connector_utils::construct_not_implemented_error_report(capture_method, self.id()), + ), + } + } +} + impl api::Payment for Payeezy {} impl api::PreVerify for Payeezy {} @@ -373,6 +390,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/payme.rs b/crates/router/src/connector/payme.rs index fe0e05c6f4c..6e78269de20 100644 --- a/crates/router/src/connector/payme.rs +++ b/crates/router/src/connector/payme.rs @@ -3,15 +3,17 @@ pub mod transformers; use std::fmt::Debug; use common_utils::crypto; +use diesel_models::enums; use error_stack::{IntoReport, ResultExt}; use masking::ExposeInterface; use transformers as payme; use crate::{ configs::settings, + connector::utils as connector_utils, core::errors::{self, CustomResult}, headers, - services::{self, request, ConnectorIntegration}, + services::{self, request, ConnectorIntegration, ConnectorValidation}, types::{ self, api::{self, ConnectorCommon, ConnectorCommonExt}, @@ -99,6 +101,21 @@ impl ConnectorCommon for Payme { } } +impl ConnectorValidation for Payme { + fn validate_capture_method( + &self, + capture_method: Option<enums::CaptureMethod>, + ) -> CustomResult<(), errors::ConnectorError> { + let capture_method = capture_method.unwrap_or_default(); + match capture_method { + enums::CaptureMethod::Automatic | enums::CaptureMethod::Manual => Ok(()), + enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err( + connector_utils::construct_not_supported_error_report(capture_method, self.id()), + ), + } + } +} + impl ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData> for Payme { @@ -258,6 +275,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/paypal.rs b/crates/router/src/connector/paypal.rs index fa92b233f49..32e6fb08c35 100644 --- a/crates/router/src/connector/paypal.rs +++ b/crates/router/src/connector/paypal.rs @@ -2,6 +2,7 @@ pub mod transformers; use std::fmt::Debug; use base64::Engine; +use diesel_models::enums; use error_stack::{IntoReport, ResultExt}; use masking::PeekInterface; use transformers as paypal; @@ -9,7 +10,10 @@ use transformers as paypal; use self::transformers::PaypalMeta; use crate::{ configs::settings, - connector::utils::{to_connector_meta, RefundsRequestData}, + connector::{ + utils as connector_utils, + utils::{to_connector_meta, RefundsRequestData}, + }, consts, core::{ errors::{self, CustomResult}, @@ -19,7 +23,7 @@ use crate::{ services::{ self, request::{self, Mask}, - ConnectorIntegration, PaymentAction, + ConnectorIntegration, ConnectorValidation, PaymentAction, }, types::{ self, @@ -192,6 +196,21 @@ impl ConnectorCommon for Paypal { } } +impl ConnectorValidation for Paypal { + fn validate_capture_method( + &self, + capture_method: Option<enums::CaptureMethod>, + ) -> CustomResult<(), errors::ConnectorError> { + let capture_method = capture_method.unwrap_or_default(); + match capture_method { + enums::CaptureMethod::Automatic | enums::CaptureMethod::Manual => Ok(()), + enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err( + connector_utils::construct_not_implemented_error_report(capture_method, self.id()), + ), + } + } +} + impl ConnectorIntegration< api::PaymentMethodToken, @@ -356,6 +375,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/payu.rs b/crates/router/src/connector/payu.rs index dd04262eb30..5f2d4409058 100644 --- a/crates/router/src/connector/payu.rs +++ b/crates/router/src/connector/payu.rs @@ -2,18 +2,20 @@ pub mod transformers; use std::fmt::Debug; +use diesel_models::enums; use error_stack::{IntoReport, ResultExt}; use masking::PeekInterface; use transformers as payu; use crate::{ configs::settings, + connector::utils as connector_utils, core::errors::{self, CustomResult}, headers, services::{ self, request::{self, Mask}, - ConnectorIntegration, + ConnectorIntegration, ConnectorValidation, }, types::{ self, @@ -98,6 +100,21 @@ impl ConnectorCommon for Payu { } } +impl ConnectorValidation for Payu { + fn validate_capture_method( + &self, + capture_method: Option<enums::CaptureMethod>, + ) -> CustomResult<(), errors::ConnectorError> { + let capture_method = capture_method.unwrap_or_default(); + match capture_method { + enums::CaptureMethod::Automatic | enums::CaptureMethod::Manual => Ok(()), + enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err( + connector_utils::construct_not_supported_error_report(capture_method, self.id()), + ), + } + } +} + impl api::Payment for Payu {} impl api::PreVerify for Payu {} @@ -508,6 +525,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P >, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/powertranz.rs b/crates/router/src/connector/powertranz.rs index 91392a27c32..4cd8f610594 100644 --- a/crates/router/src/connector/powertranz.rs +++ b/crates/router/src/connector/powertranz.rs @@ -4,11 +4,14 @@ use std::fmt::Debug; use api_models::enums::AuthenticationType; use common_utils::ext_traits::ValueExt; +use diesel_models::enums; use error_stack::{IntoReport, ResultExt}; use masking::ExposeInterface; use transformers as powertranz; -use super::utils::{PaymentsAuthorizeRequestData, PaymentsCompleteAuthorizeRequestData}; +use super::utils::{ + self as connector_utils, PaymentsAuthorizeRequestData, PaymentsCompleteAuthorizeRequestData, +}; use crate::{ configs::settings, consts, @@ -17,7 +20,7 @@ use crate::{ services::{ self, request::{self, Mask}, - ConnectorIntegration, + ConnectorIntegration, ConnectorValidation, }, types::{ self, @@ -121,6 +124,21 @@ impl ConnectorCommon for Powertranz { } } +impl ConnectorValidation for Powertranz { + fn validate_capture_method( + &self, + capture_method: Option<enums::CaptureMethod>, + ) -> CustomResult<(), errors::ConnectorError> { + let capture_method = capture_method.unwrap_or_default(); + match capture_method { + enums::CaptureMethod::Automatic | enums::CaptureMethod::Manual => Ok(()), + enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err( + connector_utils::construct_not_supported_error_report(capture_method, self.id()), + ), + } + } +} + impl ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData> for Powertranz { @@ -186,6 +204,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/rapyd.rs b/crates/router/src/connector/rapyd.rs index 29993a015e3..926a90bca87 100644 --- a/crates/router/src/connector/rapyd.rs +++ b/crates/router/src/connector/rapyd.rs @@ -3,6 +3,7 @@ use std::fmt::Debug; use base64::Engine; use common_utils::{date_time, ext_traits::StringExt}; +use diesel_models::enums; use error_stack::{IntoReport, Report, ResultExt}; use masking::{ExposeInterface, PeekInterface}; use rand::distributions::{Alphanumeric, DistString}; @@ -11,7 +12,7 @@ use transformers as rapyd; use crate::{ configs::settings, - connector::utils as conn_utils, + connector::{utils as connector_utils, utils as conn_utils}, consts, core::errors::{self, CustomResult}, db::StorageInterface, @@ -19,6 +20,7 @@ use crate::{ services::{ self, request::{self, Mask}, + ConnectorValidation, }, types::{ self, @@ -102,6 +104,21 @@ impl ConnectorCommon for Rapyd { } } +impl ConnectorValidation for Rapyd { + fn validate_capture_method( + &self, + capture_method: Option<enums::CaptureMethod>, + ) -> CustomResult<(), errors::ConnectorError> { + let capture_method = capture_method.unwrap_or_default(); + match capture_method { + enums::CaptureMethod::Automatic | enums::CaptureMethod::Manual => Ok(()), + enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err( + connector_utils::construct_not_supported_error_report(capture_method, self.id()), + ), + } + } +} + impl api::ConnectorAccessToken for Rapyd {} impl api::PaymentToken for Rapyd {} @@ -181,6 +198,7 @@ impl >, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; let timestamp = date_time::now_unix_timestamp(); let salt = Alphanumeric.sample_string(&mut rand::thread_rng(), 12); diff --git a/crates/router/src/connector/shift4.rs b/crates/router/src/connector/shift4.rs index 8d6e8d0fd00..8694f4b78be 100644 --- a/crates/router/src/connector/shift4.rs +++ b/crates/router/src/connector/shift4.rs @@ -3,10 +3,11 @@ pub mod transformers; use std::fmt::Debug; use common_utils::ext_traits::ByteSliceExt; +use diesel_models::enums; use error_stack::{IntoReport, ResultExt}; use transformers as shift4; -use super::utils::RefundsRequestData; +use super::utils::{self as connector_utils, RefundsRequestData}; use crate::{ configs::settings, consts, @@ -18,7 +19,7 @@ use crate::{ services::{ self, request::{self, Mask}, - ConnectorIntegration, + ConnectorIntegration, ConnectorValidation, }, types::{ self, @@ -102,6 +103,21 @@ impl ConnectorCommon for Shift4 { } } +impl ConnectorValidation for Shift4 { + fn validate_capture_method( + &self, + capture_method: Option<enums::CaptureMethod>, + ) -> CustomResult<(), errors::ConnectorError> { + let capture_method = capture_method.unwrap_or_default(); + match capture_method { + enums::CaptureMethod::Automatic | enums::CaptureMethod::Manual => Ok(()), + enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err( + connector_utils::construct_not_supported_error_report(capture_method, self.id()), + ), + } + } +} + impl api::Payment for Shift4 {} impl api::PaymentVoid for Shift4 {} impl api::PaymentSync for Shift4 {} @@ -219,6 +235,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/square.rs b/crates/router/src/connector/square.rs index 1cb4a2aee66..ce3d9fbfadf 100644 --- a/crates/router/src/connector/square.rs +++ b/crates/router/src/connector/square.rs @@ -13,7 +13,7 @@ use crate::{ services::{ self, request::{self, Mask}, - ConnectorIntegration, + ConnectorIntegration, ConnectorValidation, }, types::{ self, @@ -113,6 +113,8 @@ impl ConnectorCommon for Square { } } +impl ConnectorValidation for Square {} + impl ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData> for Square { @@ -170,6 +172,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/stax.rs b/crates/router/src/connector/stax.rs index a024923be63..12a4494bbfd 100644 --- a/crates/router/src/connector/stax.rs +++ b/crates/router/src/connector/stax.rs @@ -3,12 +3,13 @@ pub mod transformers; use std::fmt::Debug; use common_utils::ext_traits::ByteSliceExt; +use diesel_models::enums; use error_stack::{IntoReport, ResultExt}; use masking::PeekInterface; use transformers as stax; use self::stax::StaxWebhookEventType; -use super::utils::{to_connector_meta, RefundsRequestData}; +use super::utils::{self as connector_utils, to_connector_meta, RefundsRequestData}; use crate::{ configs::settings, consts, @@ -18,7 +19,7 @@ use crate::{ services::{ self, request::{self, Mask}, - ConnectorIntegration, + ConnectorIntegration, ConnectorValidation, }, types::{ self, @@ -109,6 +110,21 @@ impl ConnectorCommon for Stax { } } +impl ConnectorValidation for Stax { + fn validate_capture_method( + &self, + capture_method: Option<enums::CaptureMethod>, + ) -> CustomResult<(), errors::ConnectorError> { + let capture_method = capture_method.unwrap_or_default(); + match capture_method { + enums::CaptureMethod::Automatic | enums::CaptureMethod::Manual => Ok(()), + enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err( + connector_utils::construct_not_supported_error_report(capture_method, self.id()), + ), + } + } +} + impl api::ConnectorCustomer for Stax {} impl @@ -343,6 +359,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/stripe.rs b/crates/router/src/connector/stripe.rs index eb96e166f1c..f7dcebe10fa 100644 --- a/crates/router/src/connector/stripe.rs +++ b/crates/router/src/connector/stripe.rs @@ -8,7 +8,7 @@ use masking::PeekInterface; use router_env::{instrument, tracing}; use self::transformers as stripe; -use super::utils::RefundsRequestData; +use super::utils::{self as connector_utils, RefundsRequestData}; use crate::{ configs::settings, consts, @@ -20,6 +20,7 @@ use crate::{ services::{ self, request::{self, Mask}, + ConnectorValidation, }, types::{ self, @@ -59,6 +60,21 @@ impl ConnectorCommon for Stripe { } } +impl ConnectorValidation for Stripe { + fn validate_capture_method( + &self, + capture_method: Option<enums::CaptureMethod>, + ) -> CustomResult<(), errors::ConnectorError> { + let capture_method = capture_method.unwrap_or_default(); + match capture_method { + enums::CaptureMethod::Automatic | enums::CaptureMethod::Manual => Ok(()), + enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err( + connector_utils::construct_not_supported_error_report(capture_method, self.id()), + ), + } + } +} + impl api::Payment for Stripe {} impl api::PaymentAuthorize for Stripe {} @@ -771,6 +787,7 @@ impl req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/trustpay.rs b/crates/router/src/connector/trustpay.rs index 14dbe14f4d6..cb708336a6d 100644 --- a/crates/router/src/connector/trustpay.rs +++ b/crates/router/src/connector/trustpay.rs @@ -23,7 +23,7 @@ use crate::{ services::{ self, request::{self, Mask}, - ConnectorIntegration, + ConnectorIntegration, ConnectorValidation, }, types::{ self, @@ -144,6 +144,8 @@ impl ConnectorCommon for Trustpay { } } +impl ConnectorValidation for Trustpay {} + impl api::Payment for Trustpay {} impl api::PaymentToken for Trustpay {} @@ -546,6 +548,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/tsys.rs b/crates/router/src/connector/tsys.rs index f7cab44071c..32bce79b503 100644 --- a/crates/router/src/connector/tsys.rs +++ b/crates/router/src/connector/tsys.rs @@ -2,14 +2,20 @@ pub mod transformers; use std::fmt::Debug; +use diesel_models::enums; use error_stack::{IntoReport, ResultExt}; use transformers as tsys; use crate::{ configs::settings, + connector::utils as connector_utils, core::errors::{self, CustomResult}, headers, - services::{self, request, ConnectorIntegration}, + services::{ + self, + request::{self}, + ConnectorIntegration, ConnectorValidation, + }, types::{ self, api::{self, ConnectorCommon, ConnectorCommonExt}, @@ -74,6 +80,21 @@ impl ConnectorCommon for Tsys { } } +impl ConnectorValidation for Tsys { + fn validate_capture_method( + &self, + capture_method: Option<enums::CaptureMethod>, + ) -> CustomResult<(), errors::ConnectorError> { + let capture_method = capture_method.unwrap_or_default(); + match capture_method { + enums::CaptureMethod::Automatic | enums::CaptureMethod::Manual => Ok(()), + enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err( + connector_utils::construct_not_supported_error_report(capture_method, self.id()), + ), + } + } +} + impl ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData> for Tsys { @@ -133,6 +154,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/utils.rs b/crates/router/src/connector/utils.rs index b64f18bc05c..cb9d1968509 100644 --- a/crates/router/src/connector/utils.rs +++ b/crates/router/src/connector/utils.rs @@ -10,6 +10,7 @@ use common_utils::{ errors::ReportSwitchExt, pii::{self, Email, IpAddress}, }; +use diesel_models::enums; use error_stack::{report, IntoReport, ResultExt}; use masking::{ExposeInterface, Secret}; use once_cell::sync::Lazy; @@ -972,6 +973,25 @@ pub fn to_currency_base_unit( .change_context(errors::ConnectorError::RequestEncodingFailed) } +pub fn construct_not_implemented_error_report( + capture_method: enums::CaptureMethod, + connector_name: &str, +) -> error_stack::Report<errors::ConnectorError> { + errors::ConnectorError::NotImplemented(format!("{} for {}", capture_method, connector_name)) + .into() +} + +pub fn construct_not_supported_error_report( + capture_method: enums::CaptureMethod, + connector_name: &'static str, +) -> error_stack::Report<errors::ConnectorError> { + errors::ConnectorError::NotSupported { + message: capture_method.to_string(), + connector: connector_name, + } + .into() +} + pub fn to_currency_base_unit_with_zero_decimal_check( amount: i64, currency: diesel_models::enums::Currency, diff --git a/crates/router/src/connector/worldline.rs b/crates/router/src/connector/worldline.rs index b258cd98d63..72479d14c6f 100644 --- a/crates/router/src/connector/worldline.rs +++ b/crates/router/src/connector/worldline.rs @@ -14,14 +14,14 @@ use transformers as worldline; use super::utils::RefundsRequestData; use crate::{ configs::settings::Connectors, - connector::utils as conn_utils, + connector::{utils as connector_utils, utils as conn_utils}, consts, core::errors::{self, CustomResult}, headers, logger, services::{ self, request::{self, Mask}, - ConnectorIntegration, + ConnectorIntegration, ConnectorValidation, }, types::{ self, @@ -138,6 +138,21 @@ impl ConnectorCommon for Worldline { } } +impl ConnectorValidation for Worldline { + fn validate_capture_method( + &self, + capture_method: Option<enums::CaptureMethod>, + ) -> CustomResult<(), errors::ConnectorError> { + let capture_method = capture_method.unwrap_or_default(); + match capture_method { + enums::CaptureMethod::Automatic | enums::CaptureMethod::Manual => Ok(()), + enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err( + connector_utils::construct_not_implemented_error_report(capture_method, self.id()), + ), + } + } +} + impl api::ConnectorAccessToken for Worldline {} impl ConnectorIntegration<api::AccessTokenAuth, types::AccessTokenRequestData, types::AccessToken> @@ -485,6 +500,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P >, connectors: &Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(types::PaymentsAuthorizeType::get_http_method(self)) diff --git a/crates/router/src/connector/worldpay.rs b/crates/router/src/connector/worldpay.rs index a1943c78050..857be775665 100644 --- a/crates/router/src/connector/worldpay.rs +++ b/crates/router/src/connector/worldpay.rs @@ -13,12 +13,13 @@ use self::{requests::*, response::*}; use super::utils::{self, RefundsRequestData}; use crate::{ configs::settings, + connector::utils as connector_utils, core::errors::{self, CustomResult}, headers, services::{ self, request::{self, Mask}, - ConnectorIntegration, + ConnectorIntegration, ConnectorValidation, }, types::{ self, @@ -93,6 +94,21 @@ impl ConnectorCommon for Worldpay { } } +impl ConnectorValidation for Worldpay { + fn validate_capture_method( + &self, + capture_method: Option<enums::CaptureMethod>, + ) -> CustomResult<(), errors::ConnectorError> { + let capture_method = capture_method.unwrap_or_default(); + match capture_method { + enums::CaptureMethod::Automatic | enums::CaptureMethod::Manual => Ok(()), + enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err( + connector_utils::construct_not_implemented_error_report(capture_method, self.id()), + ), + } + } +} + impl api::Payment for Worldpay {} impl api::PreVerify for Worldpay {} @@ -422,6 +438,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/connector/zen.rs b/crates/router/src/connector/zen.rs index 679d2eff8ca..7e64b00b5d9 100644 --- a/crates/router/src/connector/zen.rs +++ b/crates/router/src/connector/zen.rs @@ -22,7 +22,7 @@ use crate::{ services::{ self, request::{self, Mask}, - ConnectorIntegration, + ConnectorIntegration, ConnectorValidation, }, types::{ self, @@ -128,6 +128,8 @@ impl ConnectorCommon for Zen { } } +impl ConnectorValidation for Zen {} + impl ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData> for Zen { @@ -214,6 +216,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P req: &types::PaymentsAuthorizeRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + self.validate_capture_method(req.request.capture_method)?; Ok(Some( services::RequestBuilder::new() .method(services::Method::Post) diff --git a/crates/router/src/services/api.rs b/crates/router/src/services/api.rs index 1f5b43e351f..66114ad786b 100644 --- a/crates/router/src/services/api.rs +++ b/crates/router/src/services/api.rs @@ -10,6 +10,7 @@ use std::{ }; use actix_web::{body, HttpRequest, HttpResponse, Responder, ResponseError}; +use api_models::enums::CaptureMethod; use common_utils::errors::ReportSwitchExt; use error_stack::{report, IntoReport, Report, ResultExt}; use masking::{ExposeOptionInterface, PeekInterface}; @@ -29,7 +30,11 @@ use crate::{ logger, routes::{app::AppStateInfo, metrics, AppState}, services::authentication as auth, - types::{self, api, ErrorResponse}, + types::{ + self, + api::{self, ConnectorCommon}, + ErrorResponse, + }, }; pub type BoxedConnectorIntegration<'a, T, Req, Resp> = @@ -48,6 +53,25 @@ where } } +pub trait ConnectorValidation: ConnectorCommon { + fn validate_capture_method( + &self, + capture_method: Option<CaptureMethod>, + ) -> CustomResult<(), errors::ConnectorError> { + let capture_method = capture_method.unwrap_or_default(); + match capture_method { + CaptureMethod::Automatic => Ok(()), + CaptureMethod::Manual | CaptureMethod::ManualMultiple | CaptureMethod::Scheduled => { + Err(errors::ConnectorError::NotSupported { + message: capture_method.to_string(), + connector: self.id(), + } + .into()) + } + } + } +} + #[async_trait::async_trait] pub trait ConnectorIntegration<T, Req, Resp>: ConnectorIntegrationAny<T, Req, Resp> + Sync { fn get_headers(
feat
fail payment authorize when capture_method is manual_method (#1893)
95876b0ce03e024edf77909502c53eb4e63a9855
2023-12-01 17:48:40
DEEPANSHU BANSAL
feat(connector): [BOA/CYBERSOURCE] Fix Status Mapping for Terminal St… (#3031)
false
diff --git a/crates/router/src/connector/bankofamerica/transformers.rs b/crates/router/src/connector/bankofamerica/transformers.rs index 18ec8ceb89d..e31a69669c6 100644 --- a/crates/router/src/connector/bankofamerica/transformers.rs +++ b/crates/router/src/connector/bankofamerica/transformers.rs @@ -442,11 +442,18 @@ impl ForeignFrom<(BankofamericaPaymentStatus, bool)> for enums::AttemptStatus { | BankofamericaPaymentStatus::AuthorizedPendingReview => { if auto_capture { // Because BankOfAmerica will return Payment Status as Authorized even in AutoCapture Payment - Self::Pending + Self::Charged } else { Self::Authorized } } + BankofamericaPaymentStatus::Pending => { + if auto_capture { + Self::Charged + } else { + Self::Pending + } + } BankofamericaPaymentStatus::Succeeded | BankofamericaPaymentStatus::Transmitted => { Self::Charged } @@ -456,7 +463,6 @@ impl ForeignFrom<(BankofamericaPaymentStatus, bool)> for enums::AttemptStatus { BankofamericaPaymentStatus::Failed | BankofamericaPaymentStatus::Declined => { Self::Failure } - BankofamericaPaymentStatus::Pending => Self::Pending, } } } diff --git a/crates/router/src/connector/cybersource/transformers.rs b/crates/router/src/connector/cybersource/transformers.rs index 495e23e001a..953f82c76a8 100644 --- a/crates/router/src/connector/cybersource/transformers.rs +++ b/crates/router/src/connector/cybersource/transformers.rs @@ -670,8 +670,9 @@ pub struct ApplicationInformation { fn get_payment_status(is_capture: bool, status: enums::AttemptStatus) -> enums::AttemptStatus { let is_authorized = matches!(status, enums::AttemptStatus::Authorized); - if is_capture && is_authorized { - return enums::AttemptStatus::Pending; + let is_pending = matches!(status, enums::AttemptStatus::Pending); + if is_capture && (is_authorized || is_pending) { + return enums::AttemptStatus::Charged; } status }
feat
[BOA/CYBERSOURCE] Fix Status Mapping for Terminal St… (#3031)
71a17c682e87a708adbea4f2d9f99a4a0172e76e
2023-05-25 14:35:40
Nishant Joshi
feat(kms): reduce redundant kms calls (#1264)
false
diff --git a/crates/router/src/configs.rs b/crates/router/src/configs.rs index 55fa589a6e8..95bdd524022 100644 --- a/crates/router/src/configs.rs +++ b/crates/router/src/configs.rs @@ -1,3 +1,5 @@ mod defaults; +#[cfg(feature = "kms")] +pub(super) mod kms; pub mod settings; mod validations; diff --git a/crates/router/src/configs/kms.rs b/crates/router/src/configs/kms.rs new file mode 100644 index 00000000000..367a1b6a4a7 --- /dev/null +++ b/crates/router/src/configs/kms.rs @@ -0,0 +1,60 @@ +use common_utils::errors::CustomResult; +use external_services::kms; +use masking::ExposeInterface; + +use crate::configs::settings; + +#[async_trait::async_trait] +// This trait performs inplace decryption of the structure on which this is implemented +pub(crate) trait KmsDecrypt { + async fn decrypt_inner(self, kms_config: &kms::KmsConfig) -> CustomResult<Self, kms::KmsError> + where + Self: Sized; +} + +#[async_trait::async_trait] +impl KmsDecrypt for settings::Jwekey { + async fn decrypt_inner(self, kms_config: &kms::KmsConfig) -> CustomResult<Self, kms::KmsError> { + let client = kms::get_kms_client(kms_config).await; + + // If this pattern required repetition, a macro approach needs to be deviced + let ( + locker_encryption_key1, + locker_encryption_key2, + locker_decryption_key1, + locker_decryption_key2, + vault_encryption_key, + vault_private_key, + tunnel_private_key, + ) = tokio::try_join!( + client.decrypt(self.locker_encryption_key1), + client.decrypt(self.locker_encryption_key2), + client.decrypt(self.locker_decryption_key1), + client.decrypt(self.locker_decryption_key2), + client.decrypt(self.vault_encryption_key), + client.decrypt(self.vault_private_key), + client.decrypt(self.tunnel_private_key), + )?; + + Ok(Self { + locker_key_identifier1: self.locker_key_identifier1, + locker_key_identifier2: self.locker_key_identifier2, + locker_encryption_key1, + locker_encryption_key2, + locker_decryption_key1, + locker_decryption_key2, + vault_encryption_key, + vault_private_key, + tunnel_private_key, + }) + } +} + +#[async_trait::async_trait] +impl KmsDecrypt for settings::ActiveKmsSecrets { + async fn decrypt_inner(self, kms_config: &kms::KmsConfig) -> CustomResult<Self, kms::KmsError> { + Ok(Self { + jwekey: self.jwekey.expose().decrypt_inner(kms_config).await?.into(), + }) + } +} diff --git a/crates/router/src/configs/settings.rs b/crates/router/src/configs/settings.rs index 82acdf4d60f..bbbe217146f 100644 --- a/crates/router/src/configs/settings.rs +++ b/crates/router/src/configs/settings.rs @@ -39,6 +39,16 @@ pub enum Subcommand { GenerateOpenapiSpec, } +#[cfg(feature = "kms")] +/// Store the decrypted kms secret values for active use in the application +/// Currently using `StrongSecret` won't have any effect as this struct have smart pointers to heap +/// allocations. +/// note: we can consider adding such behaviour in the future with custom implementation +#[derive(Clone)] +pub struct ActiveKmsSecrets { + pub jwekey: masking::Secret<Jwekey>, +} + #[derive(Debug, Deserialize, Clone, Default)] #[serde(default)] pub struct Settings { diff --git a/crates/router/src/core/payment_methods/cards.rs b/crates/router/src/core/payment_methods/cards.rs index 97928694df5..73baebdf3ee 100644 --- a/crates/router/src/core/payment_methods/cards.rs +++ b/crates/router/src/core/payment_methods/cards.rs @@ -250,10 +250,10 @@ pub async fn add_card_hs( merchant_account: &storage::MerchantAccount, ) -> errors::CustomResult<(api::PaymentMethodResponse, bool), errors::VaultError> { let locker = &state.conf.locker; + #[cfg(not(feature = "kms"))] let jwekey = &state.conf.jwekey; - #[cfg(feature = "kms")] - let kms_config = &state.conf.kms; + let jwekey = &state.kms_secrets; let db = &*state.store; let merchant_id = &merchant_account.merchant_id; @@ -264,16 +264,9 @@ pub async fn add_card_hs( .get_required_value("locker_id") .change_context(errors::VaultError::SaveCardFailed)?; - let request = payment_methods::mk_add_card_request_hs( - jwekey, - locker, - &card, - &customer_id, - merchant_id, - #[cfg(feature = "kms")] - kms_config, - ) - .await?; + let request = + payment_methods::mk_add_card_request_hs(jwekey, locker, &card, &customer_id, merchant_id) + .await?; let stored_card_response = if !locker.mock_locker { let response = services::call_connector_api(state, request) @@ -284,15 +277,10 @@ pub async fn add_card_hs( .get_response_inner("JweBody") .change_context(errors::VaultError::FetchCardFailed)?; - let decrypted_payload = payment_methods::get_decrypted_response_payload( - jwekey, - jwe_body, - #[cfg(feature = "kms")] - kms_config, - ) - .await - .change_context(errors::VaultError::SaveCardFailed) - .attach_printable("Error getting decrypted response payload")?; + let decrypted_payload = payment_methods::get_decrypted_response_payload(jwekey, jwe_body) + .await + .change_context(errors::VaultError::SaveCardFailed) + .attach_printable("Error getting decrypted response payload")?; let stored_card_resp: payment_methods::StoreCardResp = decrypted_payload .parse_struct("StoreCardResp") .change_context(errors::VaultError::ResponseDeserializationFailed)?; @@ -394,10 +382,10 @@ pub async fn get_card_from_hs_locker<'a>( card_reference: &'a str, ) -> errors::CustomResult<payment_methods::Card, errors::VaultError> { let locker = &state.conf.locker; + #[cfg(not(feature = "kms"))] let jwekey = &state.conf.jwekey; - #[cfg(feature = "kms")] - let kms_config = &state.conf.kms; + let jwekey = &state.kms_secrets; let request = payment_methods::mk_get_card_request_hs( jwekey, @@ -405,8 +393,6 @@ pub async fn get_card_from_hs_locker<'a>( customer_id, merchant_id, card_reference, - #[cfg(feature = "kms")] - kms_config, ) .await .change_context(errors::VaultError::FetchCardFailed) @@ -419,15 +405,10 @@ pub async fn get_card_from_hs_locker<'a>( let jwe_body: services::JweBody = response .get_response_inner("JweBody") .change_context(errors::VaultError::FetchCardFailed)?; - let decrypted_payload = payment_methods::get_decrypted_response_payload( - jwekey, - jwe_body, - #[cfg(feature = "kms")] - kms_config, - ) - .await - .change_context(errors::VaultError::FetchCardFailed) - .attach_printable("Error getting decrypted response payload for get card")?; + let decrypted_payload = payment_methods::get_decrypted_response_payload(jwekey, jwe_body) + .await + .change_context(errors::VaultError::FetchCardFailed) + .attach_printable("Error getting decrypted response payload for get card")?; let get_card_resp: payment_methods::RetrieveCardResp = decrypted_payload .parse_struct("RetrieveCardResp") .change_context(errors::VaultError::FetchCardFailed)?; @@ -483,10 +464,10 @@ pub async fn delete_card_from_hs_locker<'a>( card_reference: &'a str, ) -> errors::RouterResult<payment_methods::DeleteCardResp> { let locker = &state.conf.locker; + #[cfg(not(feature = "kms"))] let jwekey = &state.conf.jwekey; - #[cfg(feature = "kms")] - let kms_config = &state.conf.kms; + let jwekey = &state.kms_secrets; let request = payment_methods::mk_delete_card_request_hs( jwekey, @@ -494,8 +475,6 @@ pub async fn delete_card_from_hs_locker<'a>( customer_id, merchant_id, card_reference, - #[cfg(feature = "kms")] - kms_config, ) .await .change_context(errors::ApiErrorResponse::InternalServerError) @@ -507,15 +486,10 @@ pub async fn delete_card_from_hs_locker<'a>( .change_context(errors::ApiErrorResponse::InternalServerError) .attach_printable("Failed while executing call_connector_api for delete card"); let jwe_body: services::JweBody = response.get_response_inner("JweBody")?; - let decrypted_payload = payment_methods::get_decrypted_response_payload( - jwekey, - jwe_body, - #[cfg(feature = "kms")] - kms_config, - ) - .await - .change_context(errors::ApiErrorResponse::InternalServerError) - .attach_printable("Error getting decrypted response payload for delete card")?; + let decrypted_payload = payment_methods::get_decrypted_response_payload(jwekey, jwe_body) + .await + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("Error getting decrypted response payload for delete card")?; let delete_card_resp: payment_methods::DeleteCardResp = decrypted_payload .parse_struct("DeleteCardResp") .change_context(errors::ApiErrorResponse::InternalServerError)?; diff --git a/crates/router/src/core/payment_methods/transformers.rs b/crates/router/src/core/payment_methods/transformers.rs index d4751a7d085..4f672b1ec4a 100644 --- a/crates/router/src/core/payment_methods/transformers.rs +++ b/crates/router/src/core/payment_methods/transformers.rs @@ -2,8 +2,6 @@ use std::str::FromStr; use common_utils::{ext_traits::StringExt, pii::Email}; use error_stack::ResultExt; -#[cfg(feature = "kms")] -use external_services::kms; use josekit::jwe; use serde::{Deserialize, Serialize}; @@ -151,24 +149,14 @@ pub fn get_dotted_jws(jws: encryption::JwsBody) -> String { } pub async fn get_decrypted_response_payload( - jwekey: &settings::Jwekey, + #[cfg(not(feature = "kms"))] jwekey: &settings::Jwekey, + #[cfg(feature = "kms")] jwekey: &settings::ActiveKmsSecrets, jwe_body: encryption::JweBody, - #[cfg(feature = "kms")] kms_config: &kms::KmsConfig, ) -> CustomResult<String, errors::VaultError> { #[cfg(feature = "kms")] - let public_key = kms::get_kms_client(kms_config) - .await - .decrypt(&jwekey.vault_encryption_key) - .await - .change_context(errors::VaultError::SaveCardFailed) - .attach_printable("Fails to get public key of vault")?; + let public_key = jwekey.jwekey.peek().vault_encryption_key.clone(); #[cfg(feature = "kms")] - let private_key = kms::get_kms_client(kms_config) - .await - .decrypt(&jwekey.vault_private_key) - .await - .change_context(errors::VaultError::SaveCardFailed) - .attach_printable("Error getting private key for signing jws")?; + let private_key = jwekey.jwekey.peek().vault_private_key.clone(); #[cfg(not(feature = "kms"))] let public_key = jwekey.vault_encryption_key.to_owned(); @@ -199,9 +187,9 @@ pub async fn get_decrypted_response_payload( } pub async fn mk_basilisk_req( - jwekey: &settings::Jwekey, + #[cfg(feature = "kms")] jwekey: &settings::ActiveKmsSecrets, + #[cfg(not(feature = "kms"))] jwekey: &settings::Jwekey, jws: &str, - #[cfg(feature = "kms")] kms_config: &kms::KmsConfig, ) -> CustomResult<encryption::JweBody, errors::VaultError> { let jws_payload: Vec<&str> = jws.split('.').collect(); @@ -219,12 +207,7 @@ pub async fn mk_basilisk_req( .change_context(errors::VaultError::SaveCardFailed)?; #[cfg(feature = "kms")] - let public_key = kms::get_kms_client(kms_config) - .await - .decrypt(&jwekey.vault_encryption_key) - .await - .change_context(errors::VaultError::SaveCardFailed) - .attach_printable("Fails to get encryption key of vault")?; + let public_key = jwekey.jwekey.peek().vault_encryption_key.clone(); #[cfg(not(feature = "kms"))] let public_key = jwekey.vault_encryption_key.to_owned(); @@ -251,12 +234,12 @@ pub async fn mk_basilisk_req( } pub async fn mk_add_card_request_hs( - jwekey: &settings::Jwekey, + #[cfg(not(feature = "kms"))] jwekey: &settings::Jwekey, + #[cfg(feature = "kms")] jwekey: &settings::ActiveKmsSecrets, locker: &settings::Locker, card: &api::CardDetail, customer_id: &str, merchant_id: &str, - #[cfg(feature = "kms")] kms_config: &kms::KmsConfig, ) -> CustomResult<services::Request, errors::VaultError> { let merchant_customer_id = if cfg!(feature = "sandbox") { format!("{customer_id}::{merchant_id}") @@ -281,12 +264,7 @@ pub async fn mk_add_card_request_hs( .change_context(errors::VaultError::RequestEncodingFailed)?; #[cfg(feature = "kms")] - let private_key = kms::get_kms_client(kms_config) - .await - .decrypt(&jwekey.vault_private_key) - .await - .change_context(errors::VaultError::SaveCardFailed) - .attach_printable("Error getting private key for signing jws")?; + let private_key = jwekey.jwekey.peek().vault_private_key.clone(); #[cfg(not(feature = "kms"))] let private_key = jwekey.vault_private_key.to_owned(); @@ -295,13 +273,7 @@ pub async fn mk_add_card_request_hs( .await .change_context(errors::VaultError::RequestEncodingFailed)?; - let jwe_payload = mk_basilisk_req( - jwekey, - &jws, - #[cfg(feature = "kms")] - kms_config, - ) - .await?; + let jwe_payload = mk_basilisk_req(jwekey, &jws).await?; let body = utils::Encode::<encryption::JweBody>::encode_to_value(&jwe_payload) .change_context(errors::VaultError::RequestEncodingFailed)?; @@ -416,12 +388,12 @@ pub fn mk_add_card_request( } pub async fn mk_get_card_request_hs( - jwekey: &settings::Jwekey, + #[cfg(not(feature = "kms"))] jwekey: &settings::Jwekey, + #[cfg(feature = "kms")] jwekey: &settings::ActiveKmsSecrets, locker: &settings::Locker, customer_id: &str, merchant_id: &str, card_reference: &str, - #[cfg(feature = "kms")] kms_config: &kms::KmsConfig, ) -> CustomResult<services::Request, errors::VaultError> { let merchant_customer_id = if cfg!(feature = "sandbox") { format!("{customer_id}::{merchant_id}") @@ -437,12 +409,7 @@ pub async fn mk_get_card_request_hs( .change_context(errors::VaultError::RequestEncodingFailed)?; #[cfg(feature = "kms")] - let private_key = kms::get_kms_client(kms_config) - .await - .decrypt(&jwekey.vault_private_key) - .await - .change_context(errors::VaultError::SaveCardFailed) - .attach_printable("Error getting private key for signing jws")?; + let private_key = jwekey.jwekey.peek().vault_private_key.clone(); #[cfg(not(feature = "kms"))] let private_key = jwekey.vault_private_key.to_owned(); @@ -451,13 +418,7 @@ pub async fn mk_get_card_request_hs( .await .change_context(errors::VaultError::RequestEncodingFailed)?; - let jwe_payload = mk_basilisk_req( - jwekey, - &jws, - #[cfg(feature = "kms")] - kms_config, - ) - .await?; + let jwe_payload = mk_basilisk_req(jwekey, &jws).await?; let body = utils::Encode::<encryption::JweBody>::encode_to_value(&jwe_payload) .change_context(errors::VaultError::RequestEncodingFailed)?; @@ -508,12 +469,12 @@ pub fn mk_get_card_response(card: GetCardResponse) -> errors::RouterResult<Card> } pub async fn mk_delete_card_request_hs( - jwekey: &settings::Jwekey, + #[cfg(feature = "kms")] jwekey: &settings::ActiveKmsSecrets, + #[cfg(not(feature = "kms"))] jwekey: &settings::Jwekey, locker: &settings::Locker, customer_id: &str, merchant_id: &str, card_reference: &str, - #[cfg(feature = "kms")] kms_config: &kms::KmsConfig, ) -> CustomResult<services::Request, errors::VaultError> { let merchant_customer_id = if cfg!(feature = "sandbox") { format!("{customer_id}::{merchant_id}") @@ -529,12 +490,7 @@ pub async fn mk_delete_card_request_hs( .change_context(errors::VaultError::RequestEncodingFailed)?; #[cfg(feature = "kms")] - let private_key = kms::get_kms_client(kms_config) - .await - .decrypt(&jwekey.vault_private_key) - .await - .change_context(errors::VaultError::SaveCardFailed) - .attach_printable("Error getting private key for signing jws")?; + let private_key = jwekey.jwekey.peek().vault_private_key.clone(); #[cfg(not(feature = "kms"))] let private_key = jwekey.vault_private_key.to_owned(); @@ -543,13 +499,7 @@ pub async fn mk_delete_card_request_hs( .await .change_context(errors::VaultError::RequestEncodingFailed)?; - let jwe_payload = mk_basilisk_req( - jwekey, - &jws, - #[cfg(feature = "kms")] - kms_config, - ) - .await?; + let jwe_payload = mk_basilisk_req(jwekey, &jws).await?; let body = utils::Encode::<encryption::JweBody>::encode_to_value(&jwe_payload) .change_context(errors::VaultError::RequestEncodingFailed)?; diff --git a/crates/router/src/core/payment_methods/vault.rs b/crates/router/src/core/payment_methods/vault.rs index db67d2e627c..24119c895c0 100644 --- a/crates/router/src/core/payment_methods/vault.rs +++ b/crates/router/src/core/payment_methods/vault.rs @@ -3,8 +3,6 @@ use common_utils::generate_id_with_default_len; use error_stack::report; use error_stack::{IntoReport, ResultExt}; #[cfg(feature = "basilisk")] -use external_services::kms; -#[cfg(feature = "basilisk")] use josekit::jwe; use masking::PeekInterface; use router_env::{instrument, tracing}; @@ -470,11 +468,11 @@ pub fn get_key_id(keys: &settings::Jwekey) -> &str { #[cfg(feature = "basilisk")] async fn get_locker_jwe_keys( - keys: &settings::Jwekey, - kms_config: &kms::KmsConfig, + keys: &settings::ActiveKmsSecrets, ) -> CustomResult<(String, String), errors::EncryptionError> { + let keys = keys.jwekey.peek(); let key_id = get_key_id(keys); - let (encryption_key, decryption_key) = if key_id == keys.locker_key_identifier1 { + let (public_key, private_key) = if key_id == keys.locker_key_identifier1 { (&keys.locker_encryption_key1, &keys.locker_decryption_key1) } else if key_id == keys.locker_key_identifier2 { (&keys.locker_encryption_key2, &keys.locker_decryption_key2) @@ -482,18 +480,7 @@ async fn get_locker_jwe_keys( return Err(errors::EncryptionError.into()); }; - let public_key = kms::get_kms_client(kms_config) - .await - .decrypt(encryption_key) - .await - .change_context(errors::EncryptionError)?; - let private_key = kms::get_kms_client(kms_config) - .await - .decrypt(decryption_key) - .await - .change_context(errors::EncryptionError)?; - - Ok((public_key, private_key)) + Ok((public_key.to_string(), private_key.to_string())) } #[cfg(feature = "basilisk")] @@ -515,7 +502,7 @@ pub async fn create_tokenize( ) .change_context(errors::ApiErrorResponse::InternalServerError)?; - let (public_key, private_key) = get_locker_jwe_keys(&state.conf.jwekey, &state.conf.kms) + let (public_key, private_key) = get_locker_jwe_keys(&state.kms_secrets) .await .change_context(errors::ApiErrorResponse::InternalServerError) .attach_printable("Error getting Encryption key")?; @@ -592,7 +579,7 @@ pub async fn get_tokenized_data( let payload = serde_json::to_string(&payload_to_be_encrypted) .map_err(|_x| errors::ApiErrorResponse::InternalServerError)?; - let (public_key, private_key) = get_locker_jwe_keys(&state.conf.jwekey, &state.conf.kms) + let (public_key, private_key) = get_locker_jwe_keys(&state.kms_secrets) .await .change_context(errors::ApiErrorResponse::InternalServerError) .attach_printable("Error getting Encryption key")?; @@ -663,7 +650,7 @@ pub async fn delete_tokenized_data( let payload = serde_json::to_string(&payload_to_be_encrypted) .map_err(|_x| errors::ApiErrorResponse::InternalServerError)?; - let (public_key, _private_key) = get_locker_jwe_keys(&state.conf.jwekey, &state.conf.kms) + let (public_key, _private_key) = get_locker_jwe_keys(&state.kms_secrets) .await .change_context(errors::ApiErrorResponse::InternalServerError) .attach_printable("Error getting Encryption key")?; diff --git a/crates/router/src/core/payments/helpers.rs b/crates/router/src/core/payments/helpers.rs index f5f9b79b03a..8a991e4076b 100644 --- a/crates/router/src/core/payments/helpers.rs +++ b/crates/router/src/core/payments/helpers.rs @@ -6,8 +6,6 @@ use common_utils::{ }; // TODO : Evaluate all the helper functions () use error_stack::{report, IntoReport, ResultExt}; -#[cfg(feature = "kms")] -use external_services::kms; use josekit::jwe; use masking::{ExposeOptionInterface, PeekInterface}; use router_env::{instrument, tracing}; @@ -1607,15 +1605,7 @@ pub async fn get_merchant_connector_account( )?; #[cfg(feature = "kms")] - let kms_config = &state.conf.kms; - - #[cfg(feature = "kms")] - let private_key = kms::get_kms_client(kms_config) - .await - .decrypt(state.conf.jwekey.tunnel_private_key.to_owned()) - .await - .change_context(errors::ApiErrorResponse::InternalServerError) - .attach_printable("Error getting tunnel private key")?; + let private_key = state.kms_secrets.jwekey.peek().tunnel_private_key.clone(); #[cfg(not(feature = "kms"))] let private_key = state.conf.jwekey.tunnel_private_key.to_owned(); diff --git a/crates/router/src/routes/app.rs b/crates/router/src/routes/app.rs index d0062faf9ea..0edc8b1edaa 100644 --- a/crates/router/src/routes/app.rs +++ b/crates/router/src/routes/app.rs @@ -12,8 +12,10 @@ use super::{admin::*, api_keys::*, disputes::*, files::*}; use super::{configs::*, customers::*, mandates::*, payments::*, payouts::*, refunds::*}; #[cfg(feature = "oltp")] use super::{ephemeral_key::*, payment_methods::*, webhooks::*}; +#[cfg(feature = "kms")] +use crate::configs::kms; use crate::{ - configs::settings::Settings, + configs::settings, db::{MockDb, StorageImpl, StorageInterface}, routes::cards_info::card_iin_info, services::Store, @@ -23,13 +25,15 @@ use crate::{ pub struct AppState { pub flow_name: String, pub store: Box<dyn StorageInterface>, - pub conf: Settings, + pub conf: settings::Settings, #[cfg(feature = "email")] pub email_client: Box<dyn EmailClient>, + #[cfg(feature = "kms")] + pub kms_secrets: settings::ActiveKmsSecrets, } pub trait AppStateInfo { - fn conf(&self) -> Settings; + fn conf(&self) -> settings::Settings; fn flow_name(&self) -> String; fn store(&self) -> Box<dyn StorageInterface>; #[cfg(feature = "email")] @@ -37,7 +41,7 @@ pub trait AppStateInfo { } impl AppStateInfo for AppState { - fn conf(&self) -> Settings { + fn conf(&self) -> settings::Settings { self.conf.to_owned() } fn flow_name(&self) -> String { @@ -54,7 +58,7 @@ impl AppStateInfo for AppState { impl AppState { pub async fn with_storage( - conf: Settings, + conf: settings::Settings, storage_impl: StorageImpl, shut_down_signal: oneshot::Sender<()>, ) -> Self { @@ -66,6 +70,17 @@ impl AppState { StorageImpl::Mock => Box::new(MockDb::new(&conf).await), }; + #[cfg(feature = "kms")] + #[allow(clippy::expect_used)] + let kms_secrets = kms::KmsDecrypt::decrypt_inner( + settings::ActiveKmsSecrets { + jwekey: conf.jwekey.clone().into(), + }, + &conf.kms, + ) + .await + .expect("Failed while performing KMS decryption"); + #[cfg(feature = "email")] #[allow(clippy::expect_used)] let email_client = Box::new(AwsSes::new(&conf.email).await); @@ -75,10 +90,12 @@ impl AppState { conf, #[cfg(feature = "email")] email_client, + #[cfg(feature = "kms")] + kms_secrets, } } - pub async fn new(conf: Settings, shut_down_signal: oneshot::Sender<()>) -> Self { + pub async fn new(conf: settings::Settings, shut_down_signal: oneshot::Sender<()>) -> Self { Self::with_storage(conf, StorageImpl::Postgresql, shut_down_signal).await } }
feat
reduce redundant kms calls (#1264)
90e8de18a854a7f83470e84a954ed365078c24c2
2024-09-17 17:53:41
chikke srujan
fix(connector): add field types for bank debits (#5908)
false
diff --git a/api-reference-v2/openapi_spec.json b/api-reference-v2/openapi_spec.json index 94cffcd75ac..117c9d2e9e7 100644 --- a/api-reference-v2/openapi_spec.json +++ b/api-reference-v2/openapi_spec.json @@ -7190,6 +7190,12 @@ "user_bank" ] }, + { + "type": "string", + "enum": [ + "user_bank_account_number" + ] + }, { "type": "string", "enum": [ diff --git a/api-reference/openapi_spec.json b/api-reference/openapi_spec.json index cf02aefcf75..c542f3491a3 100644 --- a/api-reference/openapi_spec.json +++ b/api-reference/openapi_spec.json @@ -10846,6 +10846,12 @@ "user_bank" ] }, + { + "type": "string", + "enum": [ + "user_bank_account_number" + ] + }, { "type": "string", "enum": [ diff --git a/crates/api_models/src/enums.rs b/crates/api_models/src/enums.rs index 64af2349f7c..bb2860acb03 100644 --- a/crates/api_models/src/enums.rs +++ b/crates/api_models/src/enums.rs @@ -507,6 +507,7 @@ pub enum FieldType { UserShippingAddressCountry { options: Vec<String> }, UserBlikCode, UserBank, + UserBankAccountNumber, Text, DropDown { options: Vec<String> }, UserDateOfBirth, diff --git a/crates/router/src/configs/defaults.rs b/crates/router/src/configs/defaults.rs index 659c94423d4..a651d27adcc 100644 --- a/crates/router/src/configs/defaults.rs +++ b/crates/router/src/configs/defaults.rs @@ -8773,15 +8773,6 @@ impl Default for super::settings::RequiredFields { value: None, } ), - ( - "billing.phone.country_code".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.billing.phone.country_code".to_string(), - display_name: "dialing_code".to_string(), - field_type: enums::FieldType::UserPhoneNumberCountryCode, - value: None, - } - ), ] ), } @@ -11069,7 +11060,7 @@ impl Default for super::settings::RequiredFields { RequiredFieldInfo { required_field: "payment_method_data.bank_debit.ach.account_number".to_string(), display_name: "bank_account_number".to_string(), - field_type: enums::FieldType::Text, + field_type: enums::FieldType::UserBankAccountNumber, value: None, } ), @@ -11111,7 +11102,7 @@ impl Default for super::settings::RequiredFields { RequiredFieldInfo { required_field: "payment_method_data.bank_debit.ach.account_number".to_string(), display_name: "bank_account_number".to_string(), - field_type: enums::FieldType::Text, + field_type: enums::FieldType::UserBankAccountNumber, value: None, } ), @@ -11159,9 +11150,9 @@ impl Default for super::settings::RequiredFields { ( "payment_method_data.bank_debit.sepa.iban".to_string(), RequiredFieldInfo { - required_field: "payment_method_data.bank_debit.bacs.iban".to_string(), - display_name: "bank_account_number".to_string(), - field_type: enums::FieldType::Text, + required_field: "payment_method_data.bank_debit.sepa.iban".to_string(), + display_name: "iban".to_string(), + field_type: enums::FieldType::UserIban, value: None, } ), @@ -11202,9 +11193,9 @@ impl Default for super::settings::RequiredFields { ( "payment_method_data.bank_debit.sepa.iban".to_string(), RequiredFieldInfo { - required_field: "payment_method_data.bank_debit.bacs.iban".to_string(), - display_name: "bank_account_number".to_string(), - field_type: enums::FieldType::Text, + required_field: "payment_method_data.bank_debit.sepa.iban".to_string(), + display_name: "iban".to_string(), + field_type: enums::FieldType::UserIban, value: None, } ) @@ -11233,12 +11224,21 @@ impl Default for super::settings::RequiredFields { value: None, } ), + ( + "billing.email".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.email".to_string(), + display_name: "email".to_string(), + field_type: enums::FieldType::UserEmailAddress, + value: None, + } + ), ( "payment_method_data.bank_debit.sepa.iban".to_string(), RequiredFieldInfo { - required_field: "payment_method_data.bank_debit.bacs.iban".to_string(), - display_name: "bank_account_number".to_string(), - field_type: enums::FieldType::Text, + required_field: "payment_method_data.bank_debit.sepa.iban".to_string(), + display_name: "iban".to_string(), + field_type: enums::FieldType::UserIban, value: None, } ) @@ -11271,7 +11271,7 @@ impl Default for super::settings::RequiredFields { RequiredFieldInfo { required_field: "payment_method_data.bank_debit.bacs.account_number".to_string(), display_name: "bank_account_number".to_string(), - field_type: enums::FieldType::Text, + field_type: enums::FieldType::UserBankAccountNumber, value: None, } ), @@ -11343,7 +11343,7 @@ impl Default for super::settings::RequiredFields { RequiredFieldInfo { required_field: "payment_method_data.bank_debit.bacs.account_number".to_string(), display_name: "bank_account_number".to_string(), - field_type: enums::FieldType::Text, + field_type: enums::FieldType::UserBankAccountNumber, value: None, } ), @@ -11393,7 +11393,7 @@ impl Default for super::settings::RequiredFields { RequiredFieldInfo { required_field: "payment_method_data.bank_debit.becs.account_number".to_string(), display_name: "bank_account_number".to_string(), - field_type: enums::FieldType::Text, + field_type: enums::FieldType::UserBankAccountNumber, value: None, } ), @@ -11445,7 +11445,7 @@ impl Default for super::settings::RequiredFields { RequiredFieldInfo { required_field: "payment_method_data.bank_debit.bacs.account_number".to_string(), display_name: "bank_account_number".to_string(), - field_type: enums::FieldType::Text, + field_type: enums::FieldType::UserBankAccountNumber, value: None, } ),
fix
add field types for bank debits (#5908)
5642fef52a6d591d12c5745ed381f41a1593f183
2023-11-08 15:44:51
chikke srujan
fix(connector): Add attempt_status in field in error_response (#2794)
false
diff --git a/connector-template/mod.rs b/connector-template/mod.rs index 05f527d2466..b27a0774e71 100644 --- a/connector-template/mod.rs +++ b/connector-template/mod.rs @@ -105,6 +105,7 @@ impl ConnectorCommon for {{project-name | downcase | pascal_case}} { code: response.code, message: response.message, reason: response.reason, + attempt_status: None, }) } } diff --git a/crates/router/src/connector/aci.rs b/crates/router/src/connector/aci.rs index 0e325a04ddb..7dbe2a0cd9a 100644 --- a/crates/router/src/connector/aci.rs +++ b/crates/router/src/connector/aci.rs @@ -78,6 +78,7 @@ impl ConnectorCommon for Aci { .collect::<Vec<String>>() .join("; ") }), + attempt_status: None, }) } } diff --git a/crates/router/src/connector/adyen.rs b/crates/router/src/connector/adyen.rs index 18a575b509c..30b06d1ccf4 100644 --- a/crates/router/src/connector/adyen.rs +++ b/crates/router/src/connector/adyen.rs @@ -73,6 +73,7 @@ impl ConnectorCommon for Adyen { code: response.error_code, message: response.message, reason: None, + attempt_status: None, }) } } @@ -251,6 +252,7 @@ impl code: response.error_code, message: response.message, reason: None, + attempt_status: None, }) } } @@ -366,6 +368,7 @@ impl code: response.error_code, message: response.message, reason: None, + attempt_status: None, }) } } @@ -533,6 +536,7 @@ impl code: response.error_code, message: response.message, reason: None, + attempt_status: None, }) } @@ -699,6 +703,7 @@ impl code: response.error_code, message: response.message, reason: None, + attempt_status: None, }) } } @@ -896,6 +901,7 @@ impl code: response.error_code, message: response.message, reason: None, + attempt_status: None, }) } } @@ -1399,6 +1405,7 @@ impl services::ConnectorIntegration<api::Execute, types::RefundsData, types::Ref code: response.error_code, message: response.message, reason: None, + attempt_status: None, }) } } diff --git a/crates/router/src/connector/adyen/transformers.rs b/crates/router/src/connector/adyen/transformers.rs index 94c7f0c5877..8bb28781280 100644 --- a/crates/router/src/connector/adyen/transformers.rs +++ b/crates/router/src/connector/adyen/transformers.rs @@ -2900,6 +2900,7 @@ pub fn get_adyen_response( .unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()), reason: response.refusal_reason, status_code, + attempt_status: None, }) } else { None @@ -2991,6 +2992,7 @@ pub fn get_redirection_response( .unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()), reason: None, status_code, + attempt_status: None, }) } else { None @@ -3052,6 +3054,7 @@ pub fn get_present_to_shopper_response( .unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()), reason: None, status_code, + attempt_status: None, }) } else { None @@ -3101,6 +3104,7 @@ pub fn get_qr_code_response( .unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()), reason: None, status_code, + attempt_status: None, }) } else { None @@ -3138,6 +3142,7 @@ pub fn get_redirection_error_response( message: response.refusal_reason.clone(), reason: Some(response.refusal_reason), status_code, + attempt_status: None, }); // We don't get connector transaction id for redirections in Adyen. let payments_response_data = types::PaymentsResponseData::TransactionResponse { diff --git a/crates/router/src/connector/airwallex.rs b/crates/router/src/connector/airwallex.rs index 8ef7ba08211..c70de7b3bdf 100644 --- a/crates/router/src/connector/airwallex.rs +++ b/crates/router/src/connector/airwallex.rs @@ -93,6 +93,7 @@ impl ConnectorCommon for Airwallex { code: response.code, message: response.message, reason: response.source, + attempt_status: None, }) } } diff --git a/crates/router/src/connector/authorizedotnet.rs b/crates/router/src/connector/authorizedotnet.rs index d25e62391b5..d5aaff7e442 100644 --- a/crates/router/src/connector/authorizedotnet.rs +++ b/crates/router/src/connector/authorizedotnet.rs @@ -893,6 +893,7 @@ fn get_error_response( message: error.error_text.to_owned(), reason: Some(error.error_text), status_code, + attempt_status: None, }) }) .unwrap_or_else(|| types::ErrorResponse { @@ -900,6 +901,7 @@ fn get_error_response( message: consts::NO_ERROR_MESSAGE.to_string(), reason: None, status_code, + attempt_status: None, })), Some(authorizedotnet::TransactionResponse::AuthorizedotnetTransactionResponseError(_)) | None => { @@ -909,6 +911,7 @@ fn get_error_response( message: message.to_string(), reason: Some(message.to_string()), status_code, + attempt_status: None, }) } } diff --git a/crates/router/src/connector/authorizedotnet/transformers.rs b/crates/router/src/connector/authorizedotnet/transformers.rs index 561723be46c..884504154e8 100644 --- a/crates/router/src/connector/authorizedotnet/transformers.rs +++ b/crates/router/src/connector/authorizedotnet/transformers.rs @@ -573,6 +573,7 @@ impl<F, T> message: error.error_text.clone(), reason: None, status_code: item.http_code, + attempt_status: None, }) }); let metadata = transaction_response @@ -647,6 +648,7 @@ impl<F, T> message: error.error_text.clone(), reason: None, status_code: item.http_code, + attempt_status: None, }) }); let metadata = transaction_response @@ -789,6 +791,7 @@ impl<F> TryFrom<types::RefundsResponseRouterData<F, AuthorizedotnetRefundRespons message: error.error_text.clone(), reason: None, status_code: item.http_code, + attempt_status: None, }) }); @@ -1021,6 +1024,7 @@ fn get_err_response(status_code: u16, message: ResponseMessages) -> types::Error message: message.message[0].text.clone(), reason: None, status_code, + attempt_status: None, } } diff --git a/crates/router/src/connector/bambora.rs b/crates/router/src/connector/bambora.rs index d5e8119b66c..d0ed9929a77 100644 --- a/crates/router/src/connector/bambora.rs +++ b/crates/router/src/connector/bambora.rs @@ -95,6 +95,7 @@ impl ConnectorCommon for Bambora { code: response.code.to_string(), message: response.message, reason: Some(serde_json::to_string(&response.details).unwrap_or_default()), + attempt_status: None, }) } } diff --git a/crates/router/src/connector/bankofamerica.rs b/crates/router/src/connector/bankofamerica.rs index e25d99f9af3..a51fcc0ad62 100644 --- a/crates/router/src/connector/bankofamerica.rs +++ b/crates/router/src/connector/bankofamerica.rs @@ -111,6 +111,7 @@ impl ConnectorCommon for Bankofamerica { code: response.code, message: response.message, reason: response.reason, + attempt_status: None, }) } } diff --git a/crates/router/src/connector/bitpay.rs b/crates/router/src/connector/bitpay.rs index e8826e93390..63b6e41feaf 100644 --- a/crates/router/src/connector/bitpay.rs +++ b/crates/router/src/connector/bitpay.rs @@ -120,6 +120,7 @@ impl ConnectorCommon for Bitpay { .unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()), message: response.error, reason: response.message, + attempt_status: None, }) } } diff --git a/crates/router/src/connector/bluesnap.rs b/crates/router/src/connector/bluesnap.rs index 6c39fc41b72..73eeee8ca5a 100644 --- a/crates/router/src/connector/bluesnap.rs +++ b/crates/router/src/connector/bluesnap.rs @@ -126,6 +126,7 @@ impl ConnectorCommon for Bluesnap { .map(|error_code_message| error_code_message.error_message) .unwrap_or(consts::NO_ERROR_MESSAGE.to_string()), reason: Some(reason), + attempt_status: None, } } bluesnap::BluesnapErrors::Auth(error_res) => ErrorResponse { @@ -133,23 +134,28 @@ impl ConnectorCommon for Bluesnap { code: error_res.error_code.clone(), message: error_res.error_name.clone().unwrap_or(error_res.error_code), reason: Some(error_res.error_description), + attempt_status: None, }, bluesnap::BluesnapErrors::General(error_response) => { - let error_res = if res.status_code == 403 + let (error_res, attempt_status) = if res.status_code == 403 && error_response.contains(BLUESNAP_TRANSACTION_NOT_FOUND) { - format!( - "{} in bluesnap dashboard", - consts::REQUEST_TIMEOUT_PAYMENT_NOT_FOUND + ( + format!( + "{} in bluesnap dashboard", + consts::REQUEST_TIMEOUT_PAYMENT_NOT_FOUND + ), + Some(enums::AttemptStatus::Failure), // when bluesnap throws 403 for payment not found, we update the payment status to failure. ) } else { - error_response.clone() + (error_response.clone(), None) }; ErrorResponse { status_code: res.status_code, code: consts::NO_ERROR_CODE.to_string(), message: error_response, reason: Some(error_res), + attempt_status, } } }; diff --git a/crates/router/src/connector/boku.rs b/crates/router/src/connector/boku.rs index 826d218cd56..710bcaf3842 100644 --- a/crates/router/src/connector/boku.rs +++ b/crates/router/src/connector/boku.rs @@ -130,6 +130,7 @@ impl ConnectorCommon for Boku { code: response.code, message: response.message, reason: response.reason, + attempt_status: None, }), Err(_) => get_xml_deserialized(res), } @@ -651,6 +652,7 @@ fn get_xml_deserialized(res: Response) -> CustomResult<ErrorResponse, errors::Co code: consts::NO_ERROR_CODE.to_string(), message: consts::UNSUPPORTED_ERROR_MESSAGE.to_string(), reason: Some(response_data), + attempt_status: None, }) } } diff --git a/crates/router/src/connector/braintree.rs b/crates/router/src/connector/braintree.rs index 06504e4a976..da91cb5fe24 100644 --- a/crates/router/src/connector/braintree.rs +++ b/crates/router/src/connector/braintree.rs @@ -132,6 +132,7 @@ impl ConnectorCommon for Braintree { code, message, reason: Some(response.api_error_response.message), + attempt_status: None, }) } Ok(braintree::ErrorResponse::BraintreeErrorResponse(response)) => Ok(ErrorResponse { @@ -139,6 +140,7 @@ impl ConnectorCommon for Braintree { code: consts::NO_ERROR_CODE.to_string(), message: consts::NO_ERROR_MESSAGE.to_string(), reason: Some(response.errors), + attempt_status: None, }), Err(error_msg) => { logger::error!(deserialization_error =? error_msg); diff --git a/crates/router/src/connector/braintree/braintree_graphql_transformers.rs b/crates/router/src/connector/braintree/braintree_graphql_transformers.rs index b622e041915..bf51973237c 100644 --- a/crates/router/src/connector/braintree/braintree_graphql_transformers.rs +++ b/crates/router/src/connector/braintree/braintree_graphql_transformers.rs @@ -316,6 +316,7 @@ fn get_error_response<T>( message: error_msg.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()), reason: error_reason, status_code: http_code, + attempt_status: None, }) } diff --git a/crates/router/src/connector/cashtocode.rs b/crates/router/src/connector/cashtocode.rs index ed994dca31f..75433cfd0f1 100644 --- a/crates/router/src/connector/cashtocode.rs +++ b/crates/router/src/connector/cashtocode.rs @@ -119,6 +119,7 @@ impl ConnectorCommon for Cashtocode { code: response.error.to_string(), message: response.error_description, reason: None, + attempt_status: None, }) } } diff --git a/crates/router/src/connector/cashtocode/transformers.rs b/crates/router/src/connector/cashtocode/transformers.rs index 4db1bef7e3f..2caef69db92 100644 --- a/crates/router/src/connector/cashtocode/transformers.rs +++ b/crates/router/src/connector/cashtocode/transformers.rs @@ -217,6 +217,7 @@ impl<F, T> status_code: item.http_code, message: error_data.error_description, reason: None, + attempt_status: None, }), ), CashtocodePaymentsResponse::CashtoCodeData(response_data) => { diff --git a/crates/router/src/connector/checkout.rs b/crates/router/src/connector/checkout.rs index f4cc4ac9640..6904a440b14 100644 --- a/crates/router/src/connector/checkout.rs +++ b/crates/router/src/connector/checkout.rs @@ -131,6 +131,7 @@ impl ConnectorCommon for Checkout { .error_codes .map(|errors| errors.join(" & ")) .or(response.error_type), + attempt_status: None, }) } } diff --git a/crates/router/src/connector/checkout/transformers.rs b/crates/router/src/connector/checkout/transformers.rs index 53182e65ed5..6ad040da284 100644 --- a/crates/router/src/connector/checkout/transformers.rs +++ b/crates/router/src/connector/checkout/transformers.rs @@ -576,6 +576,7 @@ impl TryFrom<types::PaymentsResponseRouterData<PaymentsResponse>> .clone() .unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()), reason: item.response.response_summary, + attempt_status: None, }) } else { None @@ -623,6 +624,7 @@ impl TryFrom<types::PaymentsSyncResponseRouterData<PaymentsResponse>> .clone() .unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()), reason: item.response.response_summary, + attempt_status: None, }) } else { None diff --git a/crates/router/src/connector/coinbase.rs b/crates/router/src/connector/coinbase.rs index d50e490cfc3..f26100fcc8c 100644 --- a/crates/router/src/connector/coinbase.rs +++ b/crates/router/src/connector/coinbase.rs @@ -108,6 +108,7 @@ impl ConnectorCommon for Coinbase { code: response.error.error_type, message: response.error.message, reason: response.error.code, + attempt_status: None, }) } } diff --git a/crates/router/src/connector/cryptopay.rs b/crates/router/src/connector/cryptopay.rs index 8abe84a9353..4dff4206033 100644 --- a/crates/router/src/connector/cryptopay.rs +++ b/crates/router/src/connector/cryptopay.rs @@ -167,6 +167,7 @@ impl ConnectorCommon for Cryptopay { code: response.error.code, message: response.error.message, reason: response.error.reason, + attempt_status: None, }) } } diff --git a/crates/router/src/connector/cybersource.rs b/crates/router/src/connector/cybersource.rs index 0a13aa0cf14..f038bc2c91d 100644 --- a/crates/router/src/connector/cybersource.rs +++ b/crates/router/src/connector/cybersource.rs @@ -136,6 +136,7 @@ impl ConnectorCommon for Cybersource { code, message, reason: Some(connector_reason), + attempt_status: None, }) } } diff --git a/crates/router/src/connector/cybersource/transformers.rs b/crates/router/src/connector/cybersource/transformers.rs index 55507e4f490..9233a95d7dd 100644 --- a/crates/router/src/connector/cybersource/transformers.rs +++ b/crates/router/src/connector/cybersource/transformers.rs @@ -367,6 +367,7 @@ impl<F, T> message: error.message, reason: Some(error.reason), status_code: item.http_code, + attempt_status: None, }), _ => Ok(types::PaymentsResponseData::TransactionResponse { resource_id: types::ResponseId::ConnectorTransactionId( diff --git a/crates/router/src/connector/dlocal.rs b/crates/router/src/connector/dlocal.rs index b706d694a3d..9bf4bc546cd 100644 --- a/crates/router/src/connector/dlocal.rs +++ b/crates/router/src/connector/dlocal.rs @@ -135,6 +135,7 @@ impl ConnectorCommon for Dlocal { code: response.code.to_string(), message: response.message, reason: response.param, + attempt_status: None, }) } } diff --git a/crates/router/src/connector/dummyconnector.rs b/crates/router/src/connector/dummyconnector.rs index af87029a682..0346e452ea3 100644 --- a/crates/router/src/connector/dummyconnector.rs +++ b/crates/router/src/connector/dummyconnector.rs @@ -111,6 +111,7 @@ impl<const T: u8> ConnectorCommon for DummyConnector<T> { code: response.error.code, message: response.error.message, reason: response.error.reason, + attempt_status: None, }) } } diff --git a/crates/router/src/connector/fiserv.rs b/crates/router/src/connector/fiserv.rs index 35d40f1a3fb..e31217908f2 100644 --- a/crates/router/src/connector/fiserv.rs +++ b/crates/router/src/connector/fiserv.rs @@ -151,6 +151,7 @@ impl ConnectorCommon for Fiserv { message: first_error.message.to_owned(), reason: first_error.field.to_owned(), status_code: res.status_code, + attempt_status: None, }) }) .unwrap_or(types::ErrorResponse { @@ -158,6 +159,7 @@ impl ConnectorCommon for Fiserv { message: consts::NO_ERROR_MESSAGE.to_string(), reason: None, status_code: res.status_code, + attempt_status: None, })) } } diff --git a/crates/router/src/connector/forte.rs b/crates/router/src/connector/forte.rs index 6f20e93e8c8..af838649031 100644 --- a/crates/router/src/connector/forte.rs +++ b/crates/router/src/connector/forte.rs @@ -130,6 +130,7 @@ impl ConnectorCommon for Forte { code, message, reason: None, + attempt_status: None, }) } } diff --git a/crates/router/src/connector/globalpay.rs b/crates/router/src/connector/globalpay.rs index dfcddae777e..57c81cccae3 100644 --- a/crates/router/src/connector/globalpay.rs +++ b/crates/router/src/connector/globalpay.rs @@ -104,6 +104,7 @@ impl ConnectorCommon for Globalpay { code: response.error_code, message: response.detailed_error_description, reason: None, + attempt_status: None, }) } } @@ -313,6 +314,7 @@ impl ConnectorIntegration<api::AccessTokenAuth, types::AccessTokenRequestData, t code: response.error_code, message: response.detailed_error_description, reason: None, + attempt_status: None, }) } } diff --git a/crates/router/src/connector/globepay.rs b/crates/router/src/connector/globepay.rs index c1bda593283..fedc75cd4f3 100644 --- a/crates/router/src/connector/globepay.rs +++ b/crates/router/src/connector/globepay.rs @@ -122,6 +122,7 @@ impl ConnectorCommon for Globepay { code: response.return_code.to_string(), message: consts::NO_ERROR_MESSAGE.to_string(), reason: Some(response.return_msg), + attempt_status: None, }) } } diff --git a/crates/router/src/connector/globepay/transformers.rs b/crates/router/src/connector/globepay/transformers.rs index e78edf3ff47..1bea602e740 100644 --- a/crates/router/src/connector/globepay/transformers.rs +++ b/crates/router/src/connector/globepay/transformers.rs @@ -257,6 +257,7 @@ fn get_error_response( message: consts::NO_ERROR_MESSAGE.to_string(), reason: return_msg, status_code, + attempt_status: None, } } diff --git a/crates/router/src/connector/gocardless.rs b/crates/router/src/connector/gocardless.rs index d6e6f30ad9f..f5643314431 100644 --- a/crates/router/src/connector/gocardless.rs +++ b/crates/router/src/connector/gocardless.rs @@ -122,6 +122,7 @@ impl ConnectorCommon for Gocardless { code: response.error.code.to_string(), message: response.error.error_type, reason: Some(error_reason.join("; ")), + attempt_status: None, }) } } diff --git a/crates/router/src/connector/helcim.rs b/crates/router/src/connector/helcim.rs index 87fcfdd36d8..c6fad76836d 100644 --- a/crates/router/src/connector/helcim.rs +++ b/crates/router/src/connector/helcim.rs @@ -137,6 +137,7 @@ impl ConnectorCommon for Helcim { code: NO_ERROR_CODE.to_owned(), message: error_string.clone(), reason: Some(error_string), + attempt_status: None, }) } } diff --git a/crates/router/src/connector/iatapay.rs b/crates/router/src/connector/iatapay.rs index 4db2faa2d42..a98de46b4bc 100644 --- a/crates/router/src/connector/iatapay.rs +++ b/crates/router/src/connector/iatapay.rs @@ -124,6 +124,7 @@ impl ConnectorCommon for Iatapay { code: response.error, message: response.message, reason: response.reason, + attempt_status: None, }) } } @@ -235,6 +236,7 @@ impl ConnectorIntegration<api::AccessTokenAuth, types::AccessTokenRequestData, t code: response.error, message: response.path, reason: None, + attempt_status: None, }) } } diff --git a/crates/router/src/connector/klarna.rs b/crates/router/src/connector/klarna.rs index 87f007cb3ac..13ad20a7d90 100644 --- a/crates/router/src/connector/klarna.rs +++ b/crates/router/src/connector/klarna.rs @@ -75,6 +75,7 @@ impl ConnectorCommon for Klarna { code: response.error_code, message: consts::NO_ERROR_MESSAGE.to_string(), reason, + attempt_status: None, }) } } diff --git a/crates/router/src/connector/mollie.rs b/crates/router/src/connector/mollie.rs index 337e1b78c9a..94da85b19d2 100644 --- a/crates/router/src/connector/mollie.rs +++ b/crates/router/src/connector/mollie.rs @@ -98,6 +98,7 @@ impl ConnectorCommon for Mollie { .unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()), message: response.detail, reason: response.field, + attempt_status: None, }) } } diff --git a/crates/router/src/connector/multisafepay.rs b/crates/router/src/connector/multisafepay.rs index e09f242abc8..e5aeb8f92e9 100644 --- a/crates/router/src/connector/multisafepay.rs +++ b/crates/router/src/connector/multisafepay.rs @@ -83,6 +83,7 @@ impl ConnectorCommon for Multisafepay { code: response.error_code.to_string(), message: response.error_info, reason: None, + attempt_status: None, }) } } diff --git a/crates/router/src/connector/multisafepay/transformers.rs b/crates/router/src/connector/multisafepay/transformers.rs index 3eead97ad86..6e371b1e1a2 100644 --- a/crates/router/src/connector/multisafepay/transformers.rs +++ b/crates/router/src/connector/multisafepay/transformers.rs @@ -702,6 +702,7 @@ impl<F, T> message: error_response.error_info.clone(), reason: Some(error_response.error_info), status_code: item.http_code, + attempt_status: None, }), ..item.data }), @@ -808,6 +809,7 @@ impl TryFrom<types::RefundsResponseRouterData<api::Execute, MultisafepayRefundRe message: error_response.error_info.clone(), reason: Some(error_response.error_info), status_code: item.http_code, + attempt_status: None, }), ..item.data }), @@ -844,6 +846,7 @@ impl TryFrom<types::RefundsResponseRouterData<api::RSync, MultisafepayRefundResp message: error_response.error_info.clone(), reason: Some(error_response.error_info), status_code: item.http_code, + attempt_status: None, }), ..item.data }), diff --git a/crates/router/src/connector/nexinets.rs b/crates/router/src/connector/nexinets.rs index 30ae4ab25e5..6b3641d301c 100644 --- a/crates/router/src/connector/nexinets.rs +++ b/crates/router/src/connector/nexinets.rs @@ -130,6 +130,7 @@ impl ConnectorCommon for Nexinets { code: response.code.to_string(), message: static_message, reason: Some(connector_reason), + attempt_status: None, }) } } diff --git a/crates/router/src/connector/nmi/transformers.rs b/crates/router/src/connector/nmi/transformers.rs index 995341fefd9..6e887f58858 100644 --- a/crates/router/src/connector/nmi/transformers.rs +++ b/crates/router/src/connector/nmi/transformers.rs @@ -440,6 +440,7 @@ impl ForeignFrom<(StandardResponse, u16)> for types::ErrorResponse { message: response.responsetext, reason: None, status_code: http_code, + attempt_status: None, } } } diff --git a/crates/router/src/connector/noon.rs b/crates/router/src/connector/noon.rs index 156e10928d3..6302fc0f27c 100644 --- a/crates/router/src/connector/noon.rs +++ b/crates/router/src/connector/noon.rs @@ -136,6 +136,7 @@ impl ConnectorCommon for Noon { code: response.result_code.to_string(), message: response.class_description, reason: Some(response.message), + attempt_status: None, }) } } diff --git a/crates/router/src/connector/noon/transformers.rs b/crates/router/src/connector/noon/transformers.rs index 4a2128f7ec6..27a874930bc 100644 --- a/crates/router/src/connector/noon/transformers.rs +++ b/crates/router/src/connector/noon/transformers.rs @@ -511,6 +511,7 @@ impl<F, T> message: error_message.clone(), reason: Some(error_message), status_code: item.http_code, + attempt_status: None, }), _ => { let connector_response_reference_id = diff --git a/crates/router/src/connector/nuvei/transformers.rs b/crates/router/src/connector/nuvei/transformers.rs index 88ebe1d8dbe..c23114e2a96 100644 --- a/crates/router/src/connector/nuvei/transformers.rs +++ b/crates/router/src/connector/nuvei/transformers.rs @@ -1579,6 +1579,7 @@ fn get_error_response<T>( .unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()), reason: None, status_code: http_code, + attempt_status: None, }) } diff --git a/crates/router/src/connector/opayo.rs b/crates/router/src/connector/opayo.rs index 89e16416d27..9fc1ad2931a 100644 --- a/crates/router/src/connector/opayo.rs +++ b/crates/router/src/connector/opayo.rs @@ -107,6 +107,7 @@ impl ConnectorCommon for Opayo { code: response.code, message: response.message, reason: response.reason, + attempt_status: None, }) } } diff --git a/crates/router/src/connector/opennode.rs b/crates/router/src/connector/opennode.rs index 07d33382a21..9e8283ff637 100644 --- a/crates/router/src/connector/opennode.rs +++ b/crates/router/src/connector/opennode.rs @@ -110,6 +110,7 @@ impl ConnectorCommon for Opennode { code: consts::NO_ERROR_CODE.to_string(), message: response.message, reason: None, + attempt_status: None, }) } } diff --git a/crates/router/src/connector/payeezy.rs b/crates/router/src/connector/payeezy.rs index 03e76af907c..20504f91d5b 100644 --- a/crates/router/src/connector/payeezy.rs +++ b/crates/router/src/connector/payeezy.rs @@ -123,6 +123,7 @@ impl ConnectorCommon for Payeezy { code: response.transaction_status, message: error_messages.join(", "), reason: None, + attempt_status: None, }) } } diff --git a/crates/router/src/connector/payme.rs b/crates/router/src/connector/payme.rs index e0d6229c004..3790bcb66da 100644 --- a/crates/router/src/connector/payme.rs +++ b/crates/router/src/connector/payme.rs @@ -97,6 +97,7 @@ impl ConnectorCommon for Payme { "{}, additional info: {}", response.status_error_details, response.status_additional_info )), + attempt_status: None, }) } } diff --git a/crates/router/src/connector/payme/transformers.rs b/crates/router/src/connector/payme/transformers.rs index 1b7ce27439b..24b7f2b3a0b 100644 --- a/crates/router/src/connector/payme/transformers.rs +++ b/crates/router/src/connector/payme/transformers.rs @@ -226,6 +226,7 @@ impl From<(&PaymePaySaleResponse, u16)> for types::ErrorResponse { .unwrap_or(consts::NO_ERROR_MESSAGE.to_string()), reason: pay_sale_response.status_error_details.to_owned(), status_code: http_code, + attempt_status: None, } } } @@ -308,6 +309,7 @@ impl From<(&SaleQuery, u16)> for types::ErrorResponse { .unwrap_or(consts::NO_ERROR_MESSAGE.to_string()), reason: sale_query_response.sale_error_text.clone(), status_code: http_code, + attempt_status: None, } } } diff --git a/crates/router/src/connector/paypal.rs b/crates/router/src/connector/paypal.rs index 854d48dcaad..af0707070e0 100644 --- a/crates/router/src/connector/paypal.rs +++ b/crates/router/src/connector/paypal.rs @@ -91,6 +91,7 @@ impl Paypal { code: response.name, message: response.message.clone(), reason: error_reason.or(Some(response.message)), + attempt_status: None, }) } } @@ -203,6 +204,7 @@ impl ConnectorCommon for Paypal { code: response.name, message: response.message.clone(), reason, + attempt_status: None, }) } } @@ -340,6 +342,7 @@ impl ConnectorIntegration<api::AccessTokenAuth, types::AccessTokenRequestData, t code: response.error, message: response.error_description.clone(), reason: Some(response.error_description), + attempt_status: None, }) } } diff --git a/crates/router/src/connector/payu.rs b/crates/router/src/connector/payu.rs index 6433735f7c5..305e49fea06 100644 --- a/crates/router/src/connector/payu.rs +++ b/crates/router/src/connector/payu.rs @@ -96,6 +96,7 @@ impl ConnectorCommon for Payu { code: response.status.status_code, message: response.status.status_desc, reason: response.status.code_literal, + attempt_status: None, }) } } @@ -304,6 +305,7 @@ impl ConnectorIntegration<api::AccessTokenAuth, types::AccessTokenRequestData, t code: response.error, message: response.error_description, reason: None, + attempt_status: None, }) } } diff --git a/crates/router/src/connector/powertranz.rs b/crates/router/src/connector/powertranz.rs index bcbe2113f61..9c34defc804 100644 --- a/crates/router/src/connector/powertranz.rs +++ b/crates/router/src/connector/powertranz.rs @@ -120,6 +120,7 @@ impl ConnectorCommon for Powertranz { code: consts::NO_ERROR_CODE.to_string(), message: consts::NO_ERROR_MESSAGE.to_string(), reason: None, + attempt_status: None, }) } } diff --git a/crates/router/src/connector/powertranz/transformers.rs b/crates/router/src/connector/powertranz/transformers.rs index 5bbfe094352..83bca662ec2 100644 --- a/crates/router/src/connector/powertranz/transformers.rs +++ b/crates/router/src/connector/powertranz/transformers.rs @@ -443,6 +443,7 @@ fn build_error_response( .collect::<Vec<_>>() .join(", "), ), + attempt_status: None, } }) } else if !ISO_SUCCESS_CODES.contains(&item.iso_response_code.as_str()) { @@ -452,6 +453,7 @@ fn build_error_response( code: item.iso_response_code.clone(), message: item.response_message.clone(), reason: Some(item.response_message.clone()), + attempt_status: None, }) } else { None diff --git a/crates/router/src/connector/prophetpay.rs b/crates/router/src/connector/prophetpay.rs index 0e8d5100ea3..e3860eb7098 100644 --- a/crates/router/src/connector/prophetpay.rs +++ b/crates/router/src/connector/prophetpay.rs @@ -110,6 +110,7 @@ impl ConnectorCommon for Prophetpay { code: response.code, message: response.message, reason: response.reason, + attempt_status: None, }) } } diff --git a/crates/router/src/connector/rapyd.rs b/crates/router/src/connector/rapyd.rs index 29f21f37381..42ba8197e74 100644 --- a/crates/router/src/connector/rapyd.rs +++ b/crates/router/src/connector/rapyd.rs @@ -98,6 +98,7 @@ impl ConnectorCommon for Rapyd { code: response_data.status.error_code, message: response_data.status.status.unwrap_or_default(), reason: response_data.status.message, + attempt_status: None, }), Err(error_msg) => { logger::error!(deserialization_error =? error_msg); diff --git a/crates/router/src/connector/rapyd/transformers.rs b/crates/router/src/connector/rapyd/transformers.rs index 9df699b938b..08985ba022f 100644 --- a/crates/router/src/connector/rapyd/transformers.rs +++ b/crates/router/src/connector/rapyd/transformers.rs @@ -457,6 +457,7 @@ impl<F, T> status_code: item.http_code, message: item.response.status.status.unwrap_or_default(), reason: data.failure_message.to_owned(), + attempt_status: None, }), ), _ => { @@ -497,6 +498,7 @@ impl<F, T> status_code: item.http_code, message: item.response.status.status.unwrap_or_default(), reason: item.response.status.message, + attempt_status: None, }), ), }; diff --git a/crates/router/src/connector/shift4.rs b/crates/router/src/connector/shift4.rs index a17546711f1..1d1ea36fae1 100644 --- a/crates/router/src/connector/shift4.rs +++ b/crates/router/src/connector/shift4.rs @@ -99,6 +99,7 @@ impl ConnectorCommon for Shift4 { .unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()), message: response.error.message, reason: None, + attempt_status: None, }) } } diff --git a/crates/router/src/connector/square.rs b/crates/router/src/connector/square.rs index a048b0f5433..5c52728d879 100644 --- a/crates/router/src/connector/square.rs +++ b/crates/router/src/connector/square.rs @@ -123,6 +123,7 @@ impl ConnectorCommon for Square { .and_then(|error| error.category.clone()) .unwrap_or(consts::NO_ERROR_MESSAGE.to_string()), reason: Some(reason), + attempt_status: None, }) } } diff --git a/crates/router/src/connector/stax.rs b/crates/router/src/connector/stax.rs index 7f5fde71938..ba9642b4f87 100644 --- a/crates/router/src/connector/stax.rs +++ b/crates/router/src/connector/stax.rs @@ -109,6 +109,7 @@ impl ConnectorCommon for Stax { .change_context(errors::ConnectorError::ResponseDeserializationFailed)? .to_owned(), ), + attempt_status: None, }) } } diff --git a/crates/router/src/connector/stripe.rs b/crates/router/src/connector/stripe.rs index e3551306e67..98e544105fd 100644 --- a/crates/router/src/connector/stripe.rs +++ b/crates/router/src/connector/stripe.rs @@ -225,6 +225,7 @@ impl }) .unwrap_or(message) }), + attempt_status: None, }) } } @@ -351,6 +352,7 @@ impl }) .unwrap_or(message) }), + attempt_status: None, }) } } @@ -473,6 +475,7 @@ impl }) .unwrap_or(message) }), + attempt_status: None, }) } } @@ -603,6 +606,7 @@ impl }) .unwrap_or(message) }), + attempt_status: None, }) } } @@ -743,6 +747,7 @@ impl }) .unwrap_or(message) }), + attempt_status: None, }) } } @@ -897,6 +902,7 @@ impl }) .unwrap_or(message) }), + attempt_status: None, }) } } @@ -1016,6 +1022,7 @@ impl }) .unwrap_or(message) }), + attempt_status: None, }) } } @@ -1170,6 +1177,7 @@ impl }) .unwrap_or(message) }), + attempt_status: None, }) } } @@ -1287,6 +1295,7 @@ impl services::ConnectorIntegration<api::Execute, types::RefundsData, types::Ref }) .unwrap_or(message) }), + attempt_status: None, }) } } @@ -1390,6 +1399,7 @@ impl services::ConnectorIntegration<api::RSync, types::RefundsData, types::Refun }) .unwrap_or(message) }), + attempt_status: None, }) } } @@ -1534,6 +1544,7 @@ impl }) .unwrap_or(message) }), + attempt_status: None, }) } } @@ -1636,6 +1647,7 @@ impl }) .unwrap_or(message) }), + attempt_status: None, }) } } @@ -1761,6 +1773,7 @@ impl }) .unwrap_or(message) }), + attempt_status: None, }) } } diff --git a/crates/router/src/connector/stripe/transformers.rs b/crates/router/src/connector/stripe/transformers.rs index fa9d7d61704..a783fd23fe1 100644 --- a/crates/router/src/connector/stripe/transformers.rs +++ b/crates/router/src/connector/stripe/transformers.rs @@ -2475,6 +2475,7 @@ impl<F, T> }) .or(Some(error.message.clone())), status_code: item.http_code, + attempt_status: None, }); let connector_metadata = diff --git a/crates/router/src/connector/trustpay.rs b/crates/router/src/connector/trustpay.rs index 912f1575e1e..903952dc8eb 100644 --- a/crates/router/src/connector/trustpay.rs +++ b/crates/router/src/connector/trustpay.rs @@ -138,6 +138,7 @@ impl ConnectorCommon for Trustpay { .map(|error_code_message| error_code_message.error_code) .unwrap_or(consts::NO_ERROR_MESSAGE.to_string()), reason: reason.or(response_data.description), + attempt_status: None, }) } Err(error_msg) => { @@ -293,6 +294,7 @@ impl ConnectorIntegration<api::AccessTokenAuth, types::AccessTokenRequestData, t // message vary for the same code, so relying on code alone as it is unique message: response.result_info.result_code.to_string(), reason: response.result_info.additional_info, + attempt_status: None, }) } } @@ -366,6 +368,7 @@ impl ConnectorIntegration<api::PSync, types::PaymentsSyncData, types::PaymentsRe // message vary for the same code, so relying on code alone as it is unique message: response.status.to_string(), reason: Some(response.payment_description), + attempt_status: None, }) } diff --git a/crates/router/src/connector/trustpay/transformers.rs b/crates/router/src/connector/trustpay/transformers.rs index 5ca4bd1ac3d..32b52a115df 100644 --- a/crates/router/src/connector/trustpay/transformers.rs +++ b/crates/router/src/connector/trustpay/transformers.rs @@ -715,6 +715,7 @@ fn handle_cards_response( .unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()), reason: msg, status_code, + attempt_status: None, }) } else { None @@ -776,6 +777,7 @@ fn handle_bank_redirects_error_response( message: response.payment_result_info.result_code.to_string(), reason: response.payment_result_info.additional_info, status_code, + attempt_status: None, }); let payment_response_data = types::PaymentsResponseData::TransactionResponse { resource_id: types::ResponseId::NoResponseId, @@ -811,6 +813,7 @@ fn handle_bank_redirects_sync_response( message: reason_info.reason.code, reason: reason_info.reason.reject_reason, status_code, + attempt_status: None, }) } else { None @@ -937,6 +940,7 @@ impl<F, T> TryFrom<types::ResponseRouterData<F, TrustpayAuthUpdateResponse, T, t message: item.response.result_info.result_code.to_string(), reason: item.response.result_info.additional_info, status_code: item.http_code, + attempt_status: None, }), ..item.data }), @@ -1408,6 +1412,7 @@ fn handle_cards_refund_response( .unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()), reason: msg, status_code, + attempt_status: None, }) } else { None @@ -1446,6 +1451,7 @@ fn handle_bank_redirects_refund_response( message: response.result_info.result_code.to_string(), reason: msg.map(|message| message.to_string()), status_code, + attempt_status: None, }) } else { None @@ -1473,6 +1479,7 @@ fn handle_bank_redirects_refund_sync_response( message: reason_info.reason.code, reason: reason_info.reason.reject_reason, status_code, + attempt_status: None, }) } else { None @@ -1494,6 +1501,7 @@ fn handle_bank_redirects_refund_sync_error_response( message: response.payment_result_info.result_code.to_string(), reason: response.payment_result_info.additional_info, status_code, + attempt_status: None, }); //unreachable case as we are sending error as Some() let refund_response_data = types::RefundsResponseData { diff --git a/crates/router/src/connector/tsys/transformers.rs b/crates/router/src/connector/tsys/transformers.rs index a3bd1c4a074..8110b9332ee 100644 --- a/crates/router/src/connector/tsys/transformers.rs +++ b/crates/router/src/connector/tsys/transformers.rs @@ -202,6 +202,7 @@ fn get_error_response( message: connector_error_response.response_message.clone(), reason: Some(connector_error_response.response_message), status_code, + attempt_status: None, } } diff --git a/crates/router/src/connector/volt.rs b/crates/router/src/connector/volt.rs index e1af4c008b1..f37cd082d31 100644 --- a/crates/router/src/connector/volt.rs +++ b/crates/router/src/connector/volt.rs @@ -129,6 +129,7 @@ impl ConnectorCommon for Volt { code: response.exception.message.to_string(), message: response.exception.message.clone(), reason: Some(reason), + attempt_status: None, }) } } diff --git a/crates/router/src/connector/wise.rs b/crates/router/src/connector/wise.rs index 9616533a455..7b889585ebd 100644 --- a/crates/router/src/connector/wise.rs +++ b/crates/router/src/connector/wise.rs @@ -94,6 +94,7 @@ impl ConnectorCommon for Wise { code: e.code.clone(), message: e.message.clone(), reason: None, + attempt_status: None, }) } else { Ok(types::ErrorResponse { @@ -101,6 +102,7 @@ impl ConnectorCommon for Wise { code: default_status, message: response.message.unwrap_or_default(), reason: None, + attempt_status: None, }) } } @@ -109,6 +111,7 @@ impl ConnectorCommon for Wise { code: default_status, message: response.message.unwrap_or_default(), reason: None, + attempt_status: None, }), } } @@ -289,6 +292,7 @@ impl services::ConnectorIntegration<api::PoCancel, types::PayoutsData, types::Pa code, message, reason: None, + attempt_status: None, }) } } diff --git a/crates/router/src/connector/worldpay.rs b/crates/router/src/connector/worldpay.rs index 60a5fc83045..88f81676dde 100644 --- a/crates/router/src/connector/worldpay.rs +++ b/crates/router/src/connector/worldpay.rs @@ -94,6 +94,7 @@ impl ConnectorCommon for Worldpay { code: response.error_name, message: response.message, reason: response.validation_errors.map(|e| e.to_string()), + attempt_status: None, }) } } diff --git a/crates/router/src/connector/zen.rs b/crates/router/src/connector/zen.rs index d93075c3735..abbc75ca92d 100644 --- a/crates/router/src/connector/zen.rs +++ b/crates/router/src/connector/zen.rs @@ -126,6 +126,7 @@ impl ConnectorCommon for Zen { |error| error.message, ), reason: None, + attempt_status: None, }) } } diff --git a/crates/router/src/core/payments/access_token.rs b/crates/router/src/core/payments/access_token.rs index 887b2b8f411..af10e91b5a0 100644 --- a/crates/router/src/core/payments/access_token.rs +++ b/crates/router/src/core/payments/access_token.rs @@ -173,6 +173,7 @@ pub async fn refresh_connector_auth( message: consts::REQUEST_TIMEOUT_ERROR_MESSAGE.to_string(), reason: Some(consts::REQUEST_TIMEOUT_ERROR_MESSAGE.to_string()), status_code: 504, + attempt_status: None, }; Ok(Err(error_response)) diff --git a/crates/router/src/services/api.rs b/crates/router/src/services/api.rs index 3d618d047ea..d41f40ff080 100644 --- a/crates/router/src/services/api.rs +++ b/crates/router/src/services/api.rs @@ -10,7 +10,7 @@ use std::{ }; use actix_web::{body, web, FromRequest, HttpRequest, HttpResponse, Responder, ResponseError}; -use api_models::enums::{AttemptStatus, CaptureMethod}; +use api_models::enums::CaptureMethod; pub use client::{proxy_bypass_urls, ApiClient, MockApiClient, ProxyClient}; pub use common_utils::request::{ContentType, Method, Request, RequestBuilder}; use common_utils::{ @@ -226,6 +226,7 @@ pub trait ConnectorIntegration<T, Req, Resp>: ConnectorIntegrationAny<T, Req, Re message: error_message.to_string(), reason: String::from_utf8(res.response.to_vec()).ok(), status_code: res.status_code, + attempt_status: None, }) } @@ -303,6 +304,7 @@ where message: error_message.unwrap_or(consts::NO_ERROR_MESSAGE.to_string()), status_code: 200, // This status code is ignored in redirection response it will override with 302 status code. reason: None, + attempt_status: None, }) } else { None @@ -406,15 +408,8 @@ where _ => { let error_res = connector_integration.get_error_response(body)?; - if router_data.connector == "bluesnap" - && error_res.status_code == 403 - && error_res.reason - == Some(format!( - "{} in bluesnap dashboard", - consts::REQUEST_TIMEOUT_PAYMENT_NOT_FOUND - )) - { - router_data.status = AttemptStatus::Failure; + if let Some(status) = error_res.attempt_status { + router_data.status = status; }; error_res } @@ -434,6 +429,7 @@ where message: consts::REQUEST_TIMEOUT_ERROR_MESSAGE.to_string(), reason: Some(consts::REQUEST_TIMEOUT_ERROR_MESSAGE.to_string()), status_code: 504, + attempt_status: None, }; router_data.response = Err(error_response); router_data.connector_http_status_code = Some(504); diff --git a/crates/router/src/types.rs b/crates/router/src/types.rs index 261195d166c..8f08ce06256 100644 --- a/crates/router/src/types.rs +++ b/crates/router/src/types.rs @@ -923,6 +923,7 @@ pub struct ErrorResponse { pub message: String, pub reason: Option<String>, pub status_code: u16, + pub attempt_status: Option<storage_enums::AttemptStatus>, } impl ErrorResponse { @@ -938,6 +939,7 @@ impl ErrorResponse { .error_message(), reason: None, status_code: http::StatusCode::INTERNAL_SERVER_ERROR.as_u16(), + attempt_status: None, } } } @@ -980,6 +982,7 @@ impl From<errors::ApiErrorResponse> for ErrorResponse { errors::ApiErrorResponse::ExternalConnectorError { status_code, .. } => status_code, _ => 500, }, + attempt_status: None, } } } diff --git a/crates/router/src/types/api.rs b/crates/router/src/types/api.rs index 2179b4bde18..e815740cac4 100644 --- a/crates/router/src/types/api.rs +++ b/crates/router/src/types/api.rs @@ -111,6 +111,7 @@ pub trait ConnectorCommon { code: consts::NO_ERROR_CODE.to_string(), message: consts::NO_ERROR_MESSAGE.to_string(), reason: None, + attempt_status: None, }) } } diff --git a/crates/router/src/utils.rs b/crates/router/src/utils.rs index 386bd02ae94..558044028f7 100644 --- a/crates/router/src/utils.rs +++ b/crates/router/src/utils.rs @@ -401,6 +401,7 @@ pub fn handle_json_response_deserialization_failure( code: consts::NO_ERROR_CODE.to_string(), message: consts::UNSUPPORTED_ERROR_MESSAGE.to_string(), reason: Some(response_data), + attempt_status: None, }) } }
fix
Add attempt_status in field in error_response (#2794)
5a791aaf4dc05e8ffdb60464a03b6fc41f860581
2024-01-18 22:36:40
Kashif
refactor(recon): update recipient email and mail body for ProFeatureRequest (#3381)
false
diff --git a/crates/router/src/routes/recon.rs b/crates/router/src/routes/recon.rs index d34e30237dd..22c886e1358 100644 --- a/crates/router/src/routes/recon.rs +++ b/crates/router/src/routes/recon.rs @@ -102,9 +102,9 @@ pub async fn send_recon_request( user_name: UserName::new(user_from_db.name) .change_context(errors::ApiErrorResponse::InternalServerError) .attach_printable("Failed to form username")?, - recipient_email: UserEmail::from_pii_email(user_from_db.email.clone()) + recipient_email: UserEmail::new(Secret::new("[email protected]".to_string())) .change_context(errors::ApiErrorResponse::InternalServerError) - .attach_printable("Failed to convert to UserEmail from pii::Email")?, + .attach_printable("Failed to convert recipient's email to UserEmail")?, settings: state.conf.clone(), subject: format!( "Dashboard Pro Feature Request by {}", @@ -187,7 +187,7 @@ pub async fn recon_merchant_account_update( let email_contents = email_types::ReconActivation { recipient_email: UserEmail::from_pii_email(user_email.clone()) .change_context(errors::ApiErrorResponse::InternalServerError) - .attach_printable("Failed to convert to UserEmail from pii::Email")?, + .attach_printable("Failed to convert recipient's email to UserEmail from pii::Email")?, user_name: UserName::new(Secret::new("HyperSwitch User".to_string())) .change_context(errors::ApiErrorResponse::InternalServerError) .attach_printable("Failed to form username")?, diff --git a/crates/router/src/services/email/types.rs b/crates/router/src/services/email/types.rs index 0ef15eaa40d..d5aa9926130 100644 --- a/crates/router/src/services/email/types.rs +++ b/crates/router/src/services/email/types.rs @@ -74,19 +74,17 @@ pub mod html { merchant_id, user_name, user_email, - } => { - format!( - "Dear Hyperswitch Support Team, - - Dashboard Pro Feature Request, - Feature name : {feature_name} - Merchant ID : {merchant_id} - Merchant Name : {user_name} - Email : {user_email} - - (note: This is an auto generated email. use merchant email for any further comunications)", - ) - } + } => format!( + "Dear Hyperswitch Support Team, + +Dashboard Pro Feature Request, +Feature name : {feature_name} +Merchant ID : {merchant_id} +Merchant Name : {user_name} +Email : {user_email} + +(note: This is an auto generated email. Use merchant email for any further communications)", + ), } } }
refactor
update recipient email and mail body for ProFeatureRequest (#3381)
b63439a0936c02902ae5256ec853935fecff6fca
2025-03-07 16:40:34
Hrithikesh
chore: make v1 merchant account forward compatible (#7426)
false
diff --git a/crates/api_models/src/admin.rs b/crates/api_models/src/admin.rs index de85d8c2c05..61bb7c009e3 100644 --- a/crates/api_models/src/admin.rs +++ b/crates/api_models/src/admin.rs @@ -111,6 +111,10 @@ pub struct MerchantAccountCreate { /// Default payment method collect link config #[schema(value_type = Option<BusinessCollectLinkConfig>)] pub pm_collect_link_config: Option<BusinessCollectLinkConfig>, + + /// Product Type of this merchant account + #[schema(value_type = Option<api_enums::MerchantProductType>)] + pub product_type: Option<api_enums::MerchantProductType>, } #[cfg(feature = "v1")] @@ -193,6 +197,8 @@ pub struct MerchantAccountCreateWithoutOrgId { /// Metadata is useful for storing additional, unstructured information about the merchant account. #[schema(value_type = Option<Object>, example = r#"{ "city": "NY", "unit": "245" }"#)] pub metadata: Option<pii::SecretSerdeValue>, + + pub product_type: Option<api_enums::MerchantProductType>, } // In v2 the struct used in the API is MerchantAccountCreateWithoutOrgId @@ -205,6 +211,8 @@ pub struct MerchantAccountCreate { pub merchant_details: Option<MerchantDetails>, pub metadata: Option<pii::SecretSerdeValue>, pub organization_id: id_type::OrganizationId, + /// Product Type of this merchant account + pub product_type: Option<api_enums::MerchantProductType>, } #[cfg(feature = "v2")] @@ -550,6 +558,10 @@ pub struct MerchantAccountResponse { /// Default payment method collect link config #[schema(value_type = Option<BusinessCollectLinkConfig>)] pub pm_collect_link_config: Option<BusinessCollectLinkConfig>, + + /// Product Type of this merchant account + #[schema(value_type = Option<api_enums::MerchantProductType>)] + pub product_type: Option<api_enums::MerchantProductType>, } #[cfg(feature = "v2")] @@ -582,6 +594,10 @@ pub struct MerchantAccountResponse { /// Used to indicate the status of the recon module for a merchant account #[schema(value_type = ReconStatus, example = "not_requested")] pub recon_status: api_enums::ReconStatus, + + /// Product Type of this merchant account + #[schema(value_type = Option<api_enums::MerchantProductType>)] + pub product_type: Option<api_enums::MerchantProductType>, } #[derive(Clone, Debug, Deserialize, ToSchema, Serialize)] diff --git a/crates/diesel_models/src/query/merchant_account.rs b/crates/diesel_models/src/query/merchant_account.rs index 03945646014..c40af7f6535 100644 --- a/crates/diesel_models/src/query/merchant_account.rs +++ b/crates/diesel_models/src/query/merchant_account.rs @@ -2,9 +2,9 @@ use diesel::{associations::HasTable, ExpressionMethods, Table}; use super::generics; #[cfg(feature = "v1")] -use crate::schema::merchant_account::dsl::{self, merchant_id as dsl_identifier}; +use crate::schema::merchant_account::dsl; #[cfg(feature = "v2")] -use crate::schema_v2::merchant_account::dsl::{self, id as dsl_identifier}; +use crate::schema_v2::merchant_account::dsl; use crate::{ errors, merchant_account::{MerchantAccount, MerchantAccountNew, MerchantAccountUpdateInternal}, @@ -17,6 +17,7 @@ impl MerchantAccountNew { } } +#[cfg(feature = "v1")] impl MerchantAccount { pub async fn update( self, @@ -50,7 +51,7 @@ impl MerchantAccount { _, >( conn, - dsl_identifier.eq(identifier.to_owned()), + dsl::merchant_id.eq(identifier.to_owned()), merchant_account, ) .await @@ -62,7 +63,147 @@ impl MerchantAccount { ) -> StorageResult<bool> { generics::generic_delete::<<Self as HasTable>::Table, _>( conn, - dsl_identifier.eq(identifier.to_owned()), + dsl::merchant_id.eq(identifier.to_owned()), + ) + .await + } + + pub async fn find_by_merchant_id( + conn: &PgPooledConn, + identifier: &common_utils::id_type::MerchantId, + ) -> StorageResult<Self> { + generics::generic_find_one::<<Self as HasTable>::Table, _, _>( + conn, + dsl::merchant_id.eq(identifier.to_owned()), + ) + .await + } + + pub async fn find_by_publishable_key( + conn: &PgPooledConn, + publishable_key: &str, + ) -> StorageResult<Self> { + generics::generic_find_one::<<Self as HasTable>::Table, _, _>( + conn, + dsl::publishable_key.eq(publishable_key.to_owned()), + ) + .await + } + + pub async fn list_by_organization_id( + conn: &PgPooledConn, + organization_id: &common_utils::id_type::OrganizationId, + ) -> StorageResult<Vec<Self>> { + generics::generic_filter::< + <Self as HasTable>::Table, + _, + <<Self as HasTable>::Table as Table>::PrimaryKey, + _, + >( + conn, + dsl::organization_id.eq(organization_id.to_owned()), + None, + None, + None, + ) + .await + } + + pub async fn list_multiple_merchant_accounts( + conn: &PgPooledConn, + merchant_ids: Vec<common_utils::id_type::MerchantId>, + ) -> StorageResult<Vec<Self>> { + generics::generic_filter::< + <Self as HasTable>::Table, + _, + <<Self as HasTable>::Table as Table>::PrimaryKey, + _, + >( + conn, + dsl::merchant_id.eq_any(merchant_ids.clone()), + None, + None, + None, + ) + .await + } + + pub async fn list_all_merchant_accounts( + conn: &PgPooledConn, + limit: u32, + offset: Option<u32>, + ) -> StorageResult<Vec<Self>> { + generics::generic_filter::< + <Self as HasTable>::Table, + _, + <<Self as HasTable>::Table as Table>::PrimaryKey, + _, + >( + conn, + dsl::merchant_id.ne_all(vec![""]), + Some(i64::from(limit)), + offset.map(i64::from), + None, + ) + .await + } + + pub async fn update_all_merchant_accounts( + conn: &PgPooledConn, + merchant_account: MerchantAccountUpdateInternal, + ) -> StorageResult<Vec<Self>> { + generics::generic_update_with_results::<<Self as HasTable>::Table, _, _, _>( + conn, + dsl::merchant_id.ne_all(vec![""]), + merchant_account, + ) + .await + } +} + +#[cfg(feature = "v2")] +impl MerchantAccount { + pub async fn update( + self, + conn: &PgPooledConn, + merchant_account: MerchantAccountUpdateInternal, + ) -> StorageResult<Self> { + match generics::generic_update_by_id::<<Self as HasTable>::Table, _, _, _>( + conn, + self.get_id().to_owned(), + merchant_account, + ) + .await + { + Err(error) => match error.current_context() { + errors::DatabaseError::NoFieldsToUpdate => Ok(self), + _ => Err(error), + }, + result => result, + } + } + + pub async fn update_with_specific_fields( + conn: &PgPooledConn, + identifier: &common_utils::id_type::MerchantId, + merchant_account: MerchantAccountUpdateInternal, + ) -> StorageResult<Self> { + generics::generic_update_with_unique_predicate_get_result::< + <Self as HasTable>::Table, + _, + _, + _, + >(conn, dsl::id.eq(identifier.to_owned()), merchant_account) + .await + } + + pub async fn delete_by_merchant_id( + conn: &PgPooledConn, + identifier: &common_utils::id_type::MerchantId, + ) -> StorageResult<bool> { + generics::generic_delete::<<Self as HasTable>::Table, _>( + conn, + dsl::id.eq(identifier.to_owned()), ) .await } @@ -73,7 +214,7 @@ impl MerchantAccount { ) -> StorageResult<Self> { generics::generic_find_one::<<Self as HasTable>::Table, _, _>( conn, - dsl_identifier.eq(identifier.to_owned()), + dsl::id.eq(identifier.to_owned()), ) .await } @@ -117,7 +258,7 @@ impl MerchantAccount { _, <<Self as HasTable>::Table as Table>::PrimaryKey, _, - >(conn, dsl_identifier.eq_any(merchant_ids), None, None, None) + >(conn, dsl::id.eq_any(merchant_ids), None, None, None) .await } @@ -133,7 +274,7 @@ impl MerchantAccount { _, >( conn, - dsl_identifier.ne_all(vec![""]), + dsl::id.ne_all(vec![""]), Some(i64::from(limit)), offset.map(i64::from), None, @@ -147,7 +288,7 @@ impl MerchantAccount { ) -> StorageResult<Vec<Self>> { generics::generic_update_with_results::<<Self as HasTable>::Table, _, _, _>( conn, - dsl_identifier.ne_all(vec![""]), + dsl::id.ne_all(vec![""]), merchant_account, ) .await diff --git a/crates/hyperswitch_domain_models/src/merchant_account.rs b/crates/hyperswitch_domain_models/src/merchant_account.rs index e3617b79108..b6b7571d32f 100644 --- a/crates/hyperswitch_domain_models/src/merchant_account.rs +++ b/crates/hyperswitch_domain_models/src/merchant_account.rs @@ -654,7 +654,9 @@ impl super::behaviour::Conversion for MerchantAccount { recon_status: self.recon_status, version: crate::consts::API_VERSION, is_platform_account: self.is_platform_account, - product_type: self.product_type, + product_type: self + .product_type + .or(Some(common_enums::MerchantProductType::Orchestration)), }) } } @@ -786,7 +788,7 @@ impl super::behaviour::Conversion for MerchantAccount { async fn construct_new(self) -> CustomResult<Self::NewDstType, ValidationError> { let now = date_time::now(); Ok(diesel_models::merchant_account::MerchantAccountNew { - id: None, + id: Some(self.merchant_id.clone()), merchant_id: self.merchant_id, merchant_name: self.merchant_name.map(Encryption::from), merchant_details: self.merchant_details.map(Encryption::from), @@ -815,7 +817,9 @@ impl super::behaviour::Conversion for MerchantAccount { pm_collect_link_config: self.pm_collect_link_config, version: crate::consts::API_VERSION, is_platform_account: self.is_platform_account, - product_type: self.product_type, + product_type: self + .product_type + .or(Some(common_enums::MerchantProductType::Orchestration)), }) } } diff --git a/crates/router/src/core/admin.rs b/crates/router/src/core/admin.rs index 46b69306671..c5fb803ef97 100644 --- a/crates/router/src/core/admin.rs +++ b/crates/router/src/core/admin.rs @@ -404,7 +404,7 @@ impl MerchantAccountCreateBridge for api::MerchantAccountCreate { pm_collect_link_config, version: hyperswitch_domain_models::consts::API_VERSION, is_platform_account: false, - product_type: None, + product_type: self.product_type, }, ) } @@ -673,7 +673,7 @@ impl MerchantAccountCreateBridge for api::MerchantAccountCreate { organization_id: organization.get_organization_id(), recon_status: diesel_models::enums::ReconStatus::NotRequested, is_platform_account: false, - product_type: None, + product_type: self.product_type, }), ) } diff --git a/crates/router/src/routes/admin.rs b/crates/router/src/routes/admin.rs index a112be46188..876fa0bf256 100644 --- a/crates/router/src/routes/admin.rs +++ b/crates/router/src/routes/admin.rs @@ -135,6 +135,7 @@ pub async fn merchant_account_create( merchant_details: json_payload.merchant_details, metadata: json_payload.metadata, organization_id: org_id, + product_type: json_payload.product_type, }; Box::pin(api::server_wrap( diff --git a/crates/router/src/types/api/admin.rs b/crates/router/src/types/api/admin.rs index 80d5e300bed..27136cc3ea6 100644 --- a/crates/router/src/types/api/admin.rs +++ b/crates/router/src/types/api/admin.rs @@ -91,6 +91,7 @@ impl ForeignTryFrom<domain::MerchantAccount> for MerchantAccountResponse { default_profile: item.default_profile, recon_status: item.recon_status, pm_collect_link_config, + product_type: item.product_type, }) } } @@ -116,6 +117,7 @@ impl ForeignTryFrom<domain::MerchantAccount> for MerchantAccountResponse { metadata: item.metadata, organization_id: item.organization_id, recon_status: item.recon_status, + product_type: item.product_type, }) } } diff --git a/crates/router/src/types/domain/user.rs b/crates/router/src/types/domain/user.rs index 1eb2305058a..a51ccfdc710 100644 --- a/crates/router/src/types/domain/user.rs +++ b/crates/router/src/types/domain/user.rs @@ -450,6 +450,7 @@ impl NewUserMerchant { organization_id: self.new_organization.get_organization_id(), metadata: None, merchant_details: None, + product_type: None, }) } @@ -476,6 +477,7 @@ impl NewUserMerchant { enable_payment_response_hash: None, redirect_to_merchant_with_http_post: None, pm_collect_link_config: None, + product_type: None, }) } diff --git a/crates/router/src/utils/user.rs b/crates/router/src/utils/user.rs index 721b0052bda..b386185eeca 100644 --- a/crates/router/src/utils/user.rs +++ b/crates/router/src/utils/user.rs @@ -315,6 +315,7 @@ pub fn create_merchant_account_request_for_org( enable_payment_response_hash: None, redirect_to_merchant_with_http_post: None, pm_collect_link_config: None, + product_type: None, }) }
chore
make v1 merchant account forward compatible (#7426)
8320dc07fe1b8b1c9427f70dcb9d952eef01a63b
2024-09-19 18:54:56
Kashif
feat(payments): store and propagate additional wallet pm details in payments response (#5869)
false
diff --git a/api-reference-v2/openapi_spec.json b/api-reference-v2/openapi_spec.json index 04c72b1e8a7..558a3198281 100644 --- a/api-reference-v2/openapi_spec.json +++ b/api-reference-v2/openapi_spec.json @@ -11912,7 +11912,7 @@ ], "properties": { "wallet": { - "type": "object" + "$ref": "#/components/schemas/WalletResponse" } } }, @@ -19124,6 +19124,28 @@ } ] }, + "WalletAdditionalDataForCard": { + "type": "object", + "required": [ + "last4", + "card_network", + "type" + ], + "properties": { + "last4": { + "type": "string", + "description": "Last 4 digits of the card number" + }, + "card_network": { + "type": "string", + "description": "The information of the payment method" + }, + "type": { + "type": "string", + "description": "The type of payment method" + } + } + }, "WalletData": { "oneOf": [ { @@ -19428,6 +19450,47 @@ } ] }, + "WalletResponse": { + "allOf": [ + { + "allOf": [ + { + "$ref": "#/components/schemas/WalletResponseData" + } + ], + "nullable": true + }, + { + "type": "object" + } + ] + }, + "WalletResponseData": { + "oneOf": [ + { + "type": "object", + "required": [ + "apple_pay" + ], + "properties": { + "apple_pay": { + "$ref": "#/components/schemas/WalletAdditionalDataForCard" + } + } + }, + { + "type": "object", + "required": [ + "google_pay" + ], + "properties": { + "google_pay": { + "$ref": "#/components/schemas/WalletAdditionalDataForCard" + } + } + } + ] + }, "WeChatPay": { "type": "object" }, diff --git a/api-reference/openapi_spec.json b/api-reference/openapi_spec.json index 7ef33c1c945..8214d3a10be 100644 --- a/api-reference/openapi_spec.json +++ b/api-reference/openapi_spec.json @@ -15726,7 +15726,7 @@ ], "properties": { "wallet": { - "type": "object" + "$ref": "#/components/schemas/WalletResponse" } } }, @@ -23465,6 +23465,28 @@ } ] }, + "WalletAdditionalDataForCard": { + "type": "object", + "required": [ + "last4", + "card_network", + "type" + ], + "properties": { + "last4": { + "type": "string", + "description": "Last 4 digits of the card number" + }, + "card_network": { + "type": "string", + "description": "The information of the payment method" + }, + "type": { + "type": "string", + "description": "The type of payment method" + } + } + }, "WalletData": { "oneOf": [ { @@ -23769,6 +23791,47 @@ } ] }, + "WalletResponse": { + "allOf": [ + { + "allOf": [ + { + "$ref": "#/components/schemas/WalletResponseData" + } + ], + "nullable": true + }, + { + "type": "object" + } + ] + }, + "WalletResponseData": { + "oneOf": [ + { + "type": "object", + "required": [ + "apple_pay" + ], + "properties": { + "apple_pay": { + "$ref": "#/components/schemas/WalletAdditionalDataForCard" + } + } + }, + { + "type": "object", + "required": [ + "google_pay" + ], + "properties": { + "google_pay": { + "$ref": "#/components/schemas/WalletAdditionalDataForCard" + } + } + } + ] + }, "WeChatPay": { "type": "object" }, diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rs index 20f1205e14b..715bf3c3544 100644 --- a/crates/api_models/src/payments.rs +++ b/crates/api_models/src/payments.rs @@ -2046,6 +2046,7 @@ pub enum AdditionalPaymentData { }, Wallet { apple_pay: Option<ApplepayPaymentMethod>, + google_pay: Option<additional_info::WalletAdditionalDataForCard>, }, PayLater { klarna_sdk: Option<KlarnaSdkPaymentMethod>, @@ -3069,7 +3070,7 @@ where | PaymentMethodDataResponse::PayLater(_) | PaymentMethodDataResponse::RealTimePayment(_) | PaymentMethodDataResponse::Upi(_) - | PaymentMethodDataResponse::Wallet {} + | PaymentMethodDataResponse::Wallet(_) | PaymentMethodDataResponse::BankTransfer(_) | PaymentMethodDataResponse::OpenBanking(_) | PaymentMethodDataResponse::Voucher(_) => { @@ -3090,7 +3091,7 @@ where pub enum PaymentMethodDataResponse { Card(Box<CardResponse>), BankTransfer(Box<BankTransferResponse>), - Wallet {}, + Wallet(Box<WalletResponse>), PayLater(Box<PaylaterResponse>), BankRedirect(Box<BankRedirectResponse>), Crypto(Box<CryptoResponse>), @@ -3187,6 +3188,21 @@ pub struct PaylaterResponse { klarna_sdk: Option<KlarnaSdkPaymentMethodResponse>, } +#[derive(Eq, PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize, ToSchema)] +pub struct WalletResponse { + #[serde(flatten)] + details: Option<WalletResponseData>, +} + +#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)] +#[serde(rename_all = "snake_case")] +pub enum WalletResponseData { + #[schema(value_type = WalletAdditionalDataForCard)] + ApplePay(Box<additional_info::WalletAdditionalDataForCard>), + #[schema(value_type = WalletAdditionalDataForCard)] + GooglePay(Box<additional_info::WalletAdditionalDataForCard>), +} + #[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)] pub struct KlarnaSdkPaymentMethodResponse { @@ -4422,7 +4438,33 @@ impl From<AdditionalPaymentData> for PaymentMethodDataResponse { Some(sdk) => Self::PayLater(Box::new(PaylaterResponse::from(sdk))), None => Self::PayLater(Box::new(PaylaterResponse { klarna_sdk: None })), }, - AdditionalPaymentData::Wallet { .. } => Self::Wallet {}, + AdditionalPaymentData::Wallet { + apple_pay, + google_pay, + } => match (apple_pay, google_pay) { + (Some(apple_pay_pm), _) => Self::Wallet(Box::new(WalletResponse { + details: Some(WalletResponseData::ApplePay(Box::new( + additional_info::WalletAdditionalDataForCard { + last4: apple_pay_pm + .display_name + .clone() + .chars() + .rev() + .take(4) + .collect::<String>() + .chars() + .rev() + .collect::<String>(), + card_network: apple_pay_pm.network.clone(), + card_type: apple_pay_pm.pm_type.clone(), + }, + ))), + })), + (_, Some(google_pay_pm)) => Self::Wallet(Box::new(WalletResponse { + details: Some(WalletResponseData::GooglePay(Box::new(google_pay_pm))), + })), + _ => Self::Wallet(Box::new(WalletResponse { details: None })), + }, AdditionalPaymentData::BankRedirect { bank_name, details } => { Self::BankRedirect(Box::new(BankRedirectResponse { bank_name, details })) } diff --git a/crates/api_models/src/payments/additional_info.rs b/crates/api_models/src/payments/additional_info.rs index 77500b0edc5..9e8c910cba7 100644 --- a/crates/api_models/src/payments/additional_info.rs +++ b/crates/api_models/src/payments/additional_info.rs @@ -205,9 +205,19 @@ pub enum UpiAdditionalData { } #[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)] -#[serde(rename_all = "snake_case")] pub struct UpiCollectAdditionalData { /// Masked VPA ID #[schema(value_type = Option<String>, example = "ab********@okhdfcbank")] pub vpa_id: Option<MaskedUpiVpaId>, } + +#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)] +pub struct WalletAdditionalDataForCard { + /// Last 4 digits of the card number + pub last4: String, + /// The information of the payment method + pub card_network: String, + /// The type of payment method + #[serde(rename = "type")] + pub card_type: String, +} diff --git a/crates/openapi/src/openapi.rs b/crates/openapi/src/openapi.rs index d71757e8f34..b626b7d4418 100644 --- a/crates/openapi/src/openapi.rs +++ b/crates/openapi/src/openapi.rs @@ -613,7 +613,10 @@ Never share your secret api keys. Keep them guarded and secure. api_models::payments::additional_info::GivexGiftCardAdditionalData, api_models::payments::additional_info::UpiAdditionalData, api_models::payments::additional_info::UpiCollectAdditionalData, + api_models::payments::additional_info::WalletAdditionalDataForCard, api_models::payments::PaymentsDynamicTaxCalculationRequest, + api_models::payments::WalletResponse, + api_models::payments::WalletResponseData, api_models::payments::PaymentsDynamicTaxCalculationResponse, api_models::payments::DisplayAmountOnSdk, )), diff --git a/crates/openapi/src/openapi_v2.rs b/crates/openapi/src/openapi_v2.rs index 8a21110ae83..f12d6a7b567 100644 --- a/crates/openapi/src/openapi_v2.rs +++ b/crates/openapi/src/openapi_v2.rs @@ -530,6 +530,9 @@ Never share your secret api keys. Keep them guarded and secure. api_models::payments::additional_info::GivexGiftCardAdditionalData, api_models::payments::additional_info::UpiAdditionalData, api_models::payments::additional_info::UpiCollectAdditionalData, + api_models::payments::additional_info::WalletAdditionalDataForCard, + api_models::payments::WalletResponse, + api_models::payments::WalletResponseData, api_models::payments::PaymentsDynamicTaxCalculationRequest, api_models::payments::PaymentsDynamicTaxCalculationResponse, api_models::payments::DisplayAmountOnSdk, diff --git a/crates/router/src/core/payments/helpers.rs b/crates/router/src/core/payments/helpers.rs index ce92c1ab007..81d9130db85 100644 --- a/crates/router/src/core/payments/helpers.rs +++ b/crates/router/src/core/payments/helpers.rs @@ -4261,9 +4261,23 @@ pub async fn get_additional_payment_data( network: apple_pay_wallet_data.payment_method.network.clone(), pm_type: apple_pay_wallet_data.payment_method.pm_type.clone(), }), + google_pay: None, }) } - _ => Some(api_models::payments::AdditionalPaymentData::Wallet { apple_pay: None }), + domain::WalletData::GooglePay(google_pay_pm_data) => { + Some(api_models::payments::AdditionalPaymentData::Wallet { + apple_pay: None, + google_pay: Some(payment_additional_types::WalletAdditionalDataForCard { + last4: google_pay_pm_data.info.card_details.clone(), + card_network: google_pay_pm_data.info.card_network.clone(), + card_type: google_pay_pm_data.pm_type.clone(), + }), + }) + } + _ => Some(api_models::payments::AdditionalPaymentData::Wallet { + apple_pay: None, + google_pay: None, + }), }, domain::PaymentMethodData::PayLater(_) => { Some(api_models::payments::AdditionalPaymentData::PayLater { klarna_sdk: None })
feat
store and propagate additional wallet pm details in payments response (#5869)
1b8946321befb3a3a79c5fe2acf6b255b8930940
2024-07-01 16:28:36
Sakil Mostak
feat(connector): [Bambora Apac] Template for integration (#5062)
false
diff --git a/config/config.example.toml b/config/config.example.toml index 1c3d9ebd98e..4e3747eb8f7 100644 --- a/config/config.example.toml +++ b/config/config.example.toml @@ -181,6 +181,7 @@ airwallex.base_url = "https://api-demo.airwallex.com/" applepay.base_url = "https://apple-pay-gateway.apple.com/" authorizedotnet.base_url = "https://apitest.authorize.net/xml/v1/request.api" bambora.base_url = "https://api.na.bambora.com" +bamboraapac.base_url = "https://demo.bambora.co.nz/interface/api/dts.asmx" bankofamerica.base_url = "https://apitest.merchant-services.bankofamerica.com/" billwerk.base_url = "https://api.reepay.com/" billwerk.secondary_base_url = "https://card.reepay.com/" diff --git a/config/deployments/integration_test.toml b/config/deployments/integration_test.toml index b75062c9340..01a18f6c008 100644 --- a/config/deployments/integration_test.toml +++ b/config/deployments/integration_test.toml @@ -26,6 +26,7 @@ airwallex.base_url = "https://api-demo.airwallex.com/" applepay.base_url = "https://apple-pay-gateway.apple.com/" authorizedotnet.base_url = "https://apitest.authorize.net/xml/v1/request.api" bambora.base_url = "https://api.na.bambora.com" +bamboraapac.base_url = "https://demo.bambora.co.nz/interface/api/dts.asmx" bankofamerica.base_url = "https://apitest.merchant-services.bankofamerica.com/" billwerk.base_url = "https://api.reepay.com/" billwerk.secondary_base_url = "https://card.reepay.com/" diff --git a/config/deployments/production.toml b/config/deployments/production.toml index 98008212fc0..39f477a3639 100644 --- a/config/deployments/production.toml +++ b/config/deployments/production.toml @@ -30,6 +30,7 @@ airwallex.base_url = "https://api-demo.airwallex.com/" applepay.base_url = "https://apple-pay-gateway.apple.com/" authorizedotnet.base_url = "https://api.authorize.net/xml/v1/request.api" bambora.base_url = "https://api.na.bambora.com" +bamboraapac.base_url = "https://demo.bambora.co.nz/interface/api/dts.asmx" bankofamerica.base_url = "https://api.merchant-services.bankofamerica.com/" billwerk.base_url = "https://api.reepay.com/" billwerk.secondary_base_url = "https://card.reepay.com/" diff --git a/config/deployments/sandbox.toml b/config/deployments/sandbox.toml index 040986f7948..c9180e1a612 100644 --- a/config/deployments/sandbox.toml +++ b/config/deployments/sandbox.toml @@ -30,6 +30,7 @@ airwallex.base_url = "https://api-demo.airwallex.com/" applepay.base_url = "https://apple-pay-gateway.apple.com/" authorizedotnet.base_url = "https://apitest.authorize.net/xml/v1/request.api" bambora.base_url = "https://api.na.bambora.com" +bamboraapac.base_url = "https://demo.bambora.co.nz/interface/api/dts.asmx" bankofamerica.base_url = "https://apitest.merchant-services.bankofamerica.com/" billwerk.base_url = "https://api.reepay.com/" billwerk.secondary_base_url = "https://card.reepay.com/" diff --git a/config/development.toml b/config/development.toml index ecece79a696..2aaf0e69922 100644 --- a/config/development.toml +++ b/config/development.toml @@ -99,6 +99,7 @@ cards = [ "airwallex", "authorizedotnet", "bambora", + "bamboraapac", "bankofamerica", "billwerk", "bitpay", @@ -175,6 +176,7 @@ airwallex.base_url = "https://api-demo.airwallex.com/" applepay.base_url = "https://apple-pay-gateway.apple.com/" authorizedotnet.base_url = "https://apitest.authorize.net/xml/v1/request.api" bambora.base_url = "https://api.na.bambora.com" +bamboraapac.base_url = "https://demo.bambora.co.nz/interface/api/dts.asmx" bankofamerica.base_url = "https://apitest.merchant-services.bankofamerica.com/" billwerk.base_url = "https://api.reepay.com/" billwerk.secondary_base_url = "https://card.reepay.com/" diff --git a/config/docker_compose.toml b/config/docker_compose.toml index 643893c7cb2..2b934ceb20f 100644 --- a/config/docker_compose.toml +++ b/config/docker_compose.toml @@ -112,6 +112,7 @@ airwallex.base_url = "https://api-demo.airwallex.com/" applepay.base_url = "https://apple-pay-gateway.apple.com/" authorizedotnet.base_url = "https://apitest.authorize.net/xml/v1/request.api" bambora.base_url = "https://api.na.bambora.com" +bamboraapac.base_url = "https://demo.bambora.co.nz/interface/api/dts.asmx" bankofamerica.base_url = "https://apitest.merchant-services.bankofamerica.com/" billwerk.base_url = "https://api.reepay.com/" billwerk.secondary_base_url = "https://card.reepay.com/" @@ -194,6 +195,7 @@ cards = [ "airwallex", "authorizedotnet", "bambora", + "bamboraapac", "bankofamerica", "billwerk", "bitpay", diff --git a/crates/api_models/src/enums.rs b/crates/api_models/src/enums.rs index 1f2896700e9..0d379ff2963 100644 --- a/crates/api_models/src/enums.rs +++ b/crates/api_models/src/enums.rs @@ -78,6 +78,7 @@ pub enum Connector { Airwallex, Authorizedotnet, Bambora, + // Bamboraapac, commented for template Bankofamerica, Billwerk, Bitpay, diff --git a/crates/common_enums/src/enums.rs b/crates/common_enums/src/enums.rs index 2d64a61450d..2ad0ad35cb3 100644 --- a/crates/common_enums/src/enums.rs +++ b/crates/common_enums/src/enums.rs @@ -121,6 +121,7 @@ pub enum RoutableConnectors { Billwerk, Bitpay, Bambora, + // Bamboraapac, commented for template Bluesnap, Boku, Braintree, diff --git a/crates/hyperswitch_interfaces/src/configs.rs b/crates/hyperswitch_interfaces/src/configs.rs index 8f3b5600f08..6d9024bc1ca 100644 --- a/crates/hyperswitch_interfaces/src/configs.rs +++ b/crates/hyperswitch_interfaces/src/configs.rs @@ -18,6 +18,7 @@ pub struct Connectors { pub applepay: ConnectorParams, pub authorizedotnet: ConnectorParams, pub bambora: ConnectorParams, + pub bamboraapac: ConnectorParams, pub bankofamerica: ConnectorParams, pub billwerk: ConnectorParams, pub bitpay: ConnectorParams, diff --git a/crates/router/src/connector.rs b/crates/router/src/connector.rs index 4b89b12734e..03f295518b8 100644 --- a/crates/router/src/connector.rs +++ b/crates/router/src/connector.rs @@ -4,6 +4,7 @@ pub mod adyenplatform; pub mod airwallex; pub mod authorizedotnet; pub mod bambora; +pub mod bamboraapac; pub mod bankofamerica; pub mod billwerk; pub mod bitpay; @@ -69,15 +70,16 @@ pub mod zsl; pub use self::dummyconnector::DummyConnector; pub use self::{ aci::Aci, adyen::Adyen, adyenplatform::Adyenplatform, airwallex::Airwallex, - authorizedotnet::Authorizedotnet, bambora::Bambora, bankofamerica::Bankofamerica, - billwerk::Billwerk, bitpay::Bitpay, bluesnap::Bluesnap, boku::Boku, braintree::Braintree, - cashtocode::Cashtocode, checkout::Checkout, coinbase::Coinbase, cryptopay::Cryptopay, - cybersource::Cybersource, datatrans::Datatrans, dlocal::Dlocal, ebanx::Ebanx, fiserv::Fiserv, - forte::Forte, globalpay::Globalpay, globepay::Globepay, gocardless::Gocardless, - gpayments::Gpayments, helcim::Helcim, iatapay::Iatapay, klarna::Klarna, mifinity::Mifinity, - mollie::Mollie, multisafepay::Multisafepay, netcetera::Netcetera, nexinets::Nexinets, nmi::Nmi, - noon::Noon, nuvei::Nuvei, opayo::Opayo, opennode::Opennode, payeezy::Payeezy, payme::Payme, - payone::Payone, paypal::Paypal, payu::Payu, placetopay::Placetopay, powertranz::Powertranz, + authorizedotnet::Authorizedotnet, bambora::Bambora, bamboraapac::Bamboraapac, + bankofamerica::Bankofamerica, billwerk::Billwerk, bitpay::Bitpay, bluesnap::Bluesnap, + boku::Boku, braintree::Braintree, cashtocode::Cashtocode, checkout::Checkout, + coinbase::Coinbase, cryptopay::Cryptopay, cybersource::Cybersource, datatrans::Datatrans, + dlocal::Dlocal, ebanx::Ebanx, fiserv::Fiserv, forte::Forte, globalpay::Globalpay, + globepay::Globepay, gocardless::Gocardless, gpayments::Gpayments, helcim::Helcim, + iatapay::Iatapay, klarna::Klarna, mifinity::Mifinity, mollie::Mollie, + multisafepay::Multisafepay, netcetera::Netcetera, nexinets::Nexinets, nmi::Nmi, noon::Noon, + nuvei::Nuvei, opayo::Opayo, opennode::Opennode, payeezy::Payeezy, payme::Payme, payone::Payone, + paypal::Paypal, payu::Payu, placetopay::Placetopay, powertranz::Powertranz, prophetpay::Prophetpay, rapyd::Rapyd, riskified::Riskified, shift4::Shift4, signifyd::Signifyd, square::Square, stax::Stax, stripe::Stripe, threedsecureio::Threedsecureio, trustpay::Trustpay, tsys::Tsys, volt::Volt, wise::Wise, worldline::Worldline, worldpay::Worldpay, zen::Zen, diff --git a/crates/router/src/connector/bamboraapac.rs b/crates/router/src/connector/bamboraapac.rs new file mode 100644 index 00000000000..f1f5fe40542 --- /dev/null +++ b/crates/router/src/connector/bamboraapac.rs @@ -0,0 +1,580 @@ +pub mod transformers; + +use common_utils::{ + self, + types::{AmountConvertor, MinorUnit, MinorUnitForConnector}, +}; +use error_stack::{report, ResultExt}; +use masking::ExposeInterface; +use transformers as bamboraapac; + +use super::utils as connector_utils; +use crate::{ + configs::settings, + core::errors::{self, CustomResult}, + events::connector_api_logs::ConnectorEvent, + headers, + services::{ + self, + request::{self, Mask}, + ConnectorIntegration, ConnectorValidation, + }, + types::{ + self, + api::{self, ConnectorCommon, ConnectorCommonExt}, + ErrorResponse, RequestContent, Response, + }, + utils::BytesExt, +}; + +#[derive(Clone)] +pub struct Bamboraapac { + amount_converter: &'static (dyn AmountConvertor<Output = MinorUnit> + Sync), +} + +impl Bamboraapac { + pub const fn new() -> &'static Self { + &Self { + amount_converter: &MinorUnitForConnector, + } + } +} + +impl api::Payment for Bamboraapac {} +impl api::PaymentSession for Bamboraapac {} +impl api::ConnectorAccessToken for Bamboraapac {} +impl api::MandateSetup for Bamboraapac {} +impl api::PaymentAuthorize for Bamboraapac {} +impl api::PaymentSync for Bamboraapac {} +impl api::PaymentCapture for Bamboraapac {} +impl api::PaymentVoid for Bamboraapac {} +impl api::Refund for Bamboraapac {} +impl api::RefundExecute for Bamboraapac {} +impl api::RefundSync for Bamboraapac {} +impl api::PaymentToken for Bamboraapac {} + +impl + ConnectorIntegration< + api::PaymentMethodToken, + types::PaymentMethodTokenizationData, + types::PaymentsResponseData, + > for Bamboraapac +{ + // Not Implemented (R) +} + +impl<Flow, Request, Response> ConnectorCommonExt<Flow, Request, Response> for Bamboraapac +where + Self: ConnectorIntegration<Flow, Request, Response>, +{ + fn build_headers( + &self, + req: &types::RouterData<Flow, Request, Response>, + _connectors: &settings::Connectors, + ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> { + let mut header = vec![( + headers::CONTENT_TYPE.to_string(), + self.get_content_type().to_string().into(), + )]; + let mut api_key = self.get_auth_header(&req.connector_auth_type)?; + header.append(&mut api_key); + Ok(header) + } +} + +impl ConnectorCommon for Bamboraapac { + fn id(&self) -> &'static str { + "bamboraapac" + } + + fn get_currency_unit(&self) -> api::CurrencyUnit { + api::CurrencyUnit::Minor + } + + fn common_get_content_type(&self) -> &'static str { + "application/json" + } + + fn base_url<'a>(&self, connectors: &'a settings::Connectors) -> &'a str { + connectors.bamboraapac.base_url.as_ref() + } + + fn get_auth_header( + &self, + auth_type: &types::ConnectorAuthType, + ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> { + let auth = bamboraapac::BamboraapacAuthType::try_from(auth_type) + .change_context(errors::ConnectorError::FailedToObtainAuthType)?; + Ok(vec![( + headers::AUTHORIZATION.to_string(), + auth.api_key.expose().into_masked(), + )]) + } + + fn build_error_response( + &self, + res: Response, + event_builder: Option<&mut ConnectorEvent>, + ) -> CustomResult<ErrorResponse, errors::ConnectorError> { + let response: bamboraapac::BamboraapacErrorResponse = res + .response + .parse_struct("BamboraapacErrorResponse") + .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; + + event_builder.map(|i| i.set_response_body(&response)); + router_env::logger::info!(connector_response=?response); + + Ok(ErrorResponse { + status_code: res.status_code, + code: response.code, + message: response.message, + reason: response.reason, + attempt_status: None, + connector_transaction_id: None, + }) + } +} + +impl ConnectorValidation for Bamboraapac { + //TODO: implement functions when support enabled +} + +impl ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData> + for Bamboraapac +{ + //TODO: implement sessions flow +} + +impl ConnectorIntegration<api::AccessTokenAuth, types::AccessTokenRequestData, types::AccessToken> + for Bamboraapac +{ +} + +impl + ConnectorIntegration< + api::SetupMandate, + types::SetupMandateRequestData, + types::PaymentsResponseData, + > for Bamboraapac +{ +} + +impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::PaymentsResponseData> + for Bamboraapac +{ + fn get_headers( + &self, + req: &types::PaymentsAuthorizeRouterData, + connectors: &settings::Connectors, + ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> { + self.build_headers(req, connectors) + } + + fn get_content_type(&self) -> &'static str { + self.common_get_content_type() + } + + fn get_url( + &self, + _req: &types::PaymentsAuthorizeRouterData, + _connectors: &settings::Connectors, + ) -> CustomResult<String, errors::ConnectorError> { + Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into()) + } + + fn get_request_body( + &self, + req: &types::PaymentsAuthorizeRouterData, + _connectors: &settings::Connectors, + ) -> CustomResult<RequestContent, errors::ConnectorError> { + let amount = connector_utils::convert_amount( + self.amount_converter, + req.request.minor_amount, + req.request.currency, + )?; + let connector_router_data = bamboraapac::BamboraapacRouterData::try_from((amount, req))?; + let connector_req = + bamboraapac::BamboraapacPaymentsRequest::try_from(&connector_router_data)?; + Ok(RequestContent::Json(Box::new(connector_req))) + } + + fn build_request( + &self, + req: &types::PaymentsAuthorizeRouterData, + connectors: &settings::Connectors, + ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + Ok(Some( + services::RequestBuilder::new() + .method(services::Method::Post) + .url(&types::PaymentsAuthorizeType::get_url( + self, req, connectors, + )?) + .attach_default_headers() + .headers(types::PaymentsAuthorizeType::get_headers( + self, req, connectors, + )?) + .set_body(types::PaymentsAuthorizeType::get_request_body( + self, req, connectors, + )?) + .build(), + )) + } + + fn handle_response( + &self, + data: &types::PaymentsAuthorizeRouterData, + event_builder: Option<&mut ConnectorEvent>, + res: Response, + ) -> CustomResult<types::PaymentsAuthorizeRouterData, errors::ConnectorError> { + let response: bamboraapac::BamboraapacPaymentsResponse = res + .response + .parse_struct("Bamboraapac PaymentsAuthorizeResponse") + .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; + event_builder.map(|i| i.set_response_body(&response)); + router_env::logger::info!(connector_response=?response); + types::RouterData::try_from(types::ResponseRouterData { + response, + data: data.clone(), + http_code: res.status_code, + }) + } + + fn get_error_response( + &self, + res: Response, + event_builder: Option<&mut ConnectorEvent>, + ) -> CustomResult<ErrorResponse, errors::ConnectorError> { + self.build_error_response(res, event_builder) + } +} + +impl ConnectorIntegration<api::PSync, types::PaymentsSyncData, types::PaymentsResponseData> + for Bamboraapac +{ + fn get_headers( + &self, + req: &types::PaymentsSyncRouterData, + connectors: &settings::Connectors, + ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> { + self.build_headers(req, connectors) + } + + fn get_content_type(&self) -> &'static str { + self.common_get_content_type() + } + + fn get_url( + &self, + _req: &types::PaymentsSyncRouterData, + _connectors: &settings::Connectors, + ) -> CustomResult<String, errors::ConnectorError> { + Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into()) + } + + fn build_request( + &self, + req: &types::PaymentsSyncRouterData, + connectors: &settings::Connectors, + ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + Ok(Some( + services::RequestBuilder::new() + .method(services::Method::Get) + .url(&types::PaymentsSyncType::get_url(self, req, connectors)?) + .attach_default_headers() + .headers(types::PaymentsSyncType::get_headers(self, req, connectors)?) + .build(), + )) + } + + fn handle_response( + &self, + data: &types::PaymentsSyncRouterData, + event_builder: Option<&mut ConnectorEvent>, + res: Response, + ) -> CustomResult<types::PaymentsSyncRouterData, errors::ConnectorError> { + let response: bamboraapac::BamboraapacPaymentsResponse = res + .response + .parse_struct("bamboraapac PaymentsSyncResponse") + .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; + event_builder.map(|i| i.set_response_body(&response)); + router_env::logger::info!(connector_response=?response); + types::RouterData::try_from(types::ResponseRouterData { + response, + data: data.clone(), + http_code: res.status_code, + }) + } + + fn get_error_response( + &self, + res: Response, + event_builder: Option<&mut ConnectorEvent>, + ) -> CustomResult<ErrorResponse, errors::ConnectorError> { + self.build_error_response(res, event_builder) + } +} + +impl ConnectorIntegration<api::Capture, types::PaymentsCaptureData, types::PaymentsResponseData> + for Bamboraapac +{ + fn get_headers( + &self, + req: &types::PaymentsCaptureRouterData, + connectors: &settings::Connectors, + ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> { + self.build_headers(req, connectors) + } + + fn get_content_type(&self) -> &'static str { + self.common_get_content_type() + } + + fn get_url( + &self, + _req: &types::PaymentsCaptureRouterData, + _connectors: &settings::Connectors, + ) -> CustomResult<String, errors::ConnectorError> { + Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into()) + } + + fn get_request_body( + &self, + _req: &types::PaymentsCaptureRouterData, + _connectors: &settings::Connectors, + ) -> CustomResult<RequestContent, errors::ConnectorError> { + Err(errors::ConnectorError::NotImplemented("get_request_body method".to_string()).into()) + } + + fn build_request( + &self, + req: &types::PaymentsCaptureRouterData, + connectors: &settings::Connectors, + ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + Ok(Some( + services::RequestBuilder::new() + .method(services::Method::Post) + .url(&types::PaymentsCaptureType::get_url(self, req, connectors)?) + .attach_default_headers() + .headers(types::PaymentsCaptureType::get_headers( + self, req, connectors, + )?) + .set_body(types::PaymentsCaptureType::get_request_body( + self, req, connectors, + )?) + .build(), + )) + } + + fn handle_response( + &self, + data: &types::PaymentsCaptureRouterData, + event_builder: Option<&mut ConnectorEvent>, + res: Response, + ) -> CustomResult<types::PaymentsCaptureRouterData, errors::ConnectorError> { + let response: bamboraapac::BamboraapacPaymentsResponse = res + .response + .parse_struct("Bamboraapac PaymentsCaptureResponse") + .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; + event_builder.map(|i| i.set_response_body(&response)); + router_env::logger::info!(connector_response=?response); + types::RouterData::try_from(types::ResponseRouterData { + response, + data: data.clone(), + http_code: res.status_code, + }) + } + + fn get_error_response( + &self, + res: Response, + event_builder: Option<&mut ConnectorEvent>, + ) -> CustomResult<ErrorResponse, errors::ConnectorError> { + self.build_error_response(res, event_builder) + } +} + +impl ConnectorIntegration<api::Void, types::PaymentsCancelData, types::PaymentsResponseData> + for Bamboraapac +{ +} + +impl ConnectorIntegration<api::Execute, types::RefundsData, types::RefundsResponseData> + for Bamboraapac +{ + fn get_headers( + &self, + req: &types::RefundsRouterData<api::Execute>, + connectors: &settings::Connectors, + ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> { + self.build_headers(req, connectors) + } + + fn get_content_type(&self) -> &'static str { + self.common_get_content_type() + } + + fn get_url( + &self, + _req: &types::RefundsRouterData<api::Execute>, + _connectors: &settings::Connectors, + ) -> CustomResult<String, errors::ConnectorError> { + Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into()) + } + + fn get_request_body( + &self, + req: &types::RefundsRouterData<api::Execute>, + _connectors: &settings::Connectors, + ) -> CustomResult<RequestContent, errors::ConnectorError> { + let refund_amount = connector_utils::convert_amount( + self.amount_converter, + req.request.minor_refund_amount, + req.request.currency, + )?; + + let connector_router_data = + bamboraapac::BamboraapacRouterData::try_from((refund_amount, req))?; + let connector_req = + bamboraapac::BamboraapacRefundRequest::try_from(&connector_router_data)?; + Ok(RequestContent::Json(Box::new(connector_req))) + } + + fn build_request( + &self, + req: &types::RefundsRouterData<api::Execute>, + connectors: &settings::Connectors, + ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + let request = services::RequestBuilder::new() + .method(services::Method::Post) + .url(&types::RefundExecuteType::get_url(self, req, connectors)?) + .attach_default_headers() + .headers(types::RefundExecuteType::get_headers( + self, req, connectors, + )?) + .set_body(types::RefundExecuteType::get_request_body( + self, req, connectors, + )?) + .build(); + Ok(Some(request)) + } + + fn handle_response( + &self, + data: &types::RefundsRouterData<api::Execute>, + event_builder: Option<&mut ConnectorEvent>, + res: Response, + ) -> CustomResult<types::RefundsRouterData<api::Execute>, errors::ConnectorError> { + let response: bamboraapac::RefundResponse = res + .response + .parse_struct("bamboraapac RefundResponse") + .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; + event_builder.map(|i| i.set_response_body(&response)); + router_env::logger::info!(connector_response=?response); + types::RouterData::try_from(types::ResponseRouterData { + response, + data: data.clone(), + http_code: res.status_code, + }) + } + + fn get_error_response( + &self, + res: Response, + event_builder: Option<&mut ConnectorEvent>, + ) -> CustomResult<ErrorResponse, errors::ConnectorError> { + self.build_error_response(res, event_builder) + } +} + +impl ConnectorIntegration<api::RSync, types::RefundsData, types::RefundsResponseData> + for Bamboraapac +{ + fn get_headers( + &self, + req: &types::RefundSyncRouterData, + connectors: &settings::Connectors, + ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> { + self.build_headers(req, connectors) + } + + fn get_content_type(&self) -> &'static str { + self.common_get_content_type() + } + + fn get_url( + &self, + _req: &types::RefundSyncRouterData, + _connectors: &settings::Connectors, + ) -> CustomResult<String, errors::ConnectorError> { + Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into()) + } + + fn build_request( + &self, + req: &types::RefundSyncRouterData, + connectors: &settings::Connectors, + ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + Ok(Some( + services::RequestBuilder::new() + .method(services::Method::Get) + .url(&types::RefundSyncType::get_url(self, req, connectors)?) + .attach_default_headers() + .headers(types::RefundSyncType::get_headers(self, req, connectors)?) + .set_body(types::RefundSyncType::get_request_body( + self, req, connectors, + )?) + .build(), + )) + } + + fn handle_response( + &self, + data: &types::RefundSyncRouterData, + event_builder: Option<&mut ConnectorEvent>, + res: Response, + ) -> CustomResult<types::RefundSyncRouterData, errors::ConnectorError> { + let response: bamboraapac::RefundResponse = res + .response + .parse_struct("bamboraapac RefundSyncResponse") + .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; + event_builder.map(|i| i.set_response_body(&response)); + router_env::logger::info!(connector_response=?response); + types::RouterData::try_from(types::ResponseRouterData { + response, + data: data.clone(), + http_code: res.status_code, + }) + } + + fn get_error_response( + &self, + res: Response, + event_builder: Option<&mut ConnectorEvent>, + ) -> CustomResult<ErrorResponse, errors::ConnectorError> { + self.build_error_response(res, event_builder) + } +} + +#[async_trait::async_trait] +impl api::IncomingWebhook for Bamboraapac { + fn get_webhook_object_reference_id( + &self, + _request: &api::IncomingWebhookRequestDetails<'_>, + ) -> CustomResult<api::webhooks::ObjectReferenceId, errors::ConnectorError> { + Err(report!(errors::ConnectorError::WebhooksNotImplemented)) + } + + fn get_webhook_event_type( + &self, + _request: &api::IncomingWebhookRequestDetails<'_>, + ) -> CustomResult<api::IncomingWebhookEvent, errors::ConnectorError> { + Err(report!(errors::ConnectorError::WebhooksNotImplemented)) + } + + fn get_webhook_resource_object( + &self, + _request: &api::IncomingWebhookRequestDetails<'_>, + ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> { + Err(report!(errors::ConnectorError::WebhooksNotImplemented)) + } +} diff --git a/crates/router/src/connector/bamboraapac/transformers.rs b/crates/router/src/connector/bamboraapac/transformers.rs new file mode 100644 index 00000000000..4d0e1a28ff7 --- /dev/null +++ b/crates/router/src/connector/bamboraapac/transformers.rs @@ -0,0 +1,234 @@ +use masking::Secret; +use serde::{Deserialize, Serialize}; + +use crate::{ + connector::utils::PaymentsAuthorizeRequestData, + core::errors, + types::{self, api, domain, storage::enums, MinorUnit}, +}; + +//TODO: Fill the struct with respective fields +pub struct BamboraapacRouterData<T> { + pub amount: MinorUnit, // The type of amount that a connector accepts, for example, String, i64, f64, etc. + pub router_data: T, +} + +impl<T> TryFrom<(MinorUnit, T)> for BamboraapacRouterData<T> { + type Error = error_stack::Report<errors::ConnectorError>; + fn try_from((amount, item): (MinorUnit, T)) -> Result<Self, Self::Error> { + //Todo : use utils to convert the amount to the type of amount that a connector accepts + Ok(Self { + amount, + router_data: item, + }) + } +} + +//TODO: Fill the struct with respective fields +#[derive(Default, Debug, Serialize, Eq, PartialEq)] +pub struct BamboraapacPaymentsRequest { + amount: MinorUnit, + card: BamboraapacCard, +} + +#[derive(Default, Debug, Serialize, Eq, PartialEq)] +pub struct BamboraapacCard { + number: cards::CardNumber, + expiry_month: Secret<String>, + expiry_year: Secret<String>, + cvc: Secret<String>, + complete: bool, +} + +impl TryFrom<&BamboraapacRouterData<&types::PaymentsAuthorizeRouterData>> + for BamboraapacPaymentsRequest +{ + type Error = error_stack::Report<errors::ConnectorError>; + fn try_from( + item: &BamboraapacRouterData<&types::PaymentsAuthorizeRouterData>, + ) -> Result<Self, Self::Error> { + match item.router_data.request.payment_method_data.clone() { + domain::PaymentMethodData::Card(req_card) => { + let card = BamboraapacCard { + number: req_card.card_number, + expiry_month: req_card.card_exp_month, + expiry_year: req_card.card_exp_year, + cvc: req_card.card_cvc, + complete: item.router_data.request.is_auto_capture()?, + }; + Ok(Self { + amount: item.amount.to_owned(), + card, + }) + } + _ => Err(errors::ConnectorError::NotImplemented("Payment methods".to_string()).into()), + } + } +} + +//TODO: Fill the struct with respective fields +// Auth Struct +pub struct BamboraapacAuthType { + pub(super) api_key: Secret<String>, +} + +impl TryFrom<&types::ConnectorAuthType> for BamboraapacAuthType { + type Error = error_stack::Report<errors::ConnectorError>; + fn try_from(auth_type: &types::ConnectorAuthType) -> Result<Self, Self::Error> { + match auth_type { + types::ConnectorAuthType::HeaderKey { api_key } => Ok(Self { + api_key: api_key.to_owned(), + }), + _ => Err(errors::ConnectorError::FailedToObtainAuthType.into()), + } + } +} +// PaymentsResponse +//TODO: Append the remaining status flags +#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq)] +#[serde(rename_all = "lowercase")] +pub enum BamboraapacPaymentStatus { + Succeeded, + Failed, + #[default] + Processing, +} + +impl From<BamboraapacPaymentStatus> for enums::AttemptStatus { + fn from(item: BamboraapacPaymentStatus) -> Self { + match item { + BamboraapacPaymentStatus::Succeeded => Self::Charged, + BamboraapacPaymentStatus::Failed => Self::Failure, + BamboraapacPaymentStatus::Processing => Self::Authorizing, + } + } +} + +//TODO: Fill the struct with respective fields +#[derive(Default, Debug, Clone, Serialize, Deserialize, PartialEq)] +pub struct BamboraapacPaymentsResponse { + status: BamboraapacPaymentStatus, + id: String, +} + +impl<F, T> + TryFrom< + types::ResponseRouterData<F, BamboraapacPaymentsResponse, T, types::PaymentsResponseData>, + > for types::RouterData<F, T, types::PaymentsResponseData> +{ + type Error = error_stack::Report<errors::ConnectorError>; + fn try_from( + item: types::ResponseRouterData< + F, + BamboraapacPaymentsResponse, + T, + types::PaymentsResponseData, + >, + ) -> Result<Self, Self::Error> { + Ok(Self { + status: enums::AttemptStatus::from(item.response.status), + response: Ok(types::PaymentsResponseData::TransactionResponse { + resource_id: types::ResponseId::ConnectorTransactionId(item.response.id), + redirection_data: None, + mandate_reference: None, + connector_metadata: None, + network_txn_id: None, + connector_response_reference_id: None, + incremental_authorization_allowed: None, + charge_id: None, + }), + ..item.data + }) + } +} + +//TODO: Fill the struct with respective fields +// REFUND : +// Type definition for RefundRequest +#[derive(Default, Debug, Serialize)] +pub struct BamboraapacRefundRequest { + pub amount: MinorUnit, +} + +impl<F> TryFrom<&BamboraapacRouterData<&types::RefundsRouterData<F>>> for BamboraapacRefundRequest { + type Error = error_stack::Report<errors::ConnectorError>; + fn try_from( + item: &BamboraapacRouterData<&types::RefundsRouterData<F>>, + ) -> Result<Self, Self::Error> { + Ok(Self { + amount: item.amount.to_owned(), + }) + } +} + +// Type definition for Refund Response + +#[allow(dead_code)] +#[derive(Debug, Serialize, Default, Deserialize, Clone)] +pub enum RefundStatus { + Succeeded, + Failed, + #[default] + Processing, +} + +impl From<RefundStatus> for enums::RefundStatus { + fn from(item: RefundStatus) -> Self { + match item { + RefundStatus::Succeeded => Self::Success, + RefundStatus::Failed => Self::Failure, + RefundStatus::Processing => Self::Pending, + //TODO: Review mapping + } + } +} + +//TODO: Fill the struct with respective fields +#[derive(Default, Debug, Clone, Serialize, Deserialize)] +pub struct RefundResponse { + id: String, + status: RefundStatus, +} + +impl TryFrom<types::RefundsResponseRouterData<api::Execute, RefundResponse>> + for types::RefundsRouterData<api::Execute> +{ + type Error = error_stack::Report<errors::ConnectorError>; + fn try_from( + item: types::RefundsResponseRouterData<api::Execute, RefundResponse>, + ) -> Result<Self, Self::Error> { + Ok(Self { + response: Ok(types::RefundsResponseData { + connector_refund_id: item.response.id.to_string(), + refund_status: enums::RefundStatus::from(item.response.status), + }), + ..item.data + }) + } +} + +impl TryFrom<types::RefundsResponseRouterData<api::RSync, RefundResponse>> + for types::RefundsRouterData<api::RSync> +{ + type Error = error_stack::Report<errors::ConnectorError>; + fn try_from( + item: types::RefundsResponseRouterData<api::RSync, RefundResponse>, + ) -> Result<Self, Self::Error> { + Ok(Self { + response: Ok(types::RefundsResponseData { + connector_refund_id: item.response.id.to_string(), + refund_status: enums::RefundStatus::from(item.response.status), + }), + ..item.data + }) + } +} + +//TODO: Fill the struct with respective fields +#[derive(Default, Debug, Serialize, Deserialize, PartialEq)] +pub struct BamboraapacErrorResponse { + pub status_code: u16, + pub code: String, + pub message: String, + pub reason: Option<String>, +} diff --git a/crates/router/src/core/admin.rs b/crates/router/src/core/admin.rs index c08eda6f03c..7d69b7f9971 100644 --- a/crates/router/src/core/admin.rs +++ b/crates/router/src/core/admin.rs @@ -1898,6 +1898,10 @@ pub(crate) fn validate_auth_and_metadata_type_with_connector( bambora::transformers::BamboraAuthType::try_from(val)?; Ok(()) } + // api_enums::Connector::Bamboraapac => { + // bamboraapac::transformers::BamboraapacAuthType::try_from(val)?; + // Ok(()) + // } api_enums::Connector::Boku => { boku::transformers::BokuAuthType::try_from(val)?; Ok(()) diff --git a/crates/router/src/core/payments/flows.rs b/crates/router/src/core/payments/flows.rs index aa5be3924a9..9ecd0c4c8a0 100644 --- a/crates/router/src/core/payments/flows.rs +++ b/crates/router/src/core/payments/flows.rs @@ -161,6 +161,7 @@ default_imp_for_complete_authorize!( connector::Adyenplatform, connector::Aci, connector::Adyen, + connector::Bamboraapac, connector::Billwerk, connector::Bitpay, connector::Boku, @@ -239,6 +240,7 @@ default_imp_for_webhook_source_verification!( connector::Airwallex, connector::Authorizedotnet, connector::Bambora, + connector::Bamboraapac, connector::Bankofamerica, connector::Billwerk, connector::Bitpay, @@ -331,6 +333,7 @@ default_imp_for_create_customer!( connector::Airwallex, connector::Authorizedotnet, connector::Bambora, + connector::Bamboraapac, connector::Bankofamerica, connector::Billwerk, connector::Bitpay, @@ -420,6 +423,7 @@ default_imp_for_connector_redirect_response!( connector::Adyenplatform, connector::Aci, connector::Adyen, + connector::Bamboraapac, connector::Bitpay, connector::Bankofamerica, connector::Billwerk, @@ -485,6 +489,7 @@ default_imp_for_connector_request_id!( connector::Airwallex, connector::Authorizedotnet, connector::Bambora, + connector::Bamboraapac, connector::Bankofamerica, connector::Billwerk, connector::Bitpay, @@ -578,6 +583,7 @@ default_imp_for_accept_dispute!( connector::Airwallex, connector::Authorizedotnet, connector::Bambora, + connector::Bamboraapac, connector::Bankofamerica, connector::Billwerk, connector::Bitpay, @@ -692,6 +698,7 @@ default_imp_for_file_upload!( connector::Airwallex, connector::Authorizedotnet, connector::Bambora, + connector::Bamboraapac, connector::Bankofamerica, connector::Billwerk, connector::Bitpay, @@ -783,6 +790,7 @@ default_imp_for_submit_evidence!( connector::Airwallex, connector::Authorizedotnet, connector::Bambora, + connector::Bamboraapac, connector::Bankofamerica, connector::Billwerk, connector::Bitpay, @@ -874,6 +882,7 @@ default_imp_for_defend_dispute!( connector::Airwallex, connector::Authorizedotnet, connector::Bambora, + connector::Bamboraapac, connector::Bankofamerica, connector::Billwerk, connector::Bitpay, @@ -964,6 +973,7 @@ default_imp_for_pre_processing_steps!( connector::Aci, connector::Authorizedotnet, connector::Bambora, + connector::Bamboraapac, connector::Billwerk, connector::Bitpay, connector::Bluesnap, @@ -1029,6 +1039,7 @@ default_imp_for_payouts!( connector::Airwallex, connector::Authorizedotnet, connector::Bambora, + connector::Bamboraapac, connector::Bankofamerica, connector::Billwerk, connector::Bitpay, @@ -1116,6 +1127,7 @@ default_imp_for_payouts_create!( connector::Airwallex, connector::Authorizedotnet, connector::Bambora, + connector::Bamboraapac, connector::Bankofamerica, connector::Billwerk, connector::Bitpay, @@ -1208,6 +1220,7 @@ default_imp_for_payouts_eligibility!( connector::Airwallex, connector::Authorizedotnet, connector::Bambora, + connector::Bamboraapac, connector::Bankofamerica, connector::Billwerk, connector::Bitpay, @@ -1298,6 +1311,7 @@ default_imp_for_payouts_fulfill!( connector::Airwallex, connector::Authorizedotnet, connector::Bambora, + connector::Bamboraapac, connector::Bankofamerica, connector::Billwerk, connector::Bitpay, @@ -1385,6 +1399,7 @@ default_imp_for_payouts_cancel!( connector::Airwallex, connector::Authorizedotnet, connector::Bambora, + connector::Bamboraapac, connector::Bankofamerica, connector::Billwerk, connector::Bitpay, @@ -1476,6 +1491,7 @@ default_imp_for_payouts_quote!( connector::Airwallex, connector::Authorizedotnet, connector::Bambora, + connector::Bamboraapac, connector::Bankofamerica, connector::Billwerk, connector::Bitpay, @@ -1568,6 +1584,7 @@ default_imp_for_payouts_recipient!( connector::Airwallex, connector::Authorizedotnet, connector::Bambora, + connector::Bamboraapac, connector::Bankofamerica, connector::Billwerk, connector::Bitpay, @@ -1662,6 +1679,7 @@ default_imp_for_payouts_recipient_account!( connector::Airwallex, connector::Authorizedotnet, connector::Bambora, + connector::Bamboraapac, connector::Bankofamerica, connector::Billwerk, connector::Bitpay, @@ -1754,6 +1772,7 @@ default_imp_for_approve!( connector::Airwallex, connector::Authorizedotnet, connector::Bambora, + connector::Bamboraapac, connector::Bankofamerica, connector::Billwerk, connector::Bitpay, @@ -1847,6 +1866,7 @@ default_imp_for_reject!( connector::Airwallex, connector::Authorizedotnet, connector::Bambora, + connector::Bamboraapac, connector::Bankofamerica, connector::Billwerk, connector::Bitpay, @@ -1924,6 +1944,7 @@ default_imp_for_fraud_check!( connector::Airwallex, connector::Authorizedotnet, connector::Bambora, + connector::Bamboraapac, connector::Bankofamerica, connector::Billwerk, connector::Bitpay, @@ -2017,6 +2038,7 @@ default_imp_for_frm_sale!( connector::Airwallex, connector::Authorizedotnet, connector::Bambora, + connector::Bamboraapac, connector::Bankofamerica, connector::Billwerk, connector::Bitpay, @@ -2110,6 +2132,7 @@ default_imp_for_frm_checkout!( connector::Airwallex, connector::Authorizedotnet, connector::Bambora, + connector::Bamboraapac, connector::Bankofamerica, connector::Billwerk, connector::Bitpay, @@ -2203,6 +2226,7 @@ default_imp_for_frm_transaction!( connector::Airwallex, connector::Authorizedotnet, connector::Bambora, + connector::Bamboraapac, connector::Bankofamerica, connector::Billwerk, connector::Bitpay, @@ -2296,6 +2320,7 @@ default_imp_for_frm_fulfillment!( connector::Airwallex, connector::Authorizedotnet, connector::Bambora, + connector::Bamboraapac, connector::Bankofamerica, connector::Billwerk, connector::Bitpay, @@ -2389,6 +2414,7 @@ default_imp_for_frm_record_return!( connector::Airwallex, connector::Authorizedotnet, connector::Bambora, + connector::Bamboraapac, connector::Bankofamerica, connector::Billwerk, connector::Bitpay, @@ -2480,6 +2506,7 @@ default_imp_for_incremental_authorization!( connector::Airwallex, connector::Authorizedotnet, connector::Bambora, + connector::Bamboraapac, connector::Bankofamerica, connector::Billwerk, connector::Bitpay, @@ -2570,6 +2597,7 @@ default_imp_for_revoking_mandates!( connector::Airwallex, connector::Authorizedotnet, connector::Bambora, + connector::Bamboraapac, connector::Bankofamerica, connector::Billwerk, connector::Bitpay, @@ -2720,6 +2748,7 @@ default_imp_for_connector_authentication!( connector::Airwallex, connector::Authorizedotnet, connector::Bambora, + connector::Bamboraapac, connector::Bankofamerica, connector::Billwerk, connector::Bitpay, @@ -2807,6 +2836,7 @@ default_imp_for_authorize_session_token!( connector::Airwallex, connector::Authorizedotnet, connector::Bambora, + connector::Bamboraapac, connector::Bankofamerica, connector::Billwerk, connector::Bitpay, diff --git a/crates/router/src/types/transformers.rs b/crates/router/src/types/transformers.rs index 894f0ee95a8..7c2e3fbd121 100644 --- a/crates/router/src/types/transformers.rs +++ b/crates/router/src/types/transformers.rs @@ -217,6 +217,7 @@ impl ForeignTryFrom<api_enums::Connector> for common_enums::RoutableConnectors { api_enums::Connector::Airwallex => Self::Airwallex, api_enums::Connector::Authorizedotnet => Self::Authorizedotnet, api_enums::Connector::Bambora => Self::Bambora, + // api_enums::Connector::Bamboraapac => Self::Bamboraapac, commented for template api_enums::Connector::Bankofamerica => Self::Bankofamerica, api_enums::Connector::Billwerk => Self::Billwerk, api_enums::Connector::Bitpay => Self::Bitpay, diff --git a/crates/router/tests/connectors/bamboraapac.rs b/crates/router/tests/connectors/bamboraapac.rs new file mode 100644 index 00000000000..d631dd10f1c --- /dev/null +++ b/crates/router/tests/connectors/bamboraapac.rs @@ -0,0 +1,420 @@ +use masking::Secret; +use router::types::{self, api, domain, storage::enums}; +use test_utils::connector_auth; + +use crate::utils::{self, ConnectorActions}; + +#[derive(Clone, Copy)] +struct BamboraapacTest; +impl ConnectorActions for BamboraapacTest {} +impl utils::Connector for BamboraapacTest { + fn get_data(&self) -> api::ConnectorData { + use router::connector::Adyen; + utils::construct_connector_data_old( + Box::new(&Adyen), + types::Connector::Adyen, + api::GetToken::Connector, + None, + ) + } + + fn get_auth_token(&self) -> types::ConnectorAuthType { + utils::to_connector_auth_type( + connector_auth::ConnectorAuthentication::new() + .bamboraapac + .expect("Missing connector authentication configuration") + .into(), + ) + } + + fn get_name(&self) -> String { + "bamboraapac".to_string() + } +} + +static CONNECTOR: BamboraapacTest = BamboraapacTest {}; + +fn get_default_payment_info() -> Option<utils::PaymentInfo> { + None +} + +fn payment_method_details() -> Option<types::PaymentsAuthorizeData> { + None +} + +// Cards Positive Tests +// Creates a payment using the manual capture flow (Non 3DS). +#[actix_web::test] +async fn should_only_authorize_payment() { + let response = CONNECTOR + .authorize_payment(payment_method_details(), get_default_payment_info()) + .await + .expect("Authorize payment response"); + assert_eq!(response.status, enums::AttemptStatus::Authorized); +} + +// Captures a payment using the manual capture flow (Non 3DS). +#[actix_web::test] +async fn should_capture_authorized_payment() { + let response = CONNECTOR + .authorize_and_capture_payment(payment_method_details(), None, get_default_payment_info()) + .await + .expect("Capture payment response"); + assert_eq!(response.status, enums::AttemptStatus::Charged); +} + +// Partially captures a payment using the manual capture flow (Non 3DS). +#[actix_web::test] +async fn should_partially_capture_authorized_payment() { + let response = CONNECTOR + .authorize_and_capture_payment( + payment_method_details(), + Some(types::PaymentsCaptureData { + amount_to_capture: 50, + ..utils::PaymentCaptureType::default().0 + }), + get_default_payment_info(), + ) + .await + .expect("Capture payment response"); + assert_eq!(response.status, enums::AttemptStatus::Charged); +} + +// Synchronizes a payment using the manual capture flow (Non 3DS). +#[actix_web::test] +async fn should_sync_authorized_payment() { + let authorize_response = CONNECTOR + .authorize_payment(payment_method_details(), get_default_payment_info()) + .await + .expect("Authorize payment response"); + let txn_id = utils::get_connector_transaction_id(authorize_response.response); + let response = CONNECTOR + .psync_retry_till_status_matches( + enums::AttemptStatus::Authorized, + Some(types::PaymentsSyncData { + connector_transaction_id: types::ResponseId::ConnectorTransactionId( + txn_id.unwrap(), + ), + ..Default::default() + }), + get_default_payment_info(), + ) + .await + .expect("PSync response"); + assert_eq!(response.status, enums::AttemptStatus::Authorized,); +} + +// Voids a payment using the manual capture flow (Non 3DS). +#[actix_web::test] +async fn should_void_authorized_payment() { + let response = CONNECTOR + .authorize_and_void_payment( + payment_method_details(), + Some(types::PaymentsCancelData { + connector_transaction_id: String::from(""), + cancellation_reason: Some("requested_by_customer".to_string()), + ..Default::default() + }), + get_default_payment_info(), + ) + .await + .expect("Void payment response"); + assert_eq!(response.status, enums::AttemptStatus::Voided); +} + +// Refunds a payment using the manual capture flow (Non 3DS). +#[actix_web::test] +async fn should_refund_manually_captured_payment() { + let response = CONNECTOR + .capture_payment_and_refund( + payment_method_details(), + None, + None, + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!( + response.response.unwrap().refund_status, + enums::RefundStatus::Success, + ); +} + +// Partially refunds a payment using the manual capture flow (Non 3DS). +#[actix_web::test] +async fn should_partially_refund_manually_captured_payment() { + let response = CONNECTOR + .capture_payment_and_refund( + payment_method_details(), + None, + Some(types::RefundsData { + refund_amount: 50, + ..utils::PaymentRefundType::default().0 + }), + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!( + response.response.unwrap().refund_status, + enums::RefundStatus::Success, + ); +} + +// Synchronizes a refund using the manual capture flow (Non 3DS). +#[actix_web::test] +async fn should_sync_manually_captured_refund() { + let refund_response = CONNECTOR + .capture_payment_and_refund( + payment_method_details(), + None, + None, + get_default_payment_info(), + ) + .await + .unwrap(); + let response = CONNECTOR + .rsync_retry_till_status_matches( + enums::RefundStatus::Success, + refund_response.response.unwrap().connector_refund_id, + None, + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!( + response.response.unwrap().refund_status, + enums::RefundStatus::Success, + ); +} + +// Creates a payment using the automatic capture flow (Non 3DS). +#[actix_web::test] +async fn should_make_payment() { + let authorize_response = CONNECTOR + .make_payment(payment_method_details(), get_default_payment_info()) + .await + .unwrap(); + assert_eq!(authorize_response.status, enums::AttemptStatus::Charged); +} + +// Synchronizes a payment using the automatic capture flow (Non 3DS). +#[actix_web::test] +async fn should_sync_auto_captured_payment() { + let authorize_response = CONNECTOR + .make_payment(payment_method_details(), get_default_payment_info()) + .await + .unwrap(); + assert_eq!(authorize_response.status, enums::AttemptStatus::Charged); + let txn_id = utils::get_connector_transaction_id(authorize_response.response); + assert_ne!(txn_id, None, "Empty connector transaction id"); + let response = CONNECTOR + .psync_retry_till_status_matches( + enums::AttemptStatus::Charged, + Some(types::PaymentsSyncData { + connector_transaction_id: types::ResponseId::ConnectorTransactionId( + txn_id.unwrap(), + ), + capture_method: Some(enums::CaptureMethod::Automatic), + ..Default::default() + }), + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!(response.status, enums::AttemptStatus::Charged,); +} + +// Refunds a payment using the automatic capture flow (Non 3DS). +#[actix_web::test] +async fn should_refund_auto_captured_payment() { + let response = CONNECTOR + .make_payment_and_refund(payment_method_details(), None, get_default_payment_info()) + .await + .unwrap(); + assert_eq!( + response.response.unwrap().refund_status, + enums::RefundStatus::Success, + ); +} + +// Partially refunds a payment using the automatic capture flow (Non 3DS). +#[actix_web::test] +async fn should_partially_refund_succeeded_payment() { + let refund_response = CONNECTOR + .make_payment_and_refund( + payment_method_details(), + Some(types::RefundsData { + refund_amount: 50, + ..utils::PaymentRefundType::default().0 + }), + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!( + refund_response.response.unwrap().refund_status, + enums::RefundStatus::Success, + ); +} + +// Creates multiple refunds against a payment using the automatic capture flow (Non 3DS). +#[actix_web::test] +async fn should_refund_succeeded_payment_multiple_times() { + CONNECTOR + .make_payment_and_multiple_refund( + payment_method_details(), + Some(types::RefundsData { + refund_amount: 50, + ..utils::PaymentRefundType::default().0 + }), + get_default_payment_info(), + ) + .await; +} + +// Synchronizes a refund using the automatic capture flow (Non 3DS). +#[actix_web::test] +async fn should_sync_refund() { + let refund_response = CONNECTOR + .make_payment_and_refund(payment_method_details(), None, get_default_payment_info()) + .await + .unwrap(); + let response = CONNECTOR + .rsync_retry_till_status_matches( + enums::RefundStatus::Success, + refund_response.response.unwrap().connector_refund_id, + None, + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!( + response.response.unwrap().refund_status, + enums::RefundStatus::Success, + ); +} + +// Cards Negative scenarios +// Creates a payment with incorrect CVC. +#[actix_web::test] +async fn should_fail_payment_for_incorrect_cvc() { + let response = CONNECTOR + .make_payment( + Some(types::PaymentsAuthorizeData { + payment_method_data: domain::PaymentMethodData::Card(domain::Card { + card_cvc: Secret::new("12345".to_string()), + ..utils::CCardType::default().0 + }), + ..utils::PaymentAuthorizeType::default().0 + }), + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!( + response.response.unwrap_err().message, + "Your card's security code is invalid.".to_string(), + ); +} + +// Creates a payment with incorrect expiry month. +#[actix_web::test] +async fn should_fail_payment_for_invalid_exp_month() { + let response = CONNECTOR + .make_payment( + Some(types::PaymentsAuthorizeData { + payment_method_data: domain::PaymentMethodData::Card(domain::Card { + card_exp_month: Secret::new("20".to_string()), + ..utils::CCardType::default().0 + }), + ..utils::PaymentAuthorizeType::default().0 + }), + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!( + response.response.unwrap_err().message, + "Your card's expiration month is invalid.".to_string(), + ); +} + +// Creates a payment with incorrect expiry year. +#[actix_web::test] +async fn should_fail_payment_for_incorrect_expiry_year() { + let response = CONNECTOR + .make_payment( + Some(types::PaymentsAuthorizeData { + payment_method_data: domain::PaymentMethodData::Card(domain::Card { + card_exp_year: Secret::new("2000".to_string()), + ..utils::CCardType::default().0 + }), + ..utils::PaymentAuthorizeType::default().0 + }), + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!( + response.response.unwrap_err().message, + "Your card's expiration year is invalid.".to_string(), + ); +} + +// Voids a payment using automatic capture flow (Non 3DS). +#[actix_web::test] +async fn should_fail_void_payment_for_auto_capture() { + let authorize_response = CONNECTOR + .make_payment(payment_method_details(), get_default_payment_info()) + .await + .unwrap(); + assert_eq!(authorize_response.status, enums::AttemptStatus::Charged); + let txn_id = utils::get_connector_transaction_id(authorize_response.response); + assert_ne!(txn_id, None, "Empty connector transaction id"); + let void_response = CONNECTOR + .void_payment(txn_id.unwrap(), None, get_default_payment_info()) + .await + .unwrap(); + assert_eq!( + void_response.response.unwrap_err().message, + "You cannot cancel this PaymentIntent because it has a status of succeeded." + ); +} + +// Captures a payment using invalid connector payment id. +#[actix_web::test] +async fn should_fail_capture_for_invalid_payment() { + let capture_response = CONNECTOR + .capture_payment("123456789".to_string(), None, get_default_payment_info()) + .await + .unwrap(); + assert_eq!( + capture_response.response.unwrap_err().message, + String::from("No such payment_intent: '123456789'") + ); +} + +// Refunds a payment with refund amount higher than payment amount. +#[actix_web::test] +async fn should_fail_for_refund_amount_higher_than_payment_amount() { + let response = CONNECTOR + .make_payment_and_refund( + payment_method_details(), + Some(types::RefundsData { + refund_amount: 150, + ..utils::PaymentRefundType::default().0 + }), + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!( + response.response.unwrap_err().message, + "Refund amount (₹1.50) is greater than charge amount (₹1.00)", + ); +} + +// Connector dependent test cases goes here + +// [#478]: add unit tests for non 3DS, wallets & webhooks in connector tests diff --git a/crates/router/tests/connectors/main.rs b/crates/router/tests/connectors/main.rs index ad19a54bbda..a3c7ba5691a 100644 --- a/crates/router/tests/connectors/main.rs +++ b/crates/router/tests/connectors/main.rs @@ -12,6 +12,7 @@ mod adyenplatform; mod airwallex; mod authorizedotnet; mod bambora; +mod bamboraapac; #[cfg(feature = "dummy_connector")] mod bankofamerica; #[cfg(feature = "dummy_connector")] diff --git a/crates/router/tests/connectors/sample_auth.toml b/crates/router/tests/connectors/sample_auth.toml index 655e7c665ae..ecebbbc4fa0 100644 --- a/crates/router/tests/connectors/sample_auth.toml +++ b/crates/router/tests/connectors/sample_auth.toml @@ -236,3 +236,7 @@ api_key="API Key" [datatrans] api_key="API Key" + + +[bamboraapac] +api_key="API Key" diff --git a/crates/test_utils/src/connector_auth.rs b/crates/test_utils/src/connector_auth.rs index aafccbff438..9e09c2818f5 100644 --- a/crates/test_utils/src/connector_auth.rs +++ b/crates/test_utils/src/connector_auth.rs @@ -19,6 +19,7 @@ pub struct ConnectorAuthentication { pub airwallex: Option<BodyKey>, pub authorizedotnet: Option<BodyKey>, pub bambora: Option<BodyKey>, + pub bamboraapac: Option<HeaderKey>, pub bankofamerica: Option<SignatureKey>, pub billwerk: Option<HeaderKey>, pub bitpay: Option<HeaderKey>, diff --git a/loadtest/config/development.toml b/loadtest/config/development.toml index cfe4a99e156..ce0ac53fdec 100644 --- a/loadtest/config/development.toml +++ b/loadtest/config/development.toml @@ -77,6 +77,7 @@ airwallex.base_url = "https://api-demo.airwallex.com/" applepay.base_url = "https://apple-pay-gateway.apple.com/" authorizedotnet.base_url = "https://apitest.authorize.net/xml/v1/request.api" bambora.base_url = "https://api.na.bambora.com" +bamboraapac.base_url = "https://demo.bambora.co.nz/interface/api/dts.asmx" bankofamerica.base_url = "https://apitest.merchant-services.bankofamerica.com/" billwerk.base_url = "https://api.reepay.com/" billwerk.secondary_base_url = "https://card.reepay.com/" @@ -159,6 +160,7 @@ cards = [ "airwallex", "authorizedotnet", "bambora", + "bamboraapac", "bankofamerica", "billwerk", "bitpay", diff --git a/scripts/add_connector.sh b/scripts/add_connector.sh index f4b4fc87578..df25077afa5 100755 --- a/scripts/add_connector.sh +++ b/scripts/add_connector.sh @@ -6,7 +6,7 @@ function find_prev_connector() { git checkout $self cp $self $self.tmp # Add new connector to existing list and sort it - connectors=(aci adyen adyenplatform airwallex applepay authorizedotnet bambora bankofamerica billwerk bitpay bluesnap boku braintree cashtocode checkout coinbase cryptopay cybersource datatrans dlocal dummyconnector ebanx fiserv forte globalpay globepay gocardless gpayments helcim iatapay klarna mifinity mollie multisafepay netcetera nexinets noon nuvei opayo opennode payeezy payme payone paypal payu placetopay powertranz prophetpay rapyd shift4 square stax stripe threedsecureio trustpay tsys volt wise worldline worldpay zsl "$1") + connectors=(aci adyen adyenplatform airwallex applepay authorizedotnet bambora bamboraapac bankofamerica billwerk bitpay bluesnap boku braintree cashtocode checkout coinbase cryptopay cybersource datatrans dlocal dummyconnector ebanx fiserv forte globalpay globepay gocardless gpayments helcim iatapay klarna mifinity mollie multisafepay netcetera nexinets noon nuvei opayo opennode payeezy payme payone paypal payu placetopay powertranz prophetpay rapyd shift4 square stax stripe threedsecureio trustpay tsys volt wise worldline worldpay zsl "$1") IFS=$'\n' sorted=($(sort <<<"${connectors[*]}")); unset IFS res=`echo ${sorted[@]}` sed -i'' -e "s/^ connectors=.*/ connectors=($res \"\$1\")/" $self.tmp
feat
[Bambora Apac] Template for integration (#5062)
4585e16245dd49d8c0b877cda148524afe395009
2024-08-27 13:34:17
Sarthak Soni
refactor(open_banking): Added merchant data update in mca update (#5655)
false
diff --git a/api-reference-v2/openapi_spec.json b/api-reference-v2/openapi_spec.json index e637e70b811..48739ac77f9 100644 --- a/api-reference-v2/openapi_spec.json +++ b/api-reference-v2/openapi_spec.json @@ -9024,6 +9024,14 @@ "example": "y3oqhf46pyzuxjbcn2giaqnb44", "maxLength": 64, "minLength": 1 + }, + "additional_merchant_data": { + "allOf": [ + { + "$ref": "#/components/schemas/AdditionalMerchantData" + } + ], + "nullable": true } }, "additionalProperties": false diff --git a/api-reference/openapi_spec.json b/api-reference/openapi_spec.json index a23e7093a2c..e08644d778f 100644 --- a/api-reference/openapi_spec.json +++ b/api-reference/openapi_spec.json @@ -13201,6 +13201,14 @@ }, "status": { "$ref": "#/components/schemas/ConnectorStatus" + }, + "additional_merchant_data": { + "allOf": [ + { + "$ref": "#/components/schemas/AdditionalMerchantData" + } + ], + "nullable": true } }, "additionalProperties": false diff --git a/crates/api_models/src/admin.rs b/crates/api_models/src/admin.rs index 8ef5d371aa1..55a2444973d 100644 --- a/crates/api_models/src/admin.rs +++ b/crates/api_models/src/admin.rs @@ -1556,6 +1556,10 @@ pub struct MerchantConnectorUpdate { #[schema(value_type = ConnectorStatus, example = "inactive")] pub status: Option<api_enums::ConnectorStatus>, + + /// In case the merchant needs to store any additional sensitive data + #[schema(value_type = Option<AdditionalMerchantData>)] + pub additional_merchant_data: Option<AdditionalMerchantData>, } /// Create a new Merchant Connector for the merchant account. The connector could be a payment processor / facilitator / acquirer or specialized services like Fraud / Accounting etc." @@ -1637,6 +1641,10 @@ pub struct MerchantConnectorUpdate { /// The identifier for the Merchant Account #[schema(value_type = String, max_length = 64, min_length = 1, example = "y3oqhf46pyzuxjbcn2giaqnb44")] pub merchant_id: id_type::MerchantId, + + /// In case the merchant needs to store any additional sensitive data + #[schema(value_type = Option<AdditionalMerchantData>)] + pub additional_merchant_data: Option<AdditionalMerchantData>, } #[cfg(all(feature = "v2", feature = "merchant_connector_account_v2"))] diff --git a/crates/diesel_models/src/merchant_connector_account.rs b/crates/diesel_models/src/merchant_connector_account.rs index 61f2af238ed..e674b9b7587 100644 --- a/crates/diesel_models/src/merchant_connector_account.rs +++ b/crates/diesel_models/src/merchant_connector_account.rs @@ -203,6 +203,7 @@ pub struct MerchantConnectorAccountUpdateInternal { pub pm_auth_config: Option<pii::SecretSerdeValue>, pub status: Option<storage_enums::ConnectorStatus>, pub connector_wallets_details: Option<Encryption>, + pub additional_merchant_data: Option<Encryption>, } #[cfg(all(feature = "v2", feature = "merchant_connector_account_v2"))] @@ -224,6 +225,7 @@ pub struct MerchantConnectorAccountUpdateInternal { pub pm_auth_config: Option<pii::SecretSerdeValue>, pub status: Option<storage_enums::ConnectorStatus>, pub connector_wallets_details: Option<Encryption>, + pub additional_merchant_data: Option<Encryption>, } #[cfg(all( diff --git a/crates/hyperswitch_domain_models/src/merchant_connector_account.rs b/crates/hyperswitch_domain_models/src/merchant_connector_account.rs index 76b7cd4a85a..a841e2d1507 100644 --- a/crates/hyperswitch_domain_models/src/merchant_connector_account.rs +++ b/crates/hyperswitch_domain_models/src/merchant_connector_account.rs @@ -109,6 +109,7 @@ pub enum MerchantConnectorAccountUpdate { connector_label: Option<String>, status: Option<enums::ConnectorStatus>, connector_wallets_details: Option<Encryptable<pii::SecretSerdeValue>>, + additional_merchant_data: Option<Encryptable<pii::SecretSerdeValue>>, }, ConnectorWalletDetailsUpdate { connector_wallets_details: Encryptable<pii::SecretSerdeValue>, @@ -131,6 +132,7 @@ pub enum MerchantConnectorAccountUpdate { connector_label: Option<String>, status: Option<enums::ConnectorStatus>, connector_wallets_details: Option<Encryptable<pii::SecretSerdeValue>>, + additional_merchant_data: Option<Encryptable<pii::SecretSerdeValue>>, }, ConnectorWalletDetailsUpdate { connector_wallets_details: Encryptable<pii::SecretSerdeValue>, @@ -453,6 +455,7 @@ impl From<MerchantConnectorAccountUpdate> for MerchantConnectorAccountUpdateInte connector_label, status, connector_wallets_details, + additional_merchant_data, } => Self { connector_type, connector_name, @@ -471,6 +474,7 @@ impl From<MerchantConnectorAccountUpdate> for MerchantConnectorAccountUpdateInte connector_label, status, connector_wallets_details: connector_wallets_details.map(Encryption::from), + additional_merchant_data: additional_merchant_data.map(Encryption::from), }, MerchantConnectorAccountUpdate::ConnectorWalletDetailsUpdate { connector_wallets_details, @@ -492,6 +496,7 @@ impl From<MerchantConnectorAccountUpdate> for MerchantConnectorAccountUpdateInte applepay_verified_domains: None, pm_auth_config: None, status: None, + additional_merchant_data: None, }, } } @@ -514,6 +519,7 @@ impl From<MerchantConnectorAccountUpdate> for MerchantConnectorAccountUpdateInte connector_label, status, connector_wallets_details, + additional_merchant_data, } => Self { connector_type, connector_account_details: connector_account_details.map(Encryption::from), @@ -528,6 +534,7 @@ impl From<MerchantConnectorAccountUpdate> for MerchantConnectorAccountUpdateInte connector_label, status, connector_wallets_details: connector_wallets_details.map(Encryption::from), + additional_merchant_data: additional_merchant_data.map(Encryption::from), }, MerchantConnectorAccountUpdate::ConnectorWalletDetailsUpdate { connector_wallets_details, @@ -545,6 +552,7 @@ impl From<MerchantConnectorAccountUpdate> for MerchantConnectorAccountUpdateInte applepay_verified_domains: None, pm_auth_config: None, status: None, + additional_merchant_data: None, }, } } diff --git a/crates/router/src/core/admin.rs b/crates/router/src/core/admin.rs index f78d5dca2e0..553de8c5608 100644 --- a/crates/router/src/core/admin.rs +++ b/crates/router/src/core/admin.rs @@ -2080,6 +2080,30 @@ impl MerchantConnectorAccountUpdateBridge for api_models::admin::MerchantConnect pm_auth_config_validation.validate_pm_auth_config().await?; + let merchant_recipient_data = if let Some(data) = &self.additional_merchant_data { + Some( + process_open_banking_connectors( + state, + merchant_account.get_id(), + &auth, + &self.connector_type, + &connector_enum, + types::AdditionalMerchantData::foreign_from(data.clone()), + ) + .await?, + ) + } else { + None + } + .map(|data| { + serde_json::to_value(types::AdditionalMerchantData::OpenBankingRecipientData( + data, + )) + }) + .transpose() + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("Failed to serialize MerchantRecipientData")?; + Ok(storage::MerchantConnectorAccountUpdate::Update { connector_type: Some(self.connector_type), connector_label: self.connector_label.clone(), @@ -2114,6 +2138,23 @@ impl MerchantConnectorAccountUpdateBridge for api_models::admin::MerchantConnect applepay_verified_domains: None, pm_auth_config: self.pm_auth_config, status: Some(connector_status), + additional_merchant_data: if let Some(mcd) = merchant_recipient_data { + Some( + domain_types::crypto_operation( + key_manager_state, + type_name!(domain::MerchantConnectorAccount), + domain_types::CryptoOperation::Encrypt(Secret::new(mcd)), + km_types::Identifier::Merchant(key_store.merchant_id.clone()), + key_store.key.peek(), + ) + .await + .and_then(|val| val.try_into_operation()) + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("Unable to encrypt additional_merchant_data")?, + ) + } else { + None + }, connector_wallets_details: helpers::get_encrypted_apple_pay_connector_wallets_details( state, &key_store, &metadata, ) @@ -2216,6 +2257,30 @@ impl MerchantConnectorAccountUpdateBridge for api_models::admin::MerchantConnect } } + let merchant_recipient_data = if let Some(data) = &self.additional_merchant_data { + Some( + process_open_banking_connectors( + state, + merchant_account.get_id(), + &auth, + &self.connector_type, + &connector_enum, + types::AdditionalMerchantData::foreign_from(data.clone()), + ) + .await?, + ) + } else { + None + } + .map(|data| { + serde_json::to_value(types::AdditionalMerchantData::OpenBankingRecipientData( + data, + )) + }) + .transpose() + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("Failed to serialize MerchantRecipientData")?; + Ok(storage::MerchantConnectorAccountUpdate::Update { connector_type: Some(self.connector_type), connector_name: None, @@ -2253,6 +2318,23 @@ impl MerchantConnectorAccountUpdateBridge for api_models::admin::MerchantConnect applepay_verified_domains: None, pm_auth_config: self.pm_auth_config, status: Some(connector_status), + additional_merchant_data: if let Some(mcd) = merchant_recipient_data { + Some( + domain_types::crypto_operation( + key_manager_state, + type_name!(domain::MerchantConnectorAccount), + domain_types::CryptoOperation::Encrypt(Secret::new(mcd)), + km_types::Identifier::Merchant(key_store.merchant_id.clone()), + key_store.key.peek(), + ) + .await + .and_then(|val| val.try_into_operation()) + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("Unable to encrypt additional_merchant_data")?, + ) + } else { + None + }, connector_wallets_details: helpers::get_encrypted_apple_pay_connector_wallets_details( state, &key_store, &metadata, ) @@ -2349,7 +2431,7 @@ impl MerchantConnectorAccountCreateBridge for api::MerchantConnectorCreate { }) .transpose() .change_context(errors::ApiErrorResponse::InternalServerError) - .attach_printable("Failed to get MerchantRecipientData")?; + .attach_printable("Failed to serialize MerchantRecipientData")?; Ok(domain::MerchantConnectorAccount { merchant_id: business_profile.merchant_id.clone(), connector_type: self.connector_type, @@ -2398,7 +2480,7 @@ impl MerchantConnectorAccountCreateBridge for api::MerchantConnectorCreate { key_manager_state, type_name!(domain::MerchantConnectorAccount), domain_types::CryptoOperation::Encrypt(Secret::new(mcd)), - identifier, + km_types::Identifier::Merchant(key_store.merchant_id.clone()), key_store.key.peek(), ) .await @@ -2518,7 +2600,7 @@ impl MerchantConnectorAccountCreateBridge for api::MerchantConnectorCreate { }) .transpose() .change_context(errors::ApiErrorResponse::InternalServerError) - .attach_printable("Failed to get MerchantRecipientData")?; + .attach_printable("Failed to serialize MerchantRecipientData")?; Ok(domain::MerchantConnectorAccount { merchant_id: business_profile.merchant_id.clone(), connector_type: self.connector_type, diff --git a/crates/router/src/core/connector_onboarding/paypal.rs b/crates/router/src/core/connector_onboarding/paypal.rs index 13b2bf16cdb..f967f2aece3 100644 --- a/crates/router/src/core/connector_onboarding/paypal.rs +++ b/crates/router/src/core/connector_onboarding/paypal.rs @@ -164,6 +164,7 @@ pub async fn update_mca( connector_webhook_details: None, pm_auth_config: None, test_mode: None, + additional_merchant_data: None, }; #[cfg(all(feature = "v2", feature = "merchant_connector_account_v2"))] let request = MerchantConnectorUpdate { @@ -178,6 +179,7 @@ pub async fn update_mca( connector_webhook_details: None, pm_auth_config: None, merchant_id: merchant_id.clone(), + additional_merchant_data: None, }; let mca_response = admin::update_connector(state.clone(), &merchant_id, None, &connector_id, request).await?; diff --git a/crates/router/src/core/verification/utils.rs b/crates/router/src/core/verification/utils.rs index 4b8e0ac0748..c4fbf7ab081 100644 --- a/crates/router/src/core/verification/utils.rs +++ b/crates/router/src/core/verification/utils.rs @@ -87,6 +87,7 @@ pub async fn check_existence_and_add_domain_to_db( connector_label: None, status: None, connector_wallets_details: None, + additional_merchant_data: None, }; #[cfg(all(feature = "v2", feature = "merchant_connector_account_v2"))] let updated_mca = storage::MerchantConnectorAccountUpdate::Update { @@ -102,6 +103,7 @@ pub async fn check_existence_and_add_domain_to_db( connector_label: None, status: None, connector_wallets_details: None, + additional_merchant_data: None, }; state .store
refactor
Added merchant data update in mca update (#5655)
b1e3e7510b1dd959dc0dd2cd1f036435d10c5102
2023-07-25 12:12:01
github-actions
chore(version): v1.10.2
false
diff --git a/CHANGELOG.md b/CHANGELOG.md index bb920c5fb10..aaaf500f853 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,21 @@ All notable changes to HyperSwitch will be documented here. - - - +## 1.10.2 (2023-07-25) + +### Bug Fixes + +- **connector:** [Paypal] fix amount to its currency base unit ([#1780](https://github.com/juspay/hyperswitch/pull/1780)) ([`f40d144`](https://github.com/juspay/hyperswitch/commit/f40d1441787977b911f72abe3d9112e4c25817d0)) + +### Revert + +- Connector_label in webhook url is reverted back to connector_name ([#1779](https://github.com/juspay/hyperswitch/pull/1779)) ([`a229c37`](https://github.com/juspay/hyperswitch/commit/a229c37a7cd71fbbd73b4aa1378d1d326cb3bbe8)) + +**Full Changelog:** [`v1.10.1...v1.10.2`](https://github.com/juspay/hyperswitch/compare/v1.10.1...v1.10.2) + +- - - + + ## 1.10.1 (2023-07-25) ### Bug Fixes
chore
v1.10.2
d424b1cf3cf0ddec0de8e3510a3e1d41874b4c64
2023-01-24 23:01:18
Nishant Joshi
fix: off-session must exist only if mandate is external (#460)
false
diff --git a/crates/router/src/connector/stripe/transformers.rs b/crates/router/src/connector/stripe/transformers.rs index b58bc6dec6c..2d7ef4a24c6 100644 --- a/crates/router/src/connector/stripe/transformers.rs +++ b/crates/router/src/connector/stripe/transformers.rs @@ -244,6 +244,11 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for PaymentIntentRequest { None => Address::default(), }; + let off_session = item + .request + .off_session + .and_then(|value| mandate.as_ref().map(|_| value)); + Ok(Self { amount: item.request.amount, //hopefully we don't loose some cents here currency: item.request.currency.to_string(), //we need to copy the value and not transfer ownership @@ -258,10 +263,10 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for PaymentIntentRequest { confirm: true, // Stripe requires confirm to be true if return URL is present description: item.description.clone(), - off_session: item.request.off_session, shipping: shipping_address, capture_method: StripeCaptureMethod::from(item.request.capture_method), payment_data, + off_session, mandate, }) }
fix
off-session must exist only if mandate is external (#460)
800da6a16a3d05ff5ae0b5557c80f7784e81a749
2024-08-26 12:19:54
Narayan Bhat
refactor(payments_response): remove setter from payments response (#5676)
false
diff --git a/api-reference-v2/openapi_spec.json b/api-reference-v2/openapi_spec.json index 0505dd498e3..275a2716164 100644 --- a/api-reference-v2/openapi_spec.json +++ b/api-reference-v2/openapi_spec.json @@ -11712,11 +11712,12 @@ "PaymentsCreateResponseOpenApi": { "type": "object", "required": [ + "payment_id", + "merchant_id", "status", "amount", "net_amount", "amount_capturable", - "amount_received", "currency", "payment_method", "attempt_count" @@ -11726,7 +11727,6 @@ "type": "string", "description": "Unique identifier for the payment. This ensures idempotency for multiple payments\nthat have been done by a single merchant.", "example": "pay_mbabizu24mvu3mela5njyhpit4", - "nullable": true, "maxLength": 30, "minLength": 30 }, @@ -11734,7 +11734,6 @@ "type": "string", "description": "This is an identifier for the merchant account. This is inferred from the API key\nprovided during the request", "example": "merchant_1668273825", - "nullable": true, "maxLength": 255 }, "status": { @@ -11768,7 +11767,8 @@ "type": "integer", "format": "int64", "description": "The amount which is already captured from the payment, this helps in the cases where merchants can't capture all capturable amount at once.", - "example": 6540 + "example": 6540, + "nullable": true }, "connector": { "type": "string", @@ -12765,11 +12765,12 @@ "PaymentsResponse": { "type": "object", "required": [ + "payment_id", + "merchant_id", "status", "amount", "net_amount", "amount_capturable", - "amount_received", "currency", "payment_method", "attempt_count" @@ -12779,7 +12780,6 @@ "type": "string", "description": "Unique identifier for the payment. This ensures idempotency for multiple payments\nthat have been done by a single merchant.", "example": "pay_mbabizu24mvu3mela5njyhpit4", - "nullable": true, "maxLength": 30, "minLength": 30 }, @@ -12787,7 +12787,6 @@ "type": "string", "description": "This is an identifier for the merchant account. This is inferred from the API key\nprovided during the request", "example": "merchant_1668273825", - "nullable": true, "maxLength": 255 }, "status": { @@ -12821,7 +12820,8 @@ "type": "integer", "format": "int64", "description": "The amount which is already captured from the payment, this helps in the cases where merchants can't capture all capturable amount at once.", - "example": 6540 + "example": 6540, + "nullable": true }, "connector": { "type": "string", diff --git a/api-reference/openapi_spec.json b/api-reference/openapi_spec.json index 63dae96511a..67254b36097 100644 --- a/api-reference/openapi_spec.json +++ b/api-reference/openapi_spec.json @@ -16292,11 +16292,12 @@ "PaymentsCreateResponseOpenApi": { "type": "object", "required": [ + "payment_id", + "merchant_id", "status", "amount", "net_amount", "amount_capturable", - "amount_received", "currency", "payment_method", "attempt_count" @@ -16306,7 +16307,6 @@ "type": "string", "description": "Unique identifier for the payment. This ensures idempotency for multiple payments\nthat have been done by a single merchant.", "example": "pay_mbabizu24mvu3mela5njyhpit4", - "nullable": true, "maxLength": 30, "minLength": 30 }, @@ -16314,7 +16314,6 @@ "type": "string", "description": "This is an identifier for the merchant account. This is inferred from the API key\nprovided during the request", "example": "merchant_1668273825", - "nullable": true, "maxLength": 255 }, "status": { @@ -16348,7 +16347,8 @@ "type": "integer", "format": "int64", "description": "The amount which is already captured from the payment, this helps in the cases where merchants can't capture all capturable amount at once.", - "example": 6540 + "example": 6540, + "nullable": true }, "connector": { "type": "string", @@ -17345,11 +17345,12 @@ "PaymentsResponse": { "type": "object", "required": [ + "payment_id", + "merchant_id", "status", "amount", "net_amount", "amount_capturable", - "amount_received", "currency", "payment_method", "attempt_count" @@ -17359,7 +17360,6 @@ "type": "string", "description": "Unique identifier for the payment. This ensures idempotency for multiple payments\nthat have been done by a single merchant.", "example": "pay_mbabizu24mvu3mela5njyhpit4", - "nullable": true, "maxLength": 30, "minLength": 30 }, @@ -17367,7 +17367,6 @@ "type": "string", "description": "This is an identifier for the merchant account. This is inferred from the API key\nprovided during the request", "example": "merchant_1668273825", - "nullable": true, "maxLength": 255 }, "status": { @@ -17401,7 +17400,8 @@ "type": "integer", "format": "int64", "description": "The amount which is already captured from the payment, this helps in the cases where merchants can't capture all capturable amount at once.", - "example": 6540 + "example": 6540, + "nullable": true }, "connector": { "type": "string", diff --git a/crates/api_models/src/events/payment.rs b/crates/api_models/src/events/payment.rs index c4459223a51..ba137cd3baf 100644 --- a/crates/api_models/src/events/payment.rs +++ b/crates/api_models/src/events/payment.rs @@ -99,9 +99,9 @@ impl ApiEventMetric for PaymentsRequest { impl ApiEventMetric for PaymentsResponse { fn get_api_event_type(&self) -> Option<ApiEventsType> { - self.payment_id - .clone() - .map(|payment_id| ApiEventsType::Payment { payment_id }) + Some(ApiEventsType::Payment { + payment_id: self.payment_id.clone(), + }) } } diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rs index b02d44f9806..5ccde3e6d74 100644 --- a/crates/api_models/src/payments.rs +++ b/crates/api_models/src/payments.rs @@ -3554,16 +3554,7 @@ pub struct ReceiverDetails { amount_remaining: Option<i64>, } -#[derive( - Setter, - Clone, - Default, - Debug, - PartialEq, - serde::Serialize, - ToSchema, - router_derive::PolymorphicSchema, -)] +#[derive(Clone, Debug, PartialEq, serde::Serialize, ToSchema, router_derive::PolymorphicSchema)] #[generate_schemas(PaymentsCreateResponseOpenApi)] pub struct PaymentsResponse { @@ -3574,12 +3565,12 @@ pub struct PaymentsResponse { max_length = 30, example = "pay_mbabizu24mvu3mela5njyhpit4" )] - pub payment_id: Option<String>, + pub payment_id: String, /// This is an identifier for the merchant account. This is inferred from the API key /// provided during the request - #[schema(max_length = 255, example = "merchant_1668273825", value_type = Option<String>)] - pub merchant_id: Option<id_type::MerchantId>, + #[schema(max_length = 255, example = "merchant_1668273825", value_type = String)] + pub merchant_id: id_type::MerchantId, #[schema(value_type = IntentStatus, example = "failed", default = "requires_confirmation")] pub status: api_enums::IntentStatus, @@ -3595,10 +3586,10 @@ pub struct PaymentsResponse { /// The maximum amount that could be captured from the payment #[schema(value_type = i64, minimum = 100, example = 6540)] - pub amount_capturable: Option<MinorUnit>, + pub amount_capturable: MinorUnit, /// The amount which is already captured from the payment, this helps in the cases where merchants can't capture all capturable amount at once. - #[schema(value_type = i64, example = 6540)] + #[schema(value_type = Option<i64>, example = 6540)] pub amount_received: Option<MinorUnit>, /// The connector used for the payment @@ -3658,7 +3649,6 @@ pub struct PaymentsResponse { pub mandate_id: Option<String>, /// Provided mandate information for creating a mandate - #[auth_based] pub mandate_data: Option<MandateData>, /// Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete. @@ -3682,12 +3672,10 @@ pub struct PaymentsResponse { /// The payment method that is to be used #[schema(value_type = PaymentMethod, example = "bank_transfer")] - #[auth_based] pub payment_method: Option<api_enums::PaymentMethod>, /// The payment method information provided for making a payment #[schema(value_type = Option<PaymentMethodDataResponseWithBilling>, example = "bank_transfer")] - #[auth_based] #[serde(serialize_with = "serialize_payment_method_data_response")] pub payment_method_data: Option<PaymentMethodDataResponseWithBilling>, diff --git a/crates/router/src/compatibility/stripe/payment_intents/types.rs b/crates/router/src/compatibility/stripe/payment_intents/types.rs index c0619312560..e76ed607b23 100644 --- a/crates/router/src/compatibility/stripe/payment_intents/types.rs +++ b/crates/router/src/compatibility/stripe/payment_intents/types.rs @@ -462,11 +462,11 @@ impl From<StripePaymentCancelRequest> for payments::PaymentsCancelRequest { #[derive(Default, Eq, PartialEq, Serialize, Debug)] pub struct StripePaymentIntentResponse { - pub id: Option<String>, + pub id: String, pub object: &'static str, pub amount: i64, pub amount_received: Option<i64>, - pub amount_capturable: Option<i64>, + pub amount_capturable: i64, pub currency: String, pub status: StripePaymentStatus, pub client_secret: Option<masking::Secret<String>>, @@ -520,7 +520,7 @@ impl From<payments::PaymentsResponse> for StripePaymentIntentResponse { id: resp.payment_id, status: StripePaymentStatus::from(resp.status), amount: resp.amount.get_amount_as_i64(), - amount_capturable: resp.amount_capturable.map(|amt| amt.get_amount_as_i64()), + amount_capturable: resp.amount_capturable.get_amount_as_i64(), amount_received: resp.amount_received.map(|amt| amt.get_amount_as_i64()), connector: resp.connector, client_secret: resp.client_secret, diff --git a/crates/router/src/compatibility/stripe/setup_intents/types.rs b/crates/router/src/compatibility/stripe/setup_intents/types.rs index 66c35637de7..8d59ef40314 100644 --- a/crates/router/src/compatibility/stripe/setup_intents/types.rs +++ b/crates/router/src/compatibility/stripe/setup_intents/types.rs @@ -451,7 +451,7 @@ pub(crate) fn into_stripe_next_action( #[derive(Default, Eq, PartialEq, Serialize)] pub struct StripeSetupIntentResponse { - pub id: Option<String>, + pub id: String, pub object: String, pub status: StripeSetupStatus, pub client_secret: Option<masking::Secret<String>>, diff --git a/crates/router/src/core/payments/transformers.rs b/crates/router/src/core/payments/transformers.rs index df61b8809a7..3a101fe8fc6 100644 --- a/crates/router/src/core/payments/transformers.rs +++ b/crates/router/src/core/payments/transformers.rs @@ -389,7 +389,7 @@ pub fn payments_to_payments_response<Op, F: Clone>( payment_data: PaymentData<F>, captures: Option<Vec<storage::Capture>>, customer: Option<domain::Customer>, - auth_flow: services::AuthFlow, + _auth_flow: services::AuthFlow, base_url: &str, operation: &Op, connector_request_reference_id_config: &ConnectorRequestReferenceIdConfig, @@ -715,7 +715,6 @@ where ) } - let mut response: api::PaymentsResponse = Default::default(); let routed_through = payment_attempt.connector.clone(); let connector_label = routed_through.as_ref().and_then(|connector_name| { @@ -749,163 +748,144 @@ where } }; - services::ApplicationResponse::JsonWithHeaders(( - response - .set_net_amount(payment_attempt.net_amount) - .set_payment_id(Some(payment_attempt.payment_id)) - .set_merchant_id(Some(payment_attempt.merchant_id)) - .set_status(payment_intent.status) - .set_amount(payment_attempt.amount) - .set_amount_capturable(Some(payment_attempt.amount_capturable)) - .set_amount_received(payment_intent.amount_captured) - .set_surcharge_details(surcharge_details) - .set_connector(routed_through) - .set_client_secret(payment_intent.client_secret.map(Secret::new)) - .set_created(Some(payment_intent.created_at)) - .set_currency(currency.to_string()) - .set_customer_id(customer.as_ref().map(|cus| cus.clone().get_customer_id())) - .set_email( - customer - .as_ref() - .and_then(|cus| cus.email.as_ref().map(|s| s.to_owned())), - ) - .set_name( - customer - .as_ref() - .and_then(|cus| cus.name.as_ref().map(|s| s.to_owned())), - ) - .set_phone( - customer - .as_ref() - .and_then(|cus| cus.phone.as_ref().map(|s| s.to_owned())), - ) - .set_mandate_id(mandate_id) - .set_mandate_data( - payment_data.setup_mandate.map(|d| api::MandateData { - customer_acceptance: d.customer_acceptance.map(|d| { - api::CustomerAcceptance { - acceptance_type: match d.acceptance_type { - hyperswitch_domain_models::mandates::AcceptanceType::Online => { - api::AcceptanceType::Online - } - hyperswitch_domain_models::mandates::AcceptanceType::Offline => { - api::AcceptanceType::Offline - } - }, - accepted_at: d.accepted_at, - online: d.online.map(|d| api::OnlineMandate { - ip_address: d.ip_address, - user_agent: d.user_agent, - }), - } - }), - mandate_type: d.mandate_type.map(|d| match d { - hyperswitch_domain_models::mandates::MandateDataType::MultiUse(Some(i)) => { - api::MandateType::MultiUse(Some(api::MandateAmountData { - amount: i.amount, - currency: i.currency, - start_date: i.start_date, - end_date: i.end_date, - metadata: i.metadata, - })) - } - hyperswitch_domain_models::mandates::MandateDataType::SingleUse(i) => { - api::MandateType::SingleUse(api::payments::MandateAmountData { - amount: i.amount, - currency: i.currency, - start_date: i.start_date, - end_date: i.end_date, - metadata: i.metadata, - }) - } - hyperswitch_domain_models::mandates::MandateDataType::MultiUse(None) => { - api::MandateType::MultiUse(None) - } - }), - update_mandate_id: d.update_mandate_id, - }), - auth_flow == services::AuthFlow::Merchant, - ) - .set_description(payment_intent.description) - .set_refunds(refunds_response) // refunds.iter().map(refund_to_refund_response), - .set_disputes(disputes_response) - .set_attempts(attempts_response) - .set_captures(captures_response) - .set_payment_method( - payment_attempt.payment_method, - auth_flow == services::AuthFlow::Merchant, - ) - .set_payment_method_data( - payment_method_data_response, - auth_flow == services::AuthFlow::Merchant, - ) - .set_payment_token(payment_attempt.payment_token) - .set_error_message( - payment_attempt - .error_reason - .or(payment_attempt.error_message), - ) - .set_error_code(payment_attempt.error_code) - .set_shipping(payment_data.address.get_shipping().cloned()) - .set_billing(payment_data.address.get_payment_billing().cloned()) - .set_next_action(next_action_response) - .set_return_url(payment_intent.return_url) - .set_cancellation_reason(payment_attempt.cancellation_reason) - .set_authentication_type(payment_attempt.authentication_type) - .set_statement_descriptor_name(payment_intent.statement_descriptor_name) - .set_statement_descriptor_suffix(payment_intent.statement_descriptor_suffix) - .set_setup_future_usage(payment_intent.setup_future_usage) - .set_capture_method(payment_attempt.capture_method) - .set_payment_experience(payment_attempt.payment_experience) - .set_payment_method_type(payment_attempt.payment_method_type) - .set_metadata(payment_intent.metadata) - .set_order_details(payment_intent.order_details) - .set_connector_label(connector_label) - .set_business_country(payment_intent.business_country) - .set_business_label(payment_intent.business_label) - .set_business_sub_label(payment_attempt.business_sub_label) - .set_allowed_payment_method_types(payment_intent.allowed_payment_method_types) - .set_ephemeral_key(payment_data.ephemeral_key.map(ForeignFrom::foreign_from)) - .set_frm_message(frm_message) - .set_merchant_decision(merchant_decision) - .set_manual_retry_allowed(helpers::is_manual_retry_allowed( - &payment_intent.status, - &payment_attempt.status, - connector_request_reference_id_config, - &merchant_id, - )) - .set_connector_transaction_id(payment_attempt.connector_transaction_id) - .set_feature_metadata(payment_intent.feature_metadata) - .set_connector_metadata(payment_intent.connector_metadata) - .set_reference_id(payment_attempt.connector_response_reference_id) - .set_payment_link(payment_link_data) - .set_profile_id(payment_intent.profile_id) - .set_attempt_count(payment_intent.attempt_count) - .set_merchant_connector_id(payment_attempt.merchant_connector_id) - .set_unified_code(payment_attempt.unified_code) - .set_unified_message(payment_attempt.unified_message) - .set_incremental_authorization_allowed( - payment_intent.incremental_authorization_allowed, - ) - .set_external_authentication_details(external_authentication_details) - .set_fingerprint(payment_intent.fingerprint_id) - .set_authorization_count(payment_intent.authorization_count) - .set_incremental_authorizations(incremental_authorizations_response) - .set_expires_on(payment_intent.session_expiry) - .set_external_3ds_authentication_attempted( - payment_attempt.external_three_ds_authentication_attempted, - ) - .set_payment_method_id(payment_attempt.payment_method_id) - .set_payment_method_status(payment_data.payment_method_info.map(|info| info.status)) - .set_customer(customer_details_response.clone()) - .set_browser_info(payment_attempt.browser_info) - .set_updated(Some(payment_intent.modified_at)) - .set_charges(charges_response) - .set_frm_metadata(payment_intent.frm_metadata) - .set_merchant_order_reference_id(payment_intent.merchant_order_reference_id) - .to_owned(), - headers, - )) + let mandate_data = payment_data.setup_mandate.map(|d| api::MandateData { + customer_acceptance: d.customer_acceptance.map(|d| api::CustomerAcceptance { + acceptance_type: match d.acceptance_type { + hyperswitch_domain_models::mandates::AcceptanceType::Online => { + api::AcceptanceType::Online + } + hyperswitch_domain_models::mandates::AcceptanceType::Offline => { + api::AcceptanceType::Offline + } + }, + accepted_at: d.accepted_at, + online: d.online.map(|d| api::OnlineMandate { + ip_address: d.ip_address, + user_agent: d.user_agent, + }), + }), + mandate_type: d.mandate_type.map(|d| match d { + hyperswitch_domain_models::mandates::MandateDataType::MultiUse(Some(i)) => { + api::MandateType::MultiUse(Some(api::MandateAmountData { + amount: i.amount, + currency: i.currency, + start_date: i.start_date, + end_date: i.end_date, + metadata: i.metadata, + })) + } + hyperswitch_domain_models::mandates::MandateDataType::SingleUse(i) => { + api::MandateType::SingleUse(api::payments::MandateAmountData { + amount: i.amount, + currency: i.currency, + start_date: i.start_date, + end_date: i.end_date, + metadata: i.metadata, + }) + } + hyperswitch_domain_models::mandates::MandateDataType::MultiUse(None) => { + api::MandateType::MultiUse(None) + } + }), + update_mandate_id: d.update_mandate_id, + }); + + let payments_response = api::PaymentsResponse { + payment_id: payment_intent.payment_id, + merchant_id: payment_intent.merchant_id, + status: payment_intent.status, + amount: payment_attempt.amount, + net_amount: payment_attempt.net_amount, + amount_capturable: payment_attempt.amount_capturable, + amount_received: payment_intent.amount_captured, + connector: routed_through, + client_secret: payment_intent.client_secret.map(Secret::new), + created: Some(payment_intent.created_at), + currency: currency.to_string(), + customer_id: customer.as_ref().map(|cus| cus.clone().get_customer_id()), + customer: customer_details_response, + description: payment_intent.description, + refunds: refunds_response, + disputes: disputes_response, + attempts: attempts_response, + captures: captures_response, + mandate_id, + mandate_data, + setup_future_usage: payment_intent.setup_future_usage, + off_session: payment_intent.off_session, + capture_on: None, + capture_method: payment_attempt.capture_method, + payment_method: payment_attempt.payment_method, + payment_method_data: payment_method_data_response, + payment_token: payment_attempt.payment_token, + shipping: payment_data.address.get_shipping().cloned(), + billing: payment_data.address.get_payment_billing().cloned(), + order_details: payment_intent.order_details, + email: customer + .as_ref() + .and_then(|cus| cus.email.as_ref().map(|s| s.to_owned())), + name: customer + .as_ref() + .and_then(|cus| cus.name.as_ref().map(|s| s.to_owned())), + phone: customer + .as_ref() + .and_then(|cus| cus.phone.as_ref().map(|s| s.to_owned())), + return_url: payment_intent.return_url, + authentication_type: payment_attempt.authentication_type, + statement_descriptor_name: payment_intent.statement_descriptor_name, + statement_descriptor_suffix: payment_intent.statement_descriptor_suffix, + next_action: next_action_response, + cancellation_reason: payment_attempt.cancellation_reason, + error_code: payment_attempt.error_code, + error_message: payment_attempt + .error_reason + .or(payment_attempt.error_message), + unified_code: payment_attempt.unified_code, + unified_message: payment_attempt.unified_message, + payment_experience: payment_attempt.payment_experience, + payment_method_type: payment_attempt.payment_method_type, + connector_label, + business_country: payment_intent.business_country, + business_label: payment_intent.business_label, + business_sub_label: payment_attempt.business_sub_label, + allowed_payment_method_types: payment_intent.allowed_payment_method_types, + ephemeral_key: payment_data.ephemeral_key.map(ForeignFrom::foreign_from), + manual_retry_allowed: helpers::is_manual_retry_allowed( + &payment_intent.status, + &payment_attempt.status, + connector_request_reference_id_config, + &merchant_id, + ), + connector_transaction_id: payment_attempt.connector_transaction_id, + frm_message, + metadata: payment_intent.metadata, + connector_metadata: payment_intent.connector_metadata, + feature_metadata: payment_intent.feature_metadata, + reference_id: payment_attempt.connector_response_reference_id, + payment_link: payment_link_data, + profile_id: payment_intent.profile_id, + surcharge_details, + attempt_count: payment_intent.attempt_count, + merchant_decision, + merchant_connector_id: payment_attempt.merchant_connector_id, + incremental_authorization_allowed: payment_intent.incremental_authorization_allowed, + authorization_count: payment_intent.authorization_count, + incremental_authorizations: incremental_authorizations_response, + external_authentication_details, + external_3ds_authentication_attempted: payment_attempt + .external_three_ds_authentication_attempted, + expires_on: payment_intent.session_expiry, + fingerprint: payment_intent.fingerprint_id, + browser_info: payment_attempt.browser_info, + payment_method_id: payment_attempt.payment_method_id, + payment_method_status: payment_data.payment_method_info.map(|info| info.status), + updated: Some(payment_intent.modified_at), + charges: charges_response, + frm_metadata: payment_intent.frm_metadata, + merchant_order_reference_id: payment_intent.merchant_order_reference_id, + }; + + services::ApplicationResponse::JsonWithHeaders((payments_response, headers)) }; metrics::PAYMENT_OPS_COUNT.add( @@ -1034,15 +1014,13 @@ pub fn wait_screen_next_steps_check( } impl ForeignFrom<(storage::PaymentIntent, storage::PaymentAttempt)> for api::PaymentsResponse { - fn foreign_from(item: (storage::PaymentIntent, storage::PaymentAttempt)) -> Self { - let pi = item.0; - let pa = item.1; + fn foreign_from((pi, pa): (storage::PaymentIntent, storage::PaymentAttempt)) -> Self { Self { - payment_id: Some(pi.payment_id), - merchant_id: Some(pi.merchant_id), + payment_id: pi.payment_id, + merchant_id: pi.merchant_id, status: pi.status, amount: pi.amount, - amount_capturable: pi.amount_captured, + amount_capturable: pa.amount_capturable, client_secret: pi.client_secret.map(|s| s.into()), created: Some(pi.created_at), currency: pi.currency.map(|c| c.to_string()).unwrap_or_default(), @@ -1107,7 +1085,55 @@ impl ForeignFrom<(storage::PaymentIntent, storage::PaymentAttempt)> for api::Pay } } ), - ..Default::default() + // TODO: fill in details based on requirement + net_amount: pa.net_amount, + amount_received: None, + refunds: None, + disputes: None, + attempts: None, + captures: None, + mandate_id: None, + mandate_data: None, + off_session: None, + capture_on: None, + payment_token: None, + email: None, + name: None, + phone: None, + return_url: None, + statement_descriptor_name: None, + statement_descriptor_suffix: None, + next_action: None, + cancellation_reason: None, + error_code: None, + error_message: None, + unified_code: None, + unified_message: None, + payment_experience: None, + connector_label: None, + allowed_payment_method_types: None, + ephemeral_key: None, + manual_retry_allowed: None, + frm_message: None, + connector_metadata: None, + feature_metadata: None, + reference_id: None, + payment_link: None, + surcharge_details: None, + merchant_decision: None, + incremental_authorization_allowed: None, + authorization_count: None, + incremental_authorizations: None, + external_authentication_details: None, + external_3ds_authentication_attempted: None, + expires_on: None, + fingerprint: None, + browser_info: None, + payment_method_id: None, + payment_method_status: None, + updated: None, + charges: None, + frm_metadata: None, } } } diff --git a/crates/router/src/core/webhooks/incoming.rs b/crates/router/src/core/webhooks/incoming.rs index 9d16cf62c06..d3e5873e9e9 100644 --- a/crates/router/src/core/webhooks/incoming.rs +++ b/crates/router/src/core/webhooks/incoming.rs @@ -46,7 +46,7 @@ use crate::{ storage::{self, enums}, transformers::{ForeignFrom, ForeignInto, ForeignTryFrom}, }, - utils::{self as helper_utils, generate_id, OptionExt}, + utils::{self as helper_utils, generate_id}, }; #[cfg(feature = "payouts")] use crate::{core::payouts, types::storage::PayoutAttemptUpdate}; @@ -596,12 +596,7 @@ async fn payments_incoming_webhook_flow( match payments_response { services::ApplicationResponse::JsonWithHeaders((payments_response, _)) => { - let payment_id = payments_response - .payment_id - .clone() - .get_required_value("payment_id") - .change_context(errors::ApiErrorResponse::WebhookProcessingFailure) - .attach_printable("payment id not received from payments core")?; + let payment_id = payments_response.payment_id.clone(); let status = payments_response.status; @@ -1087,12 +1082,8 @@ async fn external_authentication_incoming_webhook_flow( .await?; match payments_response { services::ApplicationResponse::JsonWithHeaders((payments_response, _)) => { - let payment_id = payments_response - .payment_id - .clone() - .get_required_value("payment_id") - .change_context(errors::ApiErrorResponse::WebhookProcessingFailure) - .attach_printable("payment id not received from payments core")?; + let payment_id = payments_response.payment_id.clone(); + let status = payments_response.status; let event_type: Option<enums::EventType> = payments_response.status.foreign_into(); @@ -1316,12 +1307,7 @@ async fn frm_incoming_webhook_flow( }; match payment_response { services::ApplicationResponse::JsonWithHeaders((payments_response, _)) => { - let payment_id = payments_response - .payment_id - .clone() - .get_required_value("payment_id") - .change_context(errors::ApiErrorResponse::WebhookProcessingFailure) - .attach_printable("payment id not received from payments core")?; + let payment_id = payments_response.payment_id.clone(); let status = payments_response.status; let event_type: Option<enums::EventType> = payments_response.status.foreign_into(); if let Some(outgoing_event_type) = event_type { @@ -1480,12 +1466,7 @@ async fn bank_transfer_webhook_flow( match response? { services::ApplicationResponse::JsonWithHeaders((payments_response, _)) => { - let payment_id = payments_response - .payment_id - .clone() - .get_required_value("payment_id") - .change_context(errors::ApiErrorResponse::WebhookProcessingFailure) - .attach_printable("did not receive payment id from payments core response")?; + let payment_id = payments_response.payment_id.clone(); let event_type: Option<enums::EventType> = payments_response.status.foreign_into(); let status = payments_response.status; diff --git a/crates/router/src/core/webhooks/outgoing.rs b/crates/router/src/core/webhooks/outgoing.rs index 36eadab6124..b075b15e7f8 100644 --- a/crates/router/src/core/webhooks/outgoing.rs +++ b/crates/router/src/core/webhooks/outgoing.rs @@ -96,7 +96,7 @@ pub(crate) async fn create_event_and_trigger_outgoing_webhook( .change_context(errors::ApiErrorResponse::WebhookProcessingFailure) .attach_printable("Failed to construct outgoing webhook request content")?; - let event_metadata = storage::EventMetadata::foreign_from((&content, &primary_object_id)); + let event_metadata = storage::EventMetadata::foreign_from(&content); let key_manager_state = &(&state).into(); let new_event = domain::Event { event_id: event_id.clone(), @@ -905,14 +905,11 @@ async fn error_response_handler( Err(error) } -impl ForeignFrom<(&api::OutgoingWebhookContent, &str)> for storage::EventMetadata { - fn foreign_from((content, primary_object_id): (&api::OutgoingWebhookContent, &str)) -> Self { +impl ForeignFrom<&api::OutgoingWebhookContent> for storage::EventMetadata { + fn foreign_from(content: &api::OutgoingWebhookContent) -> Self { match content { webhooks::OutgoingWebhookContent::PaymentDetails(payments_response) => Self::Payment { - payment_id: payments_response - .payment_id - .clone() - .unwrap_or_else(|| primary_object_id.to_owned()), + payment_id: payments_response.payment_id.clone(), }, webhooks::OutgoingWebhookContent::RefundDetails(refund_response) => Self::Refund { payment_id: refund_response.payment_id.clone(), @@ -941,7 +938,7 @@ fn get_outgoing_webhook_event_content_from_event_metadata( event_metadata.map(|metadata| match metadata { diesel_models::EventMetadata::Payment { payment_id } => { OutgoingWebhookEventContent::Payment { - payment_id: Some(payment_id), + payment_id, content: serde_json::Value::Null, } } diff --git a/crates/router/src/events/outgoing_webhook_logs.rs b/crates/router/src/events/outgoing_webhook_logs.rs index 2a56f60ecac..0f7ca4a2343 100644 --- a/crates/router/src/events/outgoing_webhook_logs.rs +++ b/crates/router/src/events/outgoing_webhook_logs.rs @@ -27,7 +27,7 @@ pub struct OutgoingWebhookEvent { #[serde(tag = "outgoing_webhook_event_type", rename_all = "snake_case")] pub enum OutgoingWebhookEventContent { Payment { - payment_id: Option<String>, + payment_id: String, content: Value, }, Payout { diff --git a/crates/router/tests/payments.rs b/crates/router/tests/payments.rs index 8508e3d5cda..66f99dd0854 100644 --- a/crates/router/tests/payments.rs +++ b/crates/router/tests/payments.rs @@ -317,7 +317,7 @@ async fn payments_create_core() { payment_id: Some(api::PaymentIdType::PaymentIntentId( "pay_mbabizu24mvu3mela5njyhpit10".to_string(), )), - merchant_id: Some(merchant_id), + merchant_id: Some(merchant_id.clone()), amount: Some(MinorUnit::new(6540).into()), currency: Some(api_enums::Currency::USD), capture_method: Some(api_enums::CaptureMethod::Automatic), @@ -364,10 +364,10 @@ async fn payments_create_core() { }; let expected_response = api::PaymentsResponse { - payment_id: Some("pay_mbabizu24mvu3mela5njyhpit10".to_string()), + payment_id: "pay_mbabizu24mvu3mela5njyhpit10".to_string(), status: api_enums::IntentStatus::Succeeded, amount: MinorUnit::new(6540), - amount_capturable: None, + amount_capturable: MinorUnit::new(0), amount_received: None, client_secret: None, created: None, @@ -376,7 +376,72 @@ async fn payments_create_core() { description: Some("Its my first payment request".to_string()), refunds: None, mandate_id: None, - ..Default::default() + merchant_id, + net_amount: MinorUnit::new(6540), + connector: None, + customer: None, + disputes: None, + attempts: None, + captures: None, + mandate_data: None, + setup_future_usage: None, + off_session: None, + capture_on: None, + capture_method: None, + payment_method: None, + payment_method_data: None, + payment_token: None, + shipping: None, + billing: None, + order_details: None, + email: None, + name: None, + phone: None, + return_url: None, + authentication_type: None, + statement_descriptor_name: None, + statement_descriptor_suffix: None, + next_action: None, + cancellation_reason: None, + error_code: None, + error_message: None, + unified_code: None, + unified_message: None, + payment_experience: None, + payment_method_type: None, + connector_label: None, + business_country: None, + business_label: None, + business_sub_label: None, + allowed_payment_method_types: None, + ephemeral_key: None, + manual_retry_allowed: None, + connector_transaction_id: None, + frm_message: None, + metadata: None, + connector_metadata: None, + feature_metadata: None, + reference_id: None, + payment_link: None, + profile_id: None, + surcharge_details: None, + attempt_count: 1, + merchant_decision: None, + merchant_connector_id: None, + incremental_authorization_allowed: None, + authorization_count: None, + incremental_authorizations: None, + external_authentication_details: None, + external_3ds_authentication_attempted: None, + expires_on: None, + fingerprint: None, + browser_info: None, + payment_method_id: None, + payment_method_status: None, + updated: None, + charges: None, + frm_metadata: None, + merchant_order_reference_id: None, }; let expected_response = services::ApplicationResponse::JsonWithHeaders((expected_response, vec![])); @@ -551,10 +616,10 @@ async fn payments_create_core_adyen_no_redirect() { let expected_response = services::ApplicationResponse::JsonWithHeaders(( api::PaymentsResponse { - payment_id: Some(payment_id.clone()), + payment_id: payment_id.clone(), status: api_enums::IntentStatus::Processing, amount: MinorUnit::new(6540), - amount_capturable: None, + amount_capturable: MinorUnit::new(0), amount_received: None, client_secret: None, created: None, @@ -563,7 +628,72 @@ async fn payments_create_core_adyen_no_redirect() { description: Some("Its my first payment request".to_string()), refunds: None, mandate_id: None, - ..Default::default() + merchant_id, + net_amount: MinorUnit::new(6540), + connector: None, + customer: None, + disputes: None, + attempts: None, + captures: None, + mandate_data: None, + setup_future_usage: None, + off_session: None, + capture_on: None, + capture_method: None, + payment_method: None, + payment_method_data: None, + payment_token: None, + shipping: None, + billing: None, + order_details: None, + email: None, + name: None, + phone: None, + return_url: None, + authentication_type: None, + statement_descriptor_name: None, + statement_descriptor_suffix: None, + next_action: None, + cancellation_reason: None, + error_code: None, + error_message: None, + unified_code: None, + unified_message: None, + payment_experience: None, + payment_method_type: None, + connector_label: None, + business_country: None, + business_label: None, + business_sub_label: None, + allowed_payment_method_types: None, + ephemeral_key: None, + manual_retry_allowed: None, + connector_transaction_id: None, + frm_message: None, + metadata: None, + connector_metadata: None, + feature_metadata: None, + reference_id: None, + payment_link: None, + profile_id: None, + surcharge_details: None, + attempt_count: 1, + merchant_decision: None, + merchant_connector_id: None, + incremental_authorization_allowed: None, + authorization_count: None, + incremental_authorizations: None, + external_authentication_details: None, + external_3ds_authentication_attempted: None, + expires_on: None, + fingerprint: None, + browser_info: None, + payment_method_id: None, + payment_method_status: None, + updated: None, + charges: None, + frm_metadata: None, + merchant_order_reference_id: None, }, vec![], )); diff --git a/crates/router/tests/payments2.rs b/crates/router/tests/payments2.rs index f9a6e4a5230..7899abf72a6 100644 --- a/crates/router/tests/payments2.rs +++ b/crates/router/tests/payments2.rs @@ -77,7 +77,7 @@ async fn payments_create_core() { payment_id: Some(api::PaymentIdType::PaymentIntentId( "pay_mbabizu24mvu3mela5njyhpit10".to_string(), )), - merchant_id: Some(merchant_id), + merchant_id: Some(merchant_id.clone()), amount: Some(MinorUnit::new(6540).into()), currency: Some(api_enums::Currency::USD), capture_method: Some(api_enums::CaptureMethod::Automatic), @@ -124,10 +124,10 @@ async fn payments_create_core() { }; let expected_response = api::PaymentsResponse { - payment_id: Some("pay_mbabizu24mvu3mela5njyhpit10".to_string()), + payment_id: "pay_mbabizu24mvu3mela5njyhpit10".to_string(), status: api_enums::IntentStatus::Succeeded, amount: MinorUnit::new(6540), - amount_capturable: None, + amount_capturable: MinorUnit::new(0), amount_received: None, client_secret: None, created: None, @@ -136,7 +136,72 @@ async fn payments_create_core() { description: Some("Its my first payment request".to_string()), refunds: None, mandate_id: None, - ..Default::default() + merchant_id, + net_amount: MinorUnit::new(6540), + connector: None, + customer: None, + disputes: None, + attempts: None, + captures: None, + mandate_data: None, + setup_future_usage: None, + off_session: None, + capture_on: None, + capture_method: None, + payment_method: None, + payment_method_data: None, + payment_token: None, + shipping: None, + billing: None, + order_details: None, + email: None, + name: None, + phone: None, + return_url: None, + authentication_type: None, + statement_descriptor_name: None, + statement_descriptor_suffix: None, + next_action: None, + cancellation_reason: None, + error_code: None, + error_message: None, + unified_code: None, + unified_message: None, + payment_experience: None, + payment_method_type: None, + connector_label: None, + business_country: None, + business_label: None, + business_sub_label: None, + allowed_payment_method_types: None, + ephemeral_key: None, + manual_retry_allowed: None, + connector_transaction_id: None, + frm_message: None, + metadata: None, + connector_metadata: None, + feature_metadata: None, + reference_id: None, + payment_link: None, + profile_id: None, + surcharge_details: None, + attempt_count: 1, + merchant_decision: None, + merchant_connector_id: None, + incremental_authorization_allowed: None, + authorization_count: None, + incremental_authorizations: None, + external_authentication_details: None, + external_3ds_authentication_attempted: None, + expires_on: None, + fingerprint: None, + browser_info: None, + payment_method_id: None, + payment_method_status: None, + updated: None, + charges: None, + frm_metadata: None, + merchant_order_reference_id: None, }; let expected_response = services::ApplicationResponse::JsonWithHeaders((expected_response, vec![])); @@ -319,10 +384,10 @@ async fn payments_create_core_adyen_no_redirect() { let expected_response = services::ApplicationResponse::JsonWithHeaders(( api::PaymentsResponse { - payment_id: Some(payment_id.clone()), + payment_id: payment_id.clone(), status: api_enums::IntentStatus::Processing, amount: MinorUnit::new(6540), - amount_capturable: None, + amount_capturable: MinorUnit::new(0), amount_received: None, client_secret: None, created: None, @@ -331,7 +396,72 @@ async fn payments_create_core_adyen_no_redirect() { description: Some("Its my first payment request".to_string()), refunds: None, mandate_id: None, - ..Default::default() + merchant_id, + net_amount: MinorUnit::new(6540), + connector: None, + customer: None, + disputes: None, + attempts: None, + captures: None, + mandate_data: None, + setup_future_usage: None, + off_session: None, + capture_on: None, + capture_method: None, + payment_method: None, + payment_method_data: None, + payment_token: None, + shipping: None, + billing: None, + order_details: None, + email: None, + name: None, + phone: None, + return_url: None, + authentication_type: None, + statement_descriptor_name: None, + statement_descriptor_suffix: None, + next_action: None, + cancellation_reason: None, + error_code: None, + error_message: None, + unified_code: None, + unified_message: None, + payment_experience: None, + payment_method_type: None, + connector_label: None, + business_country: None, + business_label: None, + business_sub_label: None, + allowed_payment_method_types: None, + ephemeral_key: None, + manual_retry_allowed: None, + connector_transaction_id: None, + frm_message: None, + metadata: None, + connector_metadata: None, + feature_metadata: None, + reference_id: None, + payment_link: None, + profile_id: None, + surcharge_details: None, + attempt_count: 1, + merchant_decision: None, + merchant_connector_id: None, + incremental_authorization_allowed: None, + authorization_count: None, + incremental_authorizations: None, + external_authentication_details: None, + external_3ds_authentication_attempted: None, + expires_on: None, + fingerprint: None, + browser_info: None, + payment_method_id: None, + payment_method_status: None, + updated: None, + charges: None, + frm_metadata: None, + merchant_order_reference_id: None, }, vec![], ));
refactor
remove setter from payments response (#5676)
acab7671b07fc6b96108321c6079a76b37d9eeb3
2023-04-13 14:04:49
Sai Harsha Vardhan
feat(router): added dispute retrieve and dispute list apis (#842)
false
diff --git a/crates/api_models/src/disputes.rs b/crates/api_models/src/disputes.rs index e60a6a44fde..df8d9118a17 100644 --- a/crates/api_models/src/disputes.rs +++ b/crates/api_models/src/disputes.rs @@ -1,4 +1,5 @@ -use masking::Serialize; +use masking::{Deserialize, Serialize}; +use time::PrimitiveDateTime; use utoipa::ToSchema; use super::enums::{DisputeStage, DisputeStatus}; @@ -19,6 +20,8 @@ pub struct DisputeResponse { pub dispute_stage: DisputeStage, /// Status of the dispute pub dispute_status: DisputeStatus, + /// connector to which dispute is associated with + pub connector: String, /// Status of the dispute sent by connector pub connector_status: String, /// Dispute id sent by connector @@ -36,3 +39,37 @@ pub struct DisputeResponse { /// Time at which dispute is received pub received_at: String, } + +#[derive(Clone, Debug, Deserialize, ToSchema)] +#[serde(deny_unknown_fields)] +pub struct DisputeListConstraints { + /// limit on the number of objects to return + pub limit: Option<i64>, + /// status of the dispute + pub dispute_status: Option<DisputeStatus>, + /// stage of the dispute + pub dispute_stage: Option<DisputeStage>, + /// reason for the dispute + pub reason: Option<String>, + /// connector linked to dispute + pub connector: Option<String>, + /// The time at which dispute is received + #[schema(example = "2022-09-10T10:11:12Z")] + pub received_time: Option<PrimitiveDateTime>, + /// Time less than the dispute received time + #[schema(example = "2022-09-10T10:11:12Z")] + #[serde(rename = "received_time.lt")] + pub received_time_lt: Option<PrimitiveDateTime>, + /// Time greater than the dispute received time + #[schema(example = "2022-09-10T10:11:12Z")] + #[serde(rename = "received_time.gt")] + pub received_time_gt: Option<PrimitiveDateTime>, + /// Time less than or equals to the dispute received time + #[schema(example = "2022-09-10T10:11:12Z")] + #[serde(rename = "received_time.lte")] + pub received_time_lte: Option<PrimitiveDateTime>, + /// Time greater than or equals to the dispute received time + #[schema(example = "2022-09-10T10:11:12Z")] + #[serde(rename = "received_time.gte")] + pub received_time_gte: Option<PrimitiveDateTime>, +} diff --git a/crates/router/src/compatibility/stripe/errors.rs b/crates/router/src/compatibility/stripe/errors.rs index 722235d2af9..e718651796c 100644 --- a/crates/router/src/compatibility/stripe/errors.rs +++ b/crates/router/src/compatibility/stripe/errors.rs @@ -180,6 +180,8 @@ pub enum StripeErrorCode { #[error(error_type = StripeErrorType::HyperswitchError, code = "", message = "The connector provided in the request is incorrect or not available")] IncorrectConnectorNameGiven, + #[error(error_type = StripeErrorType::HyperswitchError, code = "", message = "No such {object}: '{id}'")] + ResourceMissing { object: String, id: String }, // [#216]: https://github.com/juspay/hyperswitch/issues/216 // Implement the remaining stripe error codes @@ -460,6 +462,10 @@ impl From<errors::ApiErrorResponse> for StripeErrorCode { errors::ApiErrorResponse::DuplicatePayment { payment_id } => { Self::DuplicatePayment { payment_id } } + errors::ApiErrorResponse::DisputeNotFound { dispute_id } => Self::ResourceMissing { + object: "dispute".to_owned(), + id: dispute_id, + }, errors::ApiErrorResponse::NotSupported { .. } => Self::InternalServerError, } } @@ -507,7 +513,8 @@ impl actix_web::ResponseError for StripeErrorCode { | Self::PaymentIntentMandateInvalid { .. } | Self::PaymentIntentUnexpectedState { .. } | Self::DuplicatePayment { .. } - | Self::IncorrectConnectorNameGiven => StatusCode::BAD_REQUEST, + | Self::IncorrectConnectorNameGiven + | Self::ResourceMissing { .. } => StatusCode::BAD_REQUEST, Self::RefundFailed | Self::InternalServerError | Self::MandateActive diff --git a/crates/router/src/core.rs b/crates/router/src/core.rs index 58690e8c449..83b321f8caa 100644 --- a/crates/router/src/core.rs +++ b/crates/router/src/core.rs @@ -3,6 +3,7 @@ pub mod api_keys; pub mod cards_info; pub mod configs; pub mod customers; +pub mod disputes; pub mod errors; pub mod mandate; pub mod metrics; diff --git a/crates/router/src/core/disputes.rs b/crates/router/src/core/disputes.rs new file mode 100644 index 00000000000..33639d16e95 --- /dev/null +++ b/crates/router/src/core/disputes.rs @@ -0,0 +1,47 @@ +use router_env::{instrument, tracing}; + +use super::errors::{self, RouterResponse, StorageErrorExt}; +use crate::{ + routes::AppState, + services, + types::{api::disputes, storage, transformers::ForeignFrom}, +}; + +#[instrument(skip(state))] +pub async fn retrieve_dispute( + state: &AppState, + merchant_account: storage::MerchantAccount, + req: disputes::DisputeId, +) -> RouterResponse<api_models::disputes::DisputeResponse> { + let dispute = state + .store + .find_dispute_by_merchant_id_dispute_id(&merchant_account.merchant_id, &req.dispute_id) + .await + .map_err(|error| { + error.to_not_found_response(errors::ApiErrorResponse::DisputeNotFound { + dispute_id: req.dispute_id, + }) + })?; + let dispute_response = api_models::disputes::DisputeResponse::foreign_from(dispute); + Ok(services::ApplicationResponse::Json(dispute_response)) +} + +#[instrument(skip(state))] +pub async fn retrieve_disputes_list( + state: &AppState, + merchant_account: storage::MerchantAccount, + constraints: api_models::disputes::DisputeListConstraints, +) -> RouterResponse<Vec<api_models::disputes::DisputeResponse>> { + let disputes = state + .store + .find_disputes_by_merchant_id(&merchant_account.merchant_id, constraints) + .await + .map_err(|error| { + error.to_not_found_response(errors::ApiErrorResponse::InternalServerError) + })?; + let disputes_list = disputes + .into_iter() + .map(api_models::disputes::DisputeResponse::foreign_from) + .collect(); + Ok(services::ApplicationResponse::Json(disputes_list)) +} diff --git a/crates/router/src/core/errors/api_error_response.rs b/crates/router/src/core/errors/api_error_response.rs index 03fa816c400..79a021fcf1b 100644 --- a/crates/router/src/core/errors/api_error_response.rs +++ b/crates/router/src/core/errors/api_error_response.rs @@ -158,6 +158,8 @@ pub enum ApiErrorResponse { IncorrectConnectorNameGiven, #[error(error_type = ErrorType::ObjectNotFound, code = "HE_04", message = "Address does not exist in our records")] AddressNotFound, + #[error(error_type = ErrorType::ObjectNotFound, code = "HE_04", message = "Dispute does not exist in our records")] + DisputeNotFound { dispute_id: String }, #[error(error_type = ErrorType::InvalidRequestError, code = "HE_04", message = "Card with the provided iin does not exist")] InvalidCardIin, #[error(error_type = ErrorType::InvalidRequestError, code = "HE_04", message = "The provided card IIN length is invalid, please provide an iin with 6 or 8 digits")] @@ -253,7 +255,8 @@ impl actix_web::ResponseError for ApiErrorResponse { Self::DuplicateMerchantAccount | Self::DuplicateMerchantConnectorAccount | Self::DuplicatePaymentMethod - | Self::DuplicateMandate => StatusCode::BAD_REQUEST, // 400 + | Self::DuplicateMandate + | Self::DisputeNotFound { .. } => StatusCode::BAD_REQUEST, // 400 Self::ReturnUrlUnavailable => StatusCode::SERVICE_UNAVAILABLE, // 503 Self::PaymentNotSucceeded => StatusCode::BAD_REQUEST, // 400 Self::NotImplemented { .. } => StatusCode::NOT_IMPLEMENTED, // 501 @@ -444,6 +447,9 @@ impl common_utils::errors::ErrorSwitch<api_models::errors::types::ApiErrorRespon Self::FlowNotSupported { flow, connector } => { AER::BadRequest(ApiError::new("IR", 20, format!("{flow} flow not supported"), Some(Extra {connector: Some(connector.to_owned()), ..Default::default()}))) //FIXME: error message }, + Self::DisputeNotFound { .. } => { + AER::NotFound(ApiError::new("HE", 2, "Dispute does not exist in our records", None)) + }, } } } diff --git a/crates/router/src/core/webhooks.rs b/crates/router/src/core/webhooks.rs index 359937bde33..34c2a77704f 100644 --- a/crates/router/src/core/webhooks.rs +++ b/crates/router/src/core/webhooks.rs @@ -228,9 +228,9 @@ async fn get_or_update_dispute_object( option_dispute: Option<storage_models::dispute::Dispute>, dispute_details: api::disputes::DisputePayload, merchant_id: &str, - payment_id: &str, - attempt_id: &str, + payment_attempt: &storage_models::payment_attempt::PaymentAttempt, event_type: api_models::webhooks::IncomingWebhookEvent, + connector_name: &str, ) -> CustomResult<storage_models::dispute::Dispute, errors::WebhooksFlowError> { let db = &*state.store; match option_dispute { @@ -246,8 +246,9 @@ async fn get_or_update_dispute_object( .foreign_try_into() .into_report() .change_context(errors::WebhooksFlowError::DisputeCoreFailed)?, - payment_id: payment_id.to_owned(), - attempt_id: attempt_id.to_owned(), + payment_id: payment_attempt.payment_id.to_owned(), + connector: connector_name.to_owned(), + attempt_id: payment_attempt.attempt_id.to_owned(), merchant_id: merchant_id.to_owned(), connector_status: dispute_details.connector_status, connector_dispute_id: dispute_details.connector_dispute_id, @@ -327,18 +328,12 @@ async fn disputes_incoming_webhook_flow<W: api::OutgoingWebhookType>( option_dispute, dispute_details, &merchant_account.merchant_id, - &payment_attempt.payment_id, - &payment_attempt.attempt_id, + &payment_attempt, event_type.clone(), + connector.id(), ) .await?; - let disputes_response = Box::new( - dispute_object - .clone() - .foreign_try_into() - .into_report() - .change_context(errors::WebhooksFlowError::DisputeCoreFailed)?, - ); + let disputes_response = Box::new(dispute_object.clone().foreign_into()); let event_type: enums::EventType = dispute_object .dispute_status .foreign_try_into() diff --git a/crates/router/src/db/dispute.rs b/crates/router/src/db/dispute.rs index d4ea14d135d..596ec20bb0c 100644 --- a/crates/router/src/db/dispute.rs +++ b/crates/router/src/db/dispute.rs @@ -4,7 +4,7 @@ use super::{MockDb, Store}; use crate::{ connection, core::errors::{self, CustomResult}, - types::storage, + types::storage::{self, DisputeDbExt}, }; #[async_trait::async_trait] @@ -21,6 +21,18 @@ pub trait DisputeInterface { connector_dispute_id: &str, ) -> CustomResult<Option<storage::Dispute>, errors::StorageError>; + async fn find_dispute_by_merchant_id_dispute_id( + &self, + merchant_id: &str, + dispute_id: &str, + ) -> CustomResult<storage::Dispute, errors::StorageError>; + + async fn find_disputes_by_merchant_id( + &self, + merchant_id: &str, + dispute_constraints: api_models::disputes::DisputeListConstraints, + ) -> CustomResult<Vec<storage::Dispute>, errors::StorageError>; + async fn update_dispute( &self, this: storage::Dispute, @@ -60,6 +72,30 @@ impl DisputeInterface for Store { .into_report() } + async fn find_dispute_by_merchant_id_dispute_id( + &self, + merchant_id: &str, + dispute_id: &str, + ) -> CustomResult<storage::Dispute, errors::StorageError> { + let conn = connection::pg_connection_read(self).await?; + storage::Dispute::find_by_merchant_id_dispute_id(&conn, merchant_id, dispute_id) + .await + .map_err(Into::into) + .into_report() + } + + async fn find_disputes_by_merchant_id( + &self, + merchant_id: &str, + dispute_constraints: api_models::disputes::DisputeListConstraints, + ) -> CustomResult<Vec<storage::Dispute>, errors::StorageError> { + let conn = connection::pg_connection_read(self).await?; + storage::Dispute::filter_by_constraints(&conn, merchant_id, dispute_constraints) + .await + .map_err(Into::into) + .into_report() + } + async fn update_dispute( &self, this: storage::Dispute, @@ -92,6 +128,24 @@ impl DisputeInterface for MockDb { Err(errors::StorageError::MockDbError)? } + async fn find_dispute_by_merchant_id_dispute_id( + &self, + _merchant_id: &str, + _dispute_id: &str, + ) -> CustomResult<storage::Dispute, errors::StorageError> { + // TODO: Implement function for `MockDb` + Err(errors::StorageError::MockDbError)? + } + + async fn find_disputes_by_merchant_id( + &self, + _merchant_id: &str, + _dispute_constraints: api_models::disputes::DisputeListConstraints, + ) -> CustomResult<Vec<storage::Dispute>, errors::StorageError> { + // TODO: Implement function for `MockDb` + Err(errors::StorageError::MockDbError)? + } + async fn update_dispute( &self, _this: storage::Dispute, diff --git a/crates/router/src/lib.rs b/crates/router/src/lib.rs index b38a7c23f12..4c61d25b997 100644 --- a/crates/router/src/lib.rs +++ b/crates/router/src/lib.rs @@ -115,7 +115,8 @@ pub fn mk_app( { server_app = server_app .service(routes::MerchantAccount::server(state.clone())) - .service(routes::ApiKeys::server(state.clone())); + .service(routes::ApiKeys::server(state.clone())) + .service(routes::Disputes::server(state.clone())); } #[cfg(feature = "stripe")] diff --git a/crates/router/src/openapi.rs b/crates/router/src/openapi.rs index 2cb824d463e..35e3cc9db6a 100644 --- a/crates/router/src/openapi.rs +++ b/crates/router/src/openapi.rs @@ -57,6 +57,7 @@ Never share your secret api keys. Keep them guarded and secure. (name = "Mandates", description = "Manage mandates"), (name = "Customers", description = "Create and manage customers"), (name = "Payment Methods", description = "Create and manage payment methods of customers"), + (name = "Disputes", description = "Manage disputes"), // (name = "API Key", description = "Create and manage API Keys"), ), paths( @@ -100,6 +101,8 @@ Never share your secret api keys. Keep them guarded and secure. // crate::routes::api_keys::api_key_update, // crate::routes::api_keys::api_key_revoke, // crate::routes::api_keys::api_key_list, + crate::routes::disputes::retrieve_disputes_list, + crate::routes::disputes::retrieve_dispute, ), components(schemas( crate::types::api::refunds::RefundRequest, @@ -143,9 +146,12 @@ Never share your secret api keys. Keep them guarded and secure. api_models::enums::PaymentExperience, api_models::enums::BankNames, api_models::enums::CardNetwork, + api_models::enums::DisputeStage, + api_models::enums::DisputeStatus, api_models::enums::CountryCode, api_models::admin::MerchantConnector, api_models::admin::PaymentMethodsEnabled, + api_models::disputes::DisputeResponse, api_models::payments::AddressDetails, api_models::payments::Address, api_models::payments::BankRedirectData, diff --git a/crates/router/src/routes.rs b/crates/router/src/routes.rs index 915e68a3ebd..f0a19e42671 100644 --- a/crates/router/src/routes.rs +++ b/crates/router/src/routes.rs @@ -4,6 +4,7 @@ pub mod app; pub mod cards_info; pub mod configs; pub mod customers; +pub mod disputes; pub mod ephemeral_key; pub mod health; pub mod mandates; @@ -15,8 +16,9 @@ pub mod refunds; pub mod webhooks; pub use self::app::{ - ApiKeys, AppState, Cards, Configs, Customers, EphemeralKey, Health, Mandates, MerchantAccount, - MerchantConnectorAccount, PaymentMethods, Payments, Payouts, Refunds, Webhooks, + ApiKeys, AppState, Cards, Configs, Customers, Disputes, EphemeralKey, Health, Mandates, + MerchantAccount, MerchantConnectorAccount, PaymentMethods, Payments, Payouts, Refunds, + Webhooks, }; #[cfg(feature = "stripe")] pub use super::compatibility::stripe::StripeApis; diff --git a/crates/router/src/routes/app.rs b/crates/router/src/routes/app.rs index f747d1281dd..0634dc9f788 100644 --- a/crates/router/src/routes/app.rs +++ b/crates/router/src/routes/app.rs @@ -2,7 +2,7 @@ use actix_web::{web, Scope}; use super::health::*; #[cfg(feature = "olap")] -use super::{admin::*, api_keys::*}; +use super::{admin::*, api_keys::*, disputes::*}; #[cfg(any(feature = "olap", feature = "oltp"))] use super::{configs::*, customers::*, mandates::*, payments::*, payouts::*, refunds::*}; #[cfg(feature = "oltp")] @@ -379,6 +379,18 @@ impl ApiKeys { } } +pub struct Disputes; + +#[cfg(feature = "olap")] +impl Disputes { + pub fn server(state: AppState) -> Scope { + web::scope("/disputes") + .app_data(web::Data::new(state)) + .service(web::resource("/list").route(web::get().to(retrieve_disputes_list))) + .service(web::resource("/{dispute_id}").route(web::get().to(retrieve_dispute))) + } +} + pub struct Cards; impl Cards { diff --git a/crates/router/src/routes/disputes.rs b/crates/router/src/routes/disputes.rs new file mode 100644 index 00000000000..95ffd9852fa --- /dev/null +++ b/crates/router/src/routes/disputes.rs @@ -0,0 +1,89 @@ +use actix_web::{web, HttpRequest, HttpResponse}; +use api_models::disputes::DisputeListConstraints; +use router_env::{instrument, tracing, Flow}; + +use super::app::AppState; +use crate::{ + core::disputes, + services::{api, authentication as auth}, + types::api::disputes as dispute_types, +}; + +/// Diputes - Retrieve Dispute +#[utoipa::path( + get, + path = "/disputes/{dispute_id}", + params( + ("dispute_id" = String, Path, description = "The identifier for dispute") + ), + responses( + (status = 200, description = "The dispute was retrieved successfully", body = DisputeResponse), + (status = 404, description = "Dispute does not exist in our records") + ), + tag = "Disputes", + operation_id = "Retrieve a Dispute", + security(("api_key" = [])) +)] +#[instrument(skip_all, fields(flow = ?Flow::DisputesRetrieve))] +pub async fn retrieve_dispute( + state: web::Data<AppState>, + req: HttpRequest, + path: web::Path<String>, +) -> HttpResponse { + let flow = Flow::DisputesRetrieve; + let dispute_id = dispute_types::DisputeId { + dispute_id: path.into_inner(), + }; + api::server_wrap( + flow, + state.get_ref(), + &req, + dispute_id, + disputes::retrieve_dispute, + auth::auth_type(&auth::ApiKeyAuth, &auth::JWTAuth, req.headers()), + ) + .await +} + +/// Diputes - List Disputes +#[utoipa::path( + get, + path = "/disputes/list", + params( + ("limit" = Option<i64>, Query, description = "The maximum number of Dispute Objects to include in the response"), + ("dispute_status" = Option<DisputeStatus>, Query, description = "The status of dispute"), + ("dispute_stage" = Option<DisputeStage>, Query, description = "The stage of dispute"), + ("reason" = Option<String>, Query, description = "The reason for dispute"), + ("connector" = Option<String>, Query, description = "The connector linked to dispute"), + ("received_time" = Option<PrimitiveDateTime>, Query, description = "The time at which dispute is received"), + ("received_time.lt" = Option<PrimitiveDateTime>, Query, description = "Time less than the dispute received time"), + ("received_time.gt" = Option<PrimitiveDateTime>, Query, description = "Time greater than the dispute received time"), + ("received_time.lte" = Option<PrimitiveDateTime>, Query, description = "Time less than or equals to the dispute received time"), + ("received_time.gte" = Option<PrimitiveDateTime>, Query, description = "Time greater than or equals to the dispute received time"), + ), + responses( + (status = 200, description = "The dispute list was retrieved successfully", body = Vec<DisputeResponse>), + (status = 401, description = "Unauthorized request") + ), + tag = "Disputes", + operation_id = "List Disputes", + security(("api_key" = [])) +)] +#[instrument(skip_all, fields(flow = ?Flow::DisputesList))] +pub async fn retrieve_disputes_list( + state: web::Data<AppState>, + req: HttpRequest, + payload: web::Query<DisputeListConstraints>, +) -> HttpResponse { + let flow = Flow::DisputesList; + let payload = payload.into_inner(); + api::server_wrap( + flow, + state.get_ref(), + &req, + payload, + disputes::retrieve_disputes_list, + auth::auth_type(&auth::ApiKeyAuth, &auth::JWTAuth, req.headers()), + ) + .await +} diff --git a/crates/router/src/services/authentication.rs b/crates/router/src/services/authentication.rs index 9ad9de25ae9..34a6e8b744f 100644 --- a/crates/router/src/services/authentication.rs +++ b/crates/router/src/services/authentication.rs @@ -391,3 +391,16 @@ pub fn strip_jwt_token(token: &str) -> RouterResult<&str> { .strip_prefix("Bearer ") .ok_or_else(|| errors::ApiErrorResponse::InvalidJwtToken.into()) } + +pub fn auth_type<'a, T, A>( + default_auth: &'a dyn AuthenticateAndFetch<T, A>, + jwt_auth_type: &'a dyn AuthenticateAndFetch<T, A>, + headers: &HeaderMap, +) -> &'a dyn AuthenticateAndFetch<T, A> +where +{ + if is_jwt_auth(headers) { + return jwt_auth_type; + } + default_auth +} diff --git a/crates/router/src/types/api.rs b/crates/router/src/types/api.rs index c7468b88b5b..1cfb5e33de2 100644 --- a/crates/router/src/types/api.rs +++ b/crates/router/src/types/api.rs @@ -15,8 +15,8 @@ use std::{fmt::Debug, str::FromStr}; use error_stack::{report, IntoReport, ResultExt}; pub use self::{ - admin::*, api_keys::*, configs::*, customers::*, payment_methods::*, payments::*, refunds::*, - webhooks::*, + admin::*, api_keys::*, configs::*, customers::*, disputes::*, payment_methods::*, payments::*, + refunds::*, webhooks::*, }; use super::ErrorResponse; use crate::{ diff --git a/crates/router/src/types/api/disputes.rs b/crates/router/src/types/api/disputes.rs index aba9a915fd9..bd0f3b4b921 100644 --- a/crates/router/src/types/api/disputes.rs +++ b/crates/router/src/types/api/disputes.rs @@ -1,4 +1,9 @@ -use masking::Deserialize; +use masking::{Deserialize, Serialize}; + +#[derive(Default, Debug, Deserialize, Serialize)] +pub struct DisputeId { + pub dispute_id: String, +} #[derive(Default, Debug, Deserialize)] pub struct DisputePayload { diff --git a/crates/router/src/types/storage/dispute.rs b/crates/router/src/types/storage/dispute.rs index 5052feaa276..c85363aae86 100644 --- a/crates/router/src/types/storage/dispute.rs +++ b/crates/router/src/types/storage/dispute.rs @@ -1 +1,75 @@ +use async_bb8_diesel::AsyncRunQueryDsl; +use common_utils::errors::CustomResult; +use diesel::{associations::HasTable, ExpressionMethods, QueryDsl}; +use error_stack::{IntoReport, ResultExt}; pub use storage_models::dispute::{Dispute, DisputeNew, DisputeUpdate}; +use storage_models::{errors, schema::dispute::dsl}; + +use crate::{connection::PgPooledConn, logger, types::transformers::ForeignInto}; + +#[async_trait::async_trait] +pub trait DisputeDbExt: Sized { + async fn filter_by_constraints( + conn: &PgPooledConn, + merchant_id: &str, + dispute_list_constraints: api_models::disputes::DisputeListConstraints, + ) -> CustomResult<Vec<Self>, errors::DatabaseError>; +} + +#[async_trait::async_trait] +impl DisputeDbExt for Dispute { + async fn filter_by_constraints( + conn: &PgPooledConn, + merchant_id: &str, + dispute_list_constraints: api_models::disputes::DisputeListConstraints, + ) -> CustomResult<Vec<Self>, errors::DatabaseError> { + let mut filter = <Self as HasTable>::table() + .filter(dsl::merchant_id.eq(merchant_id.to_owned())) + .order(dsl::modified_at.desc()) + .into_boxed(); + + if let Some(received_time) = dispute_list_constraints.received_time { + filter = filter.filter(dsl::created_at.eq(received_time)); + } + if let Some(received_time_lt) = dispute_list_constraints.received_time_lt { + filter = filter.filter(dsl::created_at.lt(received_time_lt)); + } + if let Some(received_time_gt) = dispute_list_constraints.received_time_gt { + filter = filter.filter(dsl::created_at.gt(received_time_gt)); + } + if let Some(received_time_lte) = dispute_list_constraints.received_time_lte { + filter = filter.filter(dsl::created_at.le(received_time_lte)); + } + if let Some(received_time_gte) = dispute_list_constraints.received_time_gte { + filter = filter.filter(dsl::created_at.ge(received_time_gte)); + } + if let Some(connector) = dispute_list_constraints.connector { + filter = filter.filter(dsl::connector.eq(connector)); + } + if let Some(reason) = dispute_list_constraints.reason { + filter = filter.filter(dsl::connector_reason.eq(reason)); + } + if let Some(dispute_stage) = dispute_list_constraints.dispute_stage { + let storage_dispute_stage: storage_models::enums::DisputeStage = + dispute_stage.foreign_into(); + filter = filter.filter(dsl::dispute_stage.eq(storage_dispute_stage)); + } + if let Some(dispute_status) = dispute_list_constraints.dispute_status { + let storage_dispute_status: storage_models::enums::DisputeStatus = + dispute_status.foreign_into(); + filter = filter.filter(dsl::dispute_status.eq(storage_dispute_status)); + } + if let Some(limit) = dispute_list_constraints.limit { + filter = filter.limit(limit); + } + + logger::debug!(query = %diesel::debug_query::<diesel::pg::Pg, _>(&filter).to_string()); + + filter + .get_results_async(conn) + .await + .into_report() + .change_context(errors::DatabaseError::NotFound) + .attach_printable_lazy(|| "Error filtering records by predicate") + } +} diff --git a/crates/router/src/types/transformers.rs b/crates/router/src/types/transformers.rs index 54a8547e309..80857ddfb89 100644 --- a/crates/router/src/types/transformers.rs +++ b/crates/router/src/types/transformers.rs @@ -514,11 +514,9 @@ impl ForeignTryFrom<api_models::webhooks::IncomingWebhookEvent> for storage_enum } } -impl ForeignTryFrom<storage::Dispute> for api_models::disputes::DisputeResponse { - type Error = errors::ValidationError; - - fn foreign_try_from(dispute: storage::Dispute) -> Result<Self, Self::Error> { - Ok(Self { +impl ForeignFrom<storage::Dispute> for api_models::disputes::DisputeResponse { + fn foreign_from(dispute: storage::Dispute) -> Self { + Self { dispute_id: dispute.dispute_id, payment_id: dispute.payment_id, attempt_id: dispute.attempt_id, @@ -526,6 +524,7 @@ impl ForeignTryFrom<storage::Dispute> for api_models::disputes::DisputeResponse currency: dispute.currency, dispute_stage: dispute.dispute_stage.foreign_into(), dispute_status: dispute.dispute_status.foreign_into(), + connector: dispute.connector, connector_status: dispute.connector_status, connector_dispute_id: dispute.connector_dispute_id, connector_reason: dispute.connector_reason, @@ -534,7 +533,7 @@ impl ForeignTryFrom<storage::Dispute> for api_models::disputes::DisputeResponse created_at: dispute.dispute_created_at, updated_at: dispute.updated_at, received_at: dispute.created_at.to_string(), - }) + } } } diff --git a/crates/router_env/src/logger/types.rs b/crates/router_env/src/logger/types.rs index 94385438392..2addcf3a70c 100644 --- a/crates/router_env/src/logger/types.rs +++ b/crates/router_env/src/logger/types.rs @@ -162,6 +162,10 @@ pub enum Flow { ApiKeyRevoke, /// API Key list flow ApiKeyList, + /// Dispute Retrieve flow + DisputesRetrieve, + /// Dispute List flow + DisputesList, /// Cards Info flow CardsInfo, } diff --git a/crates/storage_models/src/dispute.rs b/crates/storage_models/src/dispute.rs index ec70ca24263..5b4e48601a1 100644 --- a/crates/storage_models/src/dispute.rs +++ b/crates/storage_models/src/dispute.rs @@ -17,6 +17,7 @@ pub struct DisputeNew { pub payment_id: String, pub attempt_id: String, pub merchant_id: String, + pub connector: String, pub connector_status: String, pub connector_dispute_id: String, pub connector_reason: Option<String>, @@ -50,6 +51,7 @@ pub struct Dispute { pub created_at: PrimitiveDateTime, #[serde(with = "custom_serde::iso8601")] pub modified_at: PrimitiveDateTime, + pub connector: String, } #[derive(Debug)] diff --git a/crates/storage_models/src/query/dispute.rs b/crates/storage_models/src/query/dispute.rs index a61a58bc8e6..5738e297987 100644 --- a/crates/storage_models/src/query/dispute.rs +++ b/crates/storage_models/src/query/dispute.rs @@ -34,6 +34,20 @@ impl Dispute { .await } + pub async fn find_by_merchant_id_dispute_id( + conn: &PgPooledConn, + merchant_id: &str, + dispute_id: &str, + ) -> StorageResult<Self> { + generics::generic_find_one::<<Self as HasTable>::Table, _, _>( + conn, + dsl::merchant_id + .eq(merchant_id.to_owned()) + .and(dsl::dispute_id.eq(dispute_id.to_owned())), + ) + .await + } + #[instrument(skip(conn))] pub async fn update(self, conn: &PgPooledConn, dispute: DisputeUpdate) -> StorageResult<Self> { match generics::generic_update_with_unique_predicate_get_result::< diff --git a/crates/storage_models/src/schema.rs b/crates/storage_models/src/schema.rs index 1a2992f2b7b..4932246edc4 100644 --- a/crates/storage_models/src/schema.rs +++ b/crates/storage_models/src/schema.rs @@ -132,6 +132,7 @@ diesel::table! { updated_at -> Nullable<Varchar>, created_at -> Timestamp, modified_at -> Timestamp, + connector -> Varchar, } } diff --git a/migrations/2023-03-15-185959_add_dispute_table/up.sql b/migrations/2023-03-15-185959_add_dispute_table/up.sql index 046186d753d..6255ef1457f 100644 --- a/migrations/2023-03-15-185959_add_dispute_table/up.sql +++ b/migrations/2023-03-15-185959_add_dispute_table/up.sql @@ -23,7 +23,7 @@ CREATE TABLE dispute ( modified_at TIMESTAMP NOT NULL DEFAULT now()::TIMESTAMP ); -CREATE UNIQUE INDEX dispute_id_index ON dispute (dispute_id); +CREATE UNIQUE INDEX merchant_id_dispute_id_index ON dispute (merchant_id, dispute_id); CREATE UNIQUE INDEX merchant_id_payment_id_connector_dispute_id_index ON dispute (merchant_id, payment_id, connector_dispute_id); diff --git a/migrations/2023-04-06-063047_add_connector_col_in_dispute/down.sql b/migrations/2023-04-06-063047_add_connector_col_in_dispute/down.sql new file mode 100644 index 00000000000..fffb385707f --- /dev/null +++ b/migrations/2023-04-06-063047_add_connector_col_in_dispute/down.sql @@ -0,0 +1 @@ +ALTER TABLE dispute DROP COLUMN connector; \ No newline at end of file diff --git a/migrations/2023-04-06-063047_add_connector_col_in_dispute/up.sql b/migrations/2023-04-06-063047_add_connector_col_in_dispute/up.sql new file mode 100644 index 00000000000..252e9cd9629 --- /dev/null +++ b/migrations/2023-04-06-063047_add_connector_col_in_dispute/up.sql @@ -0,0 +1,3 @@ +-- Your SQL goes here +ALTER TABLE dispute +ADD COLUMN connector VARCHAR(255) NOT NULL; \ No newline at end of file
feat
added dispute retrieve and dispute list apis (#842)
03b936a117ae0931fab800cb82038ba45aa6f9a3
2024-12-05 14:38:23
Sarthak Soni
feat(routing): Enable volume split for dynamic routing (#6662)
false
diff --git a/config/development.toml b/config/development.toml index eef44648c6c..4e3a9b09993 100644 --- a/config/development.toml +++ b/config/development.toml @@ -790,9 +790,10 @@ card_networks = "Visa, AmericanExpress, Mastercard" [network_tokenization_supported_connectors] connector_list = "cybersource" -[grpc_client.dynamic_routing_client] -host = "localhost" -port = 7000 +[grpc_client.dynamic_routing_client] +host = "localhost" +port = 7000 +service = "dynamo" [theme_storage] file_storage_backend = "file_system" diff --git a/crates/api_models/src/events/routing.rs b/crates/api_models/src/events/routing.rs index 87e7fa27885..f3e169336bf 100644 --- a/crates/api_models/src/events/routing.rs +++ b/crates/api_models/src/events/routing.rs @@ -4,9 +4,9 @@ use crate::routing::{ LinkedRoutingConfigRetrieveResponse, MerchantRoutingAlgorithm, ProfileDefaultRoutingConfig, RoutingAlgorithmId, RoutingConfigRequest, RoutingDictionaryRecord, RoutingKind, RoutingLinkWrapper, RoutingPayloadWrapper, RoutingRetrieveLinkQuery, - RoutingRetrieveLinkQueryWrapper, RoutingRetrieveQuery, SuccessBasedRoutingConfig, - SuccessBasedRoutingPayloadWrapper, SuccessBasedRoutingUpdateConfigQuery, - ToggleDynamicRoutingQuery, ToggleDynamicRoutingWrapper, + RoutingRetrieveLinkQueryWrapper, RoutingRetrieveQuery, RoutingVolumeSplitWrapper, + SuccessBasedRoutingConfig, SuccessBasedRoutingPayloadWrapper, + SuccessBasedRoutingUpdateConfigQuery, ToggleDynamicRoutingQuery, ToggleDynamicRoutingWrapper, }; impl ApiEventMetric for RoutingKind { @@ -108,3 +108,9 @@ impl ApiEventMetric for SuccessBasedRoutingUpdateConfigQuery { Some(ApiEventsType::Routing) } } + +impl ApiEventMetric for RoutingVolumeSplitWrapper { + fn get_api_event_type(&self) -> Option<ApiEventsType> { + Some(ApiEventsType::Routing) + } +} diff --git a/crates/api_models/src/routing.rs b/crates/api_models/src/routing.rs index 6cd5d5251a3..c4c2f072b1e 100644 --- a/crates/api_models/src/routing.rs +++ b/crates/api_models/src/routing.rs @@ -522,6 +522,7 @@ pub struct DynamicAlgorithmWithTimestamp<T> { #[derive(Debug, Default, Clone, serde::Serialize, serde::Deserialize)] pub struct DynamicRoutingAlgorithmRef { pub success_based_algorithm: Option<SuccessBasedAlgorithm>, + pub dynamic_routing_volume_split: Option<u8>, pub elimination_routing_algorithm: Option<EliminationRoutingAlgorithm>, } @@ -554,32 +555,6 @@ impl DynamicRoutingAlgoAccessor for EliminationRoutingAlgorithm { } } -impl EliminationRoutingAlgorithm { - pub fn new( - algorithm_id_with_timestamp: DynamicAlgorithmWithTimestamp< - common_utils::id_type::RoutingId, - >, - ) -> Self { - Self { - algorithm_id_with_timestamp, - enabled_feature: DynamicRoutingFeatures::None, - } - } -} - -impl SuccessBasedAlgorithm { - pub fn new( - algorithm_id_with_timestamp: DynamicAlgorithmWithTimestamp< - common_utils::id_type::RoutingId, - >, - ) -> Self { - Self { - algorithm_id_with_timestamp, - enabled_feature: DynamicRoutingFeatures::None, - } - } -} - impl DynamicRoutingAlgorithmRef { pub fn update(&mut self, new: Self) { if let Some(elimination_routing_algorithm) = new.elimination_routing_algorithm { @@ -608,8 +583,63 @@ impl DynamicRoutingAlgorithmRef { } } } + + pub fn update_volume_split(&mut self, volume: Option<u8>) { + self.dynamic_routing_volume_split = volume + } +} + +impl EliminationRoutingAlgorithm { + pub fn new( + algorithm_id_with_timestamp: DynamicAlgorithmWithTimestamp< + common_utils::id_type::RoutingId, + >, + ) -> Self { + Self { + algorithm_id_with_timestamp, + enabled_feature: DynamicRoutingFeatures::None, + } + } +} + +impl SuccessBasedAlgorithm { + pub fn new( + algorithm_id_with_timestamp: DynamicAlgorithmWithTimestamp< + common_utils::id_type::RoutingId, + >, + ) -> Self { + Self { + algorithm_id_with_timestamp, + enabled_feature: DynamicRoutingFeatures::None, + } + } +} + +#[derive(Debug, Default, Clone, Copy, serde::Serialize, serde::Deserialize)] +pub struct RoutingVolumeSplit { + pub routing_type: RoutingType, + pub split: u8, } +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] +pub struct RoutingVolumeSplitWrapper { + pub routing_info: RoutingVolumeSplit, + pub profile_id: common_utils::id_type::ProfileId, +} + +#[derive(Debug, Default, Clone, Copy, serde::Serialize, serde::Deserialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum RoutingType { + #[default] + Static, + Dynamic, +} + +impl RoutingType { + pub fn is_dynamic_routing(self) -> bool { + self == Self::Dynamic + } +} #[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] pub struct SuccessBasedAlgorithm { pub algorithm_id_with_timestamp: @@ -673,6 +703,11 @@ pub struct ToggleDynamicRoutingQuery { pub enable: DynamicRoutingFeatures, } +#[derive(Debug, Clone, Copy, serde::Serialize, serde::Deserialize, ToSchema)] +pub struct DynamicRoutingVolumeSplitQuery { + pub split: u8, +} + #[derive(Debug, Default, Clone, serde::Serialize, serde::Deserialize, PartialEq, Eq, ToSchema)] #[serde(rename_all = "snake_case")] pub enum DynamicRoutingFeatures { diff --git a/crates/router/src/consts.rs b/crates/router/src/consts.rs index 2c02b8b1483..bf78424c9d2 100644 --- a/crates/router/src/consts.rs +++ b/crates/router/src/consts.rs @@ -208,3 +208,6 @@ pub const VAULT_DELETE_FLOW_TYPE: &str = "delete_from_vault"; /// Vault Fingerprint fetch flow type #[cfg(all(feature = "v2", feature = "payment_methods_v2"))] pub const VAULT_GET_FINGERPRINT_FLOW_TYPE: &str = "get_fingerprint_vault"; + +/// Max volume split for Dynamic routing +pub const DYNAMIC_ROUTING_MAX_VOLUME: u8 = 100; diff --git a/crates/router/src/core/payments.rs b/crates/router/src/core/payments.rs index fd9eaaa9c77..1dd9400b8bc 100644 --- a/crates/router/src/core/payments.rs +++ b/crates/router/src/core/payments.rs @@ -6026,47 +6026,75 @@ where // dynamic success based connector selection #[cfg(all(feature = "v1", feature = "dynamic_routing"))] let connectors = { - if business_profile.dynamic_routing_algorithm.is_some() { - let success_based_routing_config_params_interpolator = - routing_helpers::SuccessBasedRoutingConfigParamsInterpolator::new( - payment_data.get_payment_attempt().payment_method, - payment_data.get_payment_attempt().payment_method_type, - payment_data.get_payment_attempt().authentication_type, - payment_data.get_payment_attempt().currency, - payment_data - .get_billing_address() - .and_then(|address| address.address) - .and_then(|address| address.country), - payment_data - .get_payment_attempt() - .payment_method_data - .as_ref() - .and_then(|data| data.as_object()) - .and_then(|card| card.get("card")) - .and_then(|data| data.as_object()) - .and_then(|card| card.get("card_network")) - .and_then(|network| network.as_str()) - .map(|network| network.to_string()), - payment_data - .get_payment_attempt() - .payment_method_data - .as_ref() - .and_then(|data| data.as_object()) - .and_then(|card| card.get("card")) - .and_then(|data| data.as_object()) - .and_then(|card| card.get("card_isin")) - .and_then(|card_isin| card_isin.as_str()) - .map(|card_isin| card_isin.to_string()), - ); - routing::perform_success_based_routing( - state, - connectors.clone(), - business_profile, - success_based_routing_config_params_interpolator, - ) - .await - .map_err(|e| logger::error!(success_rate_routing_error=?e)) - .unwrap_or(connectors) + if let Some(algo) = business_profile.dynamic_routing_algorithm.clone() { + let dynamic_routing_config: api_models::routing::DynamicRoutingAlgorithmRef = algo + .parse_value("DynamicRoutingAlgorithmRef") + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("unable to deserialize DynamicRoutingAlgorithmRef from JSON")?; + let dynamic_split = api_models::routing::RoutingVolumeSplit { + routing_type: api_models::routing::RoutingType::Dynamic, + split: dynamic_routing_config + .dynamic_routing_volume_split + .unwrap_or_default(), + }; + let static_split: api_models::routing::RoutingVolumeSplit = + api_models::routing::RoutingVolumeSplit { + routing_type: api_models::routing::RoutingType::Static, + split: crate::consts::DYNAMIC_ROUTING_MAX_VOLUME + - dynamic_routing_config + .dynamic_routing_volume_split + .unwrap_or_default(), + }; + let volume_split_vec = vec![dynamic_split, static_split]; + let routing_choice = + routing::perform_dynamic_routing_volume_split(volume_split_vec, None) + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("failed to perform volume split on routing type")?; + + if routing_choice.routing_type.is_dynamic_routing() { + let success_based_routing_config_params_interpolator = + routing_helpers::SuccessBasedRoutingConfigParamsInterpolator::new( + payment_data.get_payment_attempt().payment_method, + payment_data.get_payment_attempt().payment_method_type, + payment_data.get_payment_attempt().authentication_type, + payment_data.get_payment_attempt().currency, + payment_data + .get_billing_address() + .and_then(|address| address.address) + .and_then(|address| address.country), + payment_data + .get_payment_attempt() + .payment_method_data + .as_ref() + .and_then(|data| data.as_object()) + .and_then(|card| card.get("card")) + .and_then(|data| data.as_object()) + .and_then(|card| card.get("card_network")) + .and_then(|network| network.as_str()) + .map(|network| network.to_string()), + payment_data + .get_payment_attempt() + .payment_method_data + .as_ref() + .and_then(|data| data.as_object()) + .and_then(|card| card.get("card")) + .and_then(|data| data.as_object()) + .and_then(|card| card.get("card_isin")) + .and_then(|card_isin| card_isin.as_str()) + .map(|card_isin| card_isin.to_string()), + ); + routing::perform_success_based_routing( + state, + connectors.clone(), + business_profile, + success_based_routing_config_params_interpolator, + ) + .await + .map_err(|e| logger::error!(success_rate_routing_error=?e)) + .unwrap_or(connectors) + } else { + connectors + } } else { connectors } diff --git a/crates/router/src/core/payments/routing.rs b/crates/router/src/core/payments/routing.rs index 76456c8dbc9..b3be47a8743 100644 --- a/crates/router/src/core/payments/routing.rs +++ b/crates/router/src/core/payments/routing.rs @@ -489,6 +489,36 @@ pub async fn refresh_routing_cache_v1( Ok(arc_cached_algorithm) } +#[cfg(all(feature = "v1", feature = "dynamic_routing"))] +pub fn perform_dynamic_routing_volume_split( + splits: Vec<api_models::routing::RoutingVolumeSplit>, + rng_seed: Option<&str>, +) -> RoutingResult<api_models::routing::RoutingVolumeSplit> { + let weights: Vec<u8> = splits.iter().map(|sp| sp.split).collect(); + let weighted_index = distributions::WeightedIndex::new(weights) + .change_context(errors::RoutingError::VolumeSplitFailed) + .attach_printable("Error creating weighted distribution for volume split")?; + + let idx = if let Some(seed) = rng_seed { + let mut hasher = hash_map::DefaultHasher::new(); + seed.hash(&mut hasher); + let hash = hasher.finish(); + + let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(hash); + weighted_index.sample(&mut rng) + } else { + let mut rng = rand::thread_rng(); + weighted_index.sample(&mut rng) + }; + + let routing_choice = *splits + .get(idx) + .ok_or(errors::RoutingError::VolumeSplitFailed) + .attach_printable("Volume split index lookup failed")?; + + Ok(routing_choice) +} + pub fn perform_volume_split( mut splits: Vec<routing_types::ConnectorVolumeSplit>, rng_seed: Option<&str>, diff --git a/crates/router/src/core/routing.rs b/crates/router/src/core/routing.rs index 9318e0c5b9f..f7a89396397 100644 --- a/crates/router/src/core/routing.rs +++ b/crates/router/src/core/routing.rs @@ -15,7 +15,9 @@ use error_stack::ResultExt; use external_services::grpc_client::dynamic_routing::SuccessBasedDynamicRouting; use hyperswitch_domain_models::{mandates, payment_address}; #[cfg(all(feature = "v1", feature = "dynamic_routing"))] -use router_env::{logger, metrics::add_attributes}; +use router_env::logger; +#[cfg(feature = "v1")] +use router_env::metrics::add_attributes; use rustc_hash::FxHashSet; #[cfg(all(feature = "v1", feature = "dynamic_routing"))] use storage_impl::redis::cache; @@ -1271,6 +1273,69 @@ pub async fn toggle_specific_dynamic_routing( } } +#[cfg(feature = "v1")] +pub async fn configure_dynamic_routing_volume_split( + state: SessionState, + merchant_account: domain::MerchantAccount, + key_store: domain::MerchantKeyStore, + profile_id: common_utils::id_type::ProfileId, + routing_info: routing::RoutingVolumeSplit, +) -> RouterResponse<()> { + metrics::ROUTING_CREATE_REQUEST_RECEIVED.add( + &metrics::CONTEXT, + 1, + &add_attributes([("profile_id", profile_id.get_string_repr().to_owned())]), + ); + let db = state.store.as_ref(); + let key_manager_state = &(&state).into(); + + utils::when( + routing_info.split > crate::consts::DYNAMIC_ROUTING_MAX_VOLUME, + || { + Err(errors::ApiErrorResponse::InvalidRequestData { + message: "Dynamic routing volume split should be less than 100".to_string(), + }) + }, + )?; + + let business_profile: domain::Profile = core_utils::validate_and_get_business_profile( + db, + key_manager_state, + &key_store, + Some(&profile_id), + merchant_account.get_id(), + ) + .await? + .get_required_value("Profile") + .change_context(errors::ApiErrorResponse::ProfileNotFound { + id: profile_id.get_string_repr().to_owned(), + })?; + + let mut dynamic_routing_algo_ref: routing_types::DynamicRoutingAlgorithmRef = business_profile + .dynamic_routing_algorithm + .clone() + .map(|val| val.parse_value("DynamicRoutingAlgorithmRef")) + .transpose() + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable( + "unable to deserialize dynamic routing algorithm ref from business profile", + )? + .unwrap_or_default(); + + dynamic_routing_algo_ref.update_volume_split(Some(routing_info.split)); + + helpers::update_business_profile_active_dynamic_algorithm_ref( + db, + &((&state).into()), + &key_store, + business_profile.clone(), + dynamic_routing_algo_ref.clone(), + ) + .await?; + + Ok(service_api::ApplicationResponse::StatusOk) +} + #[cfg(all(feature = "v1", feature = "dynamic_routing"))] pub async fn success_based_routing_update_configs( state: SessionState, diff --git a/crates/router/src/core/routing/helpers.rs b/crates/router/src/core/routing/helpers.rs index 9dc56b8bd0a..196db63ff1b 100644 --- a/crates/router/src/core/routing/helpers.rs +++ b/crates/router/src/core/routing/helpers.rs @@ -969,6 +969,8 @@ pub async fn disable_dynamic_routing_algorithm( }), elimination_routing_algorithm: dynamic_routing_algo_ref .elimination_routing_algorithm, + dynamic_routing_volume_split: dynamic_routing_algo_ref + .dynamic_routing_volume_split, }, cache_entries_to_redact, ) @@ -999,6 +1001,8 @@ pub async fn disable_dynamic_routing_algorithm( algorithm_id, routing_types::DynamicRoutingAlgorithmRef { success_based_algorithm: dynamic_routing_algo_ref.success_based_algorithm, + dynamic_routing_volume_split: dynamic_routing_algo_ref + .dynamic_routing_volume_split, elimination_routing_algorithm: Some( routing_types::EliminationRoutingAlgorithm { algorithm_id_with_timestamp: diff --git a/crates/router/src/routes/app.rs b/crates/router/src/routes/app.rs index 0fca984cc57..b1e1127787c 100644 --- a/crates/router/src/routes/app.rs +++ b/crates/router/src/routes/app.rs @@ -1784,6 +1784,10 @@ impl Profile { web::resource("/toggle") .route(web::post().to(routing::toggle_elimination_routing)), ), + ) + .service( + web::resource("/set_volume_split") + .route(web::post().to(routing::set_dynamic_routing_volume_split)), ), ); } diff --git a/crates/router/src/routes/lock_utils.rs b/crates/router/src/routes/lock_utils.rs index 1c7db127ffc..762a5227207 100644 --- a/crates/router/src/routes/lock_utils.rs +++ b/crates/router/src/routes/lock_utils.rs @@ -67,7 +67,8 @@ impl From<Flow> for ApiIdentifier { | Flow::DecisionManagerRetrieveConfig | Flow::ToggleDynamicRouting | Flow::UpdateDynamicRoutingConfigs - | Flow::DecisionManagerUpsertConfig => Self::Routing, + | Flow::DecisionManagerUpsertConfig + | Flow::VolumeSplitOnRoutingType => Self::Routing, Flow::RetrieveForexFlow => Self::Forex, diff --git a/crates/router/src/routes/routing.rs b/crates/router/src/routes/routing.rs index d22c5e97490..a9f0bc3a26d 100644 --- a/crates/router/src/routes/routing.rs +++ b/crates/router/src/routes/routing.rs @@ -1129,3 +1129,51 @@ pub async fn toggle_elimination_routing( )) .await } + +#[cfg(all(feature = "olap", feature = "v1"))] +#[instrument(skip_all)] +pub async fn set_dynamic_routing_volume_split( + state: web::Data<AppState>, + req: HttpRequest, + query: web::Query<api_models::routing::DynamicRoutingVolumeSplitQuery>, + path: web::Path<routing_types::ToggleDynamicRoutingPath>, +) -> impl Responder { + let flow = Flow::VolumeSplitOnRoutingType; + let routing_info = api_models::routing::RoutingVolumeSplit { + routing_type: api_models::routing::RoutingType::Dynamic, + split: query.into_inner().split, + }; + let payload = api_models::routing::RoutingVolumeSplitWrapper { + routing_info, + profile_id: path.into_inner().profile_id, + }; + + Box::pin(oss_api::server_wrap( + flow, + state, + &req, + payload.clone(), + |state, + auth: auth::AuthenticationData, + payload: api_models::routing::RoutingVolumeSplitWrapper, + _| { + routing::configure_dynamic_routing_volume_split( + state, + auth.merchant_account, + auth.key_store, + payload.profile_id, + payload.routing_info, + ) + }, + auth::auth_type( + &auth::HeaderAuth(auth::ApiKeyAuth), + &auth::JWTAuthProfileFromRoute { + profile_id: payload.profile_id, + required_permission: Permission::ProfileRoutingWrite, + }, + req.headers(), + ), + api_locking::LockAction::NotApplicable, + )) + .await +} diff --git a/crates/router_env/src/logger/types.rs b/crates/router_env/src/logger/types.rs index 0330c43aa45..27ddc10766d 100644 --- a/crates/router_env/src/logger/types.rs +++ b/crates/router_env/src/logger/types.rs @@ -521,6 +521,8 @@ pub enum Flow { PaymentsPostSessionTokens, /// Payments start redirection flow PaymentStartRedirection, + /// Volume split on the routing type + VolumeSplitOnRoutingType, } /// Trait for providing generic behaviour to flow metric
feat
Enable volume split for dynamic routing (#6662)
340714ce1b8359bb908ec3873c88822a2c0054f0
2024-08-14 18:22:33
Chethan Rao
refactor(redis): add redis commands required for success rate based routing (#5610)
false
diff --git a/crates/redis_interface/src/commands.rs b/crates/redis_interface/src/commands.rs index ccfeb3e5b12..9b76d8d9c81 100644 --- a/crates/redis_interface/src/commands.rs +++ b/crates/redis_interface/src/commands.rs @@ -15,7 +15,7 @@ use common_utils::{ }; use error_stack::{report, ResultExt}; use fred::{ - interfaces::{HashesInterface, KeysInterface, SetsInterface, StreamsInterface}, + interfaces::{HashesInterface, KeysInterface, ListInterface, SetsInterface, StreamsInterface}, prelude::RedisErrorKind, types::{ Expiration, FromRedis, MultipleIDs, MultipleKeys, MultipleOrderedPairs, MultipleStrings, @@ -371,6 +371,19 @@ impl super::RedisConnectionPool { Ok(hsetnx) } + #[instrument(level = "DEBUG", skip(self))] + pub async fn increment_field_in_hash( + &self, + key: &str, + field: &str, + increment: i64, + ) -> CustomResult<usize, errors::RedisError> { + self.pool + .hincrby(self.add_prefix(key), field, increment) + .await + .change_context(errors::RedisError::IncrementHashFieldFailed) + } + #[instrument(level = "DEBUG", skip(self))] pub async fn hscan( &self, @@ -630,6 +643,55 @@ impl super::RedisConnectionPool { }) } + #[instrument(level = "DEBUG", skip(self))] + pub async fn append_elements_to_list<V>( + &self, + key: &str, + elements: V, + ) -> CustomResult<(), errors::RedisError> + where + V: TryInto<MultipleValues> + Debug + Send, + V::Error: Into<fred::error::RedisError> + Send, + { + self.pool + .rpush(self.add_prefix(key), elements) + .await + .change_context(errors::RedisError::AppendElementsToListFailed) + } + + #[instrument(level = "DEBUG", skip(self))] + pub async fn get_list_elements( + &self, + key: &str, + start: i64, + stop: i64, + ) -> CustomResult<Vec<String>, errors::RedisError> { + self.pool + .lrange(self.add_prefix(key), start, stop) + .await + .change_context(errors::RedisError::GetListElementsFailed) + } + + #[instrument(level = "DEBUG", skip(self))] + pub async fn get_list_length(&self, key: &str) -> CustomResult<usize, errors::RedisError> { + self.pool + .llen(self.add_prefix(key)) + .await + .change_context(errors::RedisError::GetListLengthFailed) + } + + #[instrument(level = "DEBUG", skip(self))] + pub async fn lpop_list_elements( + &self, + key: &str, + count: Option<usize>, + ) -> CustomResult<Vec<String>, errors::RedisError> { + self.pool + .lpop(self.add_prefix(key), count) + .await + .change_context(errors::RedisError::PopListElementsFailed) + } + // Consumer Group API #[instrument(level = "DEBUG", skip(self))] diff --git a/crates/redis_interface/src/errors.rs b/crates/redis_interface/src/errors.rs index cc7f8bdd21f..0e2a4b8d63b 100644 --- a/crates/redis_interface/src/errors.rs +++ b/crates/redis_interface/src/errors.rs @@ -68,4 +68,14 @@ pub enum RedisError { OnMessageError, #[error("Got an unknown result from redis")] UnknownResult, + #[error("Failed to append elements to list in Redis")] + AppendElementsToListFailed, + #[error("Failed to get list elements in Redis")] + GetListElementsFailed, + #[error("Failed to get length of list")] + GetListLengthFailed, + #[error("Failed to pop list elements in Redis")] + PopListElementsFailed, + #[error("Failed to increment hash field in Redis")] + IncrementHashFieldFailed, }
refactor
add redis commands required for success rate based routing (#5610)
2e99152d35e22f74e5fba8b857de5ea79664095f
2023-02-28 19:01:02
Narayan Bhat
bugfix(adyen): adyen psync fail fix (#691)
false
diff --git a/crates/router/src/core/payments/operations/payment_status.rs b/crates/router/src/core/payments/operations/payment_status.rs index 1a37d88423e..d90635961c2 100644 --- a/crates/router/src/core/payments/operations/payment_status.rs +++ b/crates/router/src/core/payments/operations/payment_status.rs @@ -243,6 +243,8 @@ async fn get_tracker_for_sync< ) })?; + let contains_encoded_data = connector_response.encoded_data.is_some(); + Ok(( Box::new(operation), PaymentData { @@ -263,10 +265,10 @@ async fn get_tracker_for_sync< payment_method_data: None, force_sync: Some( request.force_sync - && helpers::check_force_psync_precondition( + && (helpers::check_force_psync_precondition( &payment_attempt.status, &payment_attempt.connector_transaction_id, - ), + ) || contains_encoded_data), ), payment_attempt, refunds,
bugfix
adyen psync fail fix (#691)
0e059e7d847b0c15ed120c72bb4902ac60e6f955
2024-06-13 09:15:09
AkshayaFoiger
feat(connectors): [Iatapay] add payment methods (#4968)
false
diff --git a/api-reference/openapi_spec.json b/api-reference/openapi_spec.json index e0a7228c166..dc0bd4ef074 100644 --- a/api-reference/openapi_spec.json +++ b/api-reference/openapi_spec.json @@ -6170,6 +6170,17 @@ } } } + }, + { + "type": "object", + "required": [ + "local_bank_redirect" + ], + "properties": { + "local_bank_redirect": { + "type": "object" + } + } } ] }, @@ -13181,6 +13192,7 @@ "crypto", "bank_debit", "reward", + "real_time_payment", "upi", "voucher", "gift_card" @@ -13377,6 +13389,18 @@ } } }, + { + "type": "object", + "title": "RealTimePayment", + "required": [ + "real_time_payment" + ], + "properties": { + "real_time_payment": { + "$ref": "#/components/schemas/RealTimePaymentData" + } + } + }, { "type": "object", "title": "Crypto", @@ -13738,8 +13762,10 @@ "dana", "danamon_va", "debit", + "duit_now", "efecty", "eps", + "fps", "evoucher", "giropay", "givex", @@ -13751,6 +13777,7 @@ "indomaret", "klarna", "kakao_pay", + "local_bank_redirect", "mandiri_va", "knet", "mb_way", @@ -13773,6 +13800,7 @@ "pix", "pay_safe_card", "przelewy24", + "prompt_pay", "pse", "red_compra", "red_pagos", @@ -13786,6 +13814,7 @@ "upi_collect", "upi_intent", "vipps", + "viet_qr", "venmo", "walley", "we_chat_pay", @@ -17348,6 +17377,54 @@ } } }, + "RealTimePaymentData": { + "oneOf": [ + { + "type": "object", + "required": [ + "fps" + ], + "properties": { + "fps": { + "type": "object" + } + } + }, + { + "type": "object", + "required": [ + "duit_now" + ], + "properties": { + "duit_now": { + "type": "object" + } + } + }, + { + "type": "object", + "required": [ + "prompt_pay" + ], + "properties": { + "prompt_pay": { + "type": "object" + } + } + }, + { + "type": "object", + "required": [ + "viet_qr" + ], + "properties": { + "viet_qr": { + "type": "object" + } + } + } + ] + }, "ReceiverDetails": { "type": "object", "required": [ diff --git a/config/deployments/sandbox.toml b/config/deployments/sandbox.toml index 180cf56db4d..a8ddbc55f5f 100644 --- a/config/deployments/sandbox.toml +++ b/config/deployments/sandbox.toml @@ -288,6 +288,7 @@ mifinity = { country = "BR,CN,SG,MY,DE,CH,DK,GB,ES,AD,GI,FI,FR,GR,HR,IT,JP,MX,AR [pm_filters.prophetpay] card_redirect.currency = "USD" + [pm_filters.stax] ach = { country = "US", currency = "USD" } diff --git a/config/development.toml b/config/development.toml index 2fcac14fb1e..9a40a99cfce 100644 --- a/config/development.toml +++ b/config/development.toml @@ -438,6 +438,8 @@ local_bank_transfer = { country = "CN", currency = "CNY" } credit = { not_available_flows = { capture_method = "manual" } } debit = { not_available_flows = { capture_method = "manual" } } + + [pm_filters.mollie] credit = { not_available_flows = { capture_method = "manual" } } debit = { not_available_flows = { capture_method = "manual" } } diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rs index dbb1751a529..c2418d78ecf 100644 --- a/crates/api_models/src/payments.rs +++ b/crates/api_models/src/payments.rs @@ -1437,6 +1437,7 @@ mod payment_method_data_serde { | PaymentMethodData::BankDebit(_) | PaymentMethodData::BankRedirect(_) | PaymentMethodData::BankTransfer(_) + | PaymentMethodData::RealTimePayment(_) | PaymentMethodData::CardToken(_) | PaymentMethodData::Crypto(_) | PaymentMethodData::GiftCard(_) @@ -1485,6 +1486,8 @@ pub enum PaymentMethodData { BankDebit(BankDebitData), #[schema(title = "BankTransfer")] BankTransfer(Box<BankTransferData>), + #[schema(title = "RealTimePayment")] + RealTimePayment(Box<RealTimePaymentData>), #[schema(title = "Crypto")] Crypto(CryptoData), #[schema(title = "MandatePayment")] @@ -1518,6 +1521,7 @@ impl GetAddressFromPaymentMethodData for PaymentMethodData { Self::Voucher(voucher_data) => voucher_data.get_billing_address(), Self::Crypto(_) | Self::Reward + | Self::RealTimePayment(_) | Self::Upi(_) | Self::GiftCard(_) | Self::CardToken(_) @@ -1552,6 +1556,7 @@ impl PaymentMethodData { Self::BankRedirect(_) => Some(api_enums::PaymentMethod::BankRedirect), Self::BankDebit(_) => Some(api_enums::PaymentMethod::BankDebit), Self::BankTransfer(_) => Some(api_enums::PaymentMethod::BankTransfer), + Self::RealTimePayment(_) => Some(api_enums::PaymentMethod::RealTimePayment), Self::Crypto(_) => Some(api_enums::PaymentMethod::Crypto), Self::Reward => Some(api_enums::PaymentMethod::Reward), Self::Upi(_) => Some(api_enums::PaymentMethod::Upi), @@ -1651,6 +1656,7 @@ impl GetPaymentMethodType for BankRedirectData { Self::OnlineBankingThailand { .. } => { api_enums::PaymentMethodType::OnlineBankingThailand } + Self::LocalBankRedirect { .. } => api_enums::PaymentMethodType::LocalBankRedirect, } } } @@ -1693,6 +1699,17 @@ impl GetPaymentMethodType for CryptoData { } } +impl GetPaymentMethodType for RealTimePaymentData { + fn get_payment_method_type(&self) -> api_enums::PaymentMethodType { + match self { + Self::Fps {} => api_enums::PaymentMethodType::Fps, + Self::DuitNow {} => api_enums::PaymentMethodType::DuitNow, + Self::PromptPay {} => api_enums::PaymentMethodType::PromptPay, + Self::VietQr {} => api_enums::PaymentMethodType::VietQr, + } + } +} + impl GetPaymentMethodType for UpiData { fn get_payment_method_type(&self) -> api_enums::PaymentMethodType { match self { @@ -1803,6 +1820,7 @@ pub enum AdditionalPaymentData { BankDebit {}, MandatePayment {}, Reward {}, + RealTimePayment {}, Upi {}, GiftCard {}, Voucher {}, @@ -1948,6 +1966,7 @@ pub enum BankRedirectData { #[schema(value_type = BankNames)] issuer: common_enums::BankNames, }, + LocalBankRedirect {}, } impl GetAddressFromPaymentMethodData for BankRedirectData { @@ -2057,6 +2076,7 @@ impl GetAddressFromPaymentMethodData for BankRedirectData { } => get_billing_address_inner(Some(billing_details), None, None), Self::Trustly { country } => get_billing_address_inner(None, Some(country), None), Self::OnlineBankingFpx { .. } + | Self::LocalBankRedirect {} | Self::OnlineBankingThailand { .. } | Self::Bizum {} | Self::OnlineBankingPoland { .. } @@ -2266,6 +2286,15 @@ pub enum BankTransferData { }, } +#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)] +#[serde(rename_all = "snake_case")] +pub enum RealTimePaymentData { + Fps {}, + DuitNow {}, + PromptPay {}, + VietQr {}, +} + impl GetAddressFromPaymentMethodData for BankTransferData { fn get_billing_address(&self) -> Option<Address> { match self { @@ -2734,6 +2763,7 @@ where | PaymentMethodDataResponse::GiftCard {} | PaymentMethodDataResponse::PayLater {} | PaymentMethodDataResponse::Paypal {} + | PaymentMethodDataResponse::RealTimePayment {} | PaymentMethodDataResponse::Upi {} | PaymentMethodDataResponse::Wallet {} | PaymentMethodDataResponse::BankTransfer {} @@ -2764,6 +2794,7 @@ pub enum PaymentMethodDataResponse { BankDebit {}, MandatePayment {}, Reward {}, + RealTimePayment {}, Upi {}, Voucher {}, GiftCard {}, @@ -3880,6 +3911,7 @@ impl From<AdditionalPaymentData> for PaymentMethodDataResponse { AdditionalPaymentData::BankDebit {} => Self::BankDebit {}, AdditionalPaymentData::MandatePayment {} => Self::MandatePayment {}, AdditionalPaymentData::Reward {} => Self::Reward {}, + AdditionalPaymentData::RealTimePayment {} => Self::RealTimePayment {}, AdditionalPaymentData::Upi {} => Self::Upi {}, AdditionalPaymentData::BankTransfer {} => Self::BankTransfer {}, AdditionalPaymentData::Voucher {} => Self::Voucher {}, diff --git a/crates/api_models/src/routing.rs b/crates/api_models/src/routing.rs index a7c4ed24475..66f3ff558ea 100644 --- a/crates/api_models/src/routing.rs +++ b/crates/api_models/src/routing.rs @@ -116,6 +116,7 @@ impl EuclidDirFilter for ConnectorSelection { DirKeyKind::VoucherType, DirKeyKind::CardRedirectType, DirKeyKind::BankTransferType, + DirKeyKind::RealTimePaymentType, ]; } diff --git a/crates/api_models/src/surcharge_decision_configs.rs b/crates/api_models/src/surcharge_decision_configs.rs index 9c2d1ac26e8..1f62dd29975 100644 --- a/crates/api_models/src/surcharge_decision_configs.rs +++ b/crates/api_models/src/surcharge_decision_configs.rs @@ -41,6 +41,7 @@ impl EuclidDirFilter for SurchargeDecisionConfigs { DirKeyKind::BankRedirectType, DirKeyKind::BankDebitType, DirKeyKind::CryptoType, + DirKeyKind::RealTimePaymentType, ]; } diff --git a/crates/common_enums/src/enums.rs b/crates/common_enums/src/enums.rs index 530d8fcdda4..5d6b9c14895 100644 --- a/crates/common_enums/src/enums.rs +++ b/crates/common_enums/src/enums.rs @@ -1394,8 +1394,10 @@ pub enum PaymentMethodType { Dana, DanamonVa, Debit, + DuitNow, Efecty, Eps, + Fps, Evoucher, Giropay, Givex, @@ -1407,6 +1409,7 @@ pub enum PaymentMethodType { Indomaret, Klarna, KakaoPay, + LocalBankRedirect, MandiriVa, Knet, MbWay, @@ -1429,6 +1432,7 @@ pub enum PaymentMethodType { Pix, PaySafeCard, Przelewy24, + PromptPay, Pse, RedCompra, RedPagos, @@ -1442,6 +1446,7 @@ pub enum PaymentMethodType { UpiCollect, UpiIntent, Vipps, + VietQr, Venmo, Walley, WeChatPay, @@ -1486,6 +1491,7 @@ pub enum PaymentMethod { Crypto, BankDebit, Reward, + RealTimePayment, Upi, Voucher, GiftCard, diff --git a/crates/common_enums/src/transformers.rs b/crates/common_enums/src/transformers.rs index c92fe95d85e..fc39cd1cf50 100644 --- a/crates/common_enums/src/transformers.rs +++ b/crates/common_enums/src/transformers.rs @@ -1815,6 +1815,8 @@ impl From<PaymentMethodType> for PaymentMethod { PaymentMethodType::Dana => Self::Wallet, PaymentMethodType::DanamonVa => Self::BankTransfer, PaymentMethodType::Debit => Self::Card, + PaymentMethodType::Fps => Self::RealTimePayment, + PaymentMethodType::DuitNow => Self::RealTimePayment, PaymentMethodType::Eps => Self::BankRedirect, PaymentMethodType::Evoucher => Self::Reward, PaymentMethodType::Giropay => Self::BankRedirect, @@ -1826,6 +1828,7 @@ impl From<PaymentMethodType> for PaymentMethod { PaymentMethodType::Klarna => Self::PayLater, PaymentMethodType::KakaoPay => Self::Wallet, PaymentMethodType::Knet => Self::CardRedirect, + PaymentMethodType::LocalBankRedirect => Self::BankRedirect, PaymentMethodType::MbWay => Self::Wallet, PaymentMethodType::MobilePay => Self::Wallet, PaymentMethodType::Momo => Self::Wallet, @@ -1848,6 +1851,7 @@ impl From<PaymentMethodType> for PaymentMethod { PaymentMethodType::Paypal => Self::Wallet, PaymentMethodType::PaySafeCard => Self::GiftCard, PaymentMethodType::Przelewy24 => Self::BankRedirect, + PaymentMethodType::PromptPay => Self::RealTimePayment, PaymentMethodType::SamsungPay => Self::Wallet, PaymentMethodType::Sepa => Self::BankDebit, PaymentMethodType::Sofort => Self::BankRedirect, @@ -1858,6 +1862,7 @@ impl From<PaymentMethodType> for PaymentMethod { PaymentMethodType::UpiIntent => Self::Upi, PaymentMethodType::Vipps => Self::Wallet, PaymentMethodType::Venmo => Self::Wallet, + PaymentMethodType::VietQr => Self::RealTimePayment, PaymentMethodType::Walley => Self::PayLater, PaymentMethodType::WeChatPay => Self::Wallet, PaymentMethodType::TouchNGo => Self::Wallet, diff --git a/crates/connector_configs/src/response_modifier.rs b/crates/connector_configs/src/response_modifier.rs index 6a1b4330691..20eeef5f463 100644 --- a/crates/connector_configs/src/response_modifier.rs +++ b/crates/connector_configs/src/response_modifier.rs @@ -15,6 +15,7 @@ impl ConnectorApiIntegrationPayload { let mut crypto_details: Vec<Provider> = Vec::new(); let mut bank_debit_details: Vec<Provider> = Vec::new(); let mut reward_details: Vec<Provider> = Vec::new(); + let mut real_time_payment_details: Vec<Provider> = Vec::new(); let mut upi_details: Vec<Provider> = Vec::new(); let mut voucher_details: Vec<Provider> = Vec::new(); let mut gift_card_details: Vec<Provider> = Vec::new(); @@ -148,6 +149,18 @@ impl ConnectorApiIntegrationPayload { } } } + api_models::enums::PaymentMethod::RealTimePayment => { + if let Some(payment_method_types) = methods.payment_method_types { + for method_type in payment_method_types { + real_time_payment_details.push(Provider { + payment_method_type: method_type.payment_method_type, + accepted_currencies: method_type.accepted_currencies.clone(), + accepted_countries: method_type.accepted_countries.clone(), + payment_experience: method_type.payment_experience, + }) + } + } + } api_models::enums::PaymentMethod::Upi => { if let Some(payment_method_types) = methods.payment_method_types { for method_type in payment_method_types { @@ -228,6 +241,13 @@ impl ConnectorApiIntegrationPayload { card_provider: None, }; + let real_time_payment = DashboardPaymentMethodPayload { + payment_method: api_models::enums::PaymentMethod::RealTimePayment, + payment_method_type: api_models::enums::PaymentMethod::RealTimePayment.to_string(), + provider: Some(real_time_payment_details), + card_provider: None, + }; + let wallet = DashboardPaymentMethodPayload { payment_method: api_models::enums::PaymentMethod::Wallet, payment_method_type: api_models::enums::PaymentMethod::Wallet.to_string(), @@ -295,6 +315,7 @@ impl ConnectorApiIntegrationPayload { upi, voucher, reward, + real_time_payment, wallet, bank_redirect, bank_debit, diff --git a/crates/connector_configs/src/transformer.rs b/crates/connector_configs/src/transformer.rs index e958fc5de07..f6b1372b486 100644 --- a/crates/connector_configs/src/transformer.rs +++ b/crates/connector_configs/src/transformer.rs @@ -134,6 +134,7 @@ impl DashboardRequestPayload { | PaymentMethod::Crypto | PaymentMethod::BankDebit | PaymentMethod::Reward + | PaymentMethod::RealTimePayment | PaymentMethod::Upi | PaymentMethod::Voucher | PaymentMethod::GiftCard diff --git a/crates/euclid/src/dssa/graph.rs b/crates/euclid/src/dssa/graph.rs index ba9d5fdddc9..e6439a2f55e 100644 --- a/crates/euclid/src/dssa/graph.rs +++ b/crates/euclid/src/dssa/graph.rs @@ -68,6 +68,7 @@ impl cgraph::NodeViz for dir::DirValue { Self::BusinessLabel(bl) => bl.value.to_string(), Self::SetupFutureUsage(sfu) => sfu.to_string(), Self::CardRedirectType(crt) => crt.to_string(), + Self::RealTimePaymentType(rtpt) => rtpt.to_string(), } } } diff --git a/crates/euclid/src/dssa/truth.rs b/crates/euclid/src/dssa/truth.rs index 388180eed5b..7e79e4ddc6f 100644 --- a/crates/euclid/src/dssa/truth.rs +++ b/crates/euclid/src/dssa/truth.rs @@ -26,5 +26,9 @@ pub static ANALYSIS_GRAPH: Lazy<hyperswitch_constraint_graph::ConstraintGraph<'_ // Payment Method should be `GiftCard` for a GiftCardType to // be present PaymentMethod(GiftCard) ->> GiftCardType(any); + + // Payment Method should be `RealTimePayment` for a RealTimePaymentType to + // be present + PaymentMethod(RealTimePayment) ->> RealTimePaymentType(any); } }); diff --git a/crates/euclid/src/frontend/ast/lowering.rs b/crates/euclid/src/frontend/ast/lowering.rs index ffce88a35db..48a1a0ab8bf 100644 --- a/crates/euclid/src/frontend/ast/lowering.rs +++ b/crates/euclid/src/frontend/ast/lowering.rs @@ -272,6 +272,8 @@ fn lower_comparison_inner<O: EuclidDirFilter>( dir::DirKeyKind::CardRedirectType => lower_enum!(CardRedirectType, value), + dir::DirKeyKind::RealTimePaymentType => lower_enum!(RealTimePaymentType, value), + dir::DirKeyKind::CardBin => { let validation_closure = |st: &String| -> Result<(), AnalysisErrorType> { if st.len() == 6 && st.chars().all(|x| x.is_ascii_digit()) { diff --git a/crates/euclid/src/frontend/dir.rs b/crates/euclid/src/frontend/dir.rs index f2b9ab99049..68a32a528b8 100644 --- a/crates/euclid/src/frontend/dir.rs +++ b/crates/euclid/src/frontend/dir.rs @@ -311,6 +311,13 @@ pub enum DirKeyKind { )] #[serde(rename = "card_redirect")] CardRedirectType, + #[serde(rename = "real_time_payment")] + #[strum( + serialize = "real_time_payment", + detailed_message = "Supported types of real time payment method", + props(Category = "Payment Method Types") + )] + RealTimePaymentType, } pub trait EuclidDirFilter: Sized @@ -358,6 +365,7 @@ impl DirKeyKind { Self::BusinessLabel => types::DataType::StrValue, Self::SetupFutureUsage => types::DataType::EnumVariant, Self::CardRedirectType => types::DataType::EnumVariant, + Self::RealTimePaymentType => types::DataType::EnumVariant, } } pub fn get_value_set(&self) -> Option<Vec<DirValue>> { @@ -484,6 +492,11 @@ impl DirKeyKind { .map(DirValue::CardRedirectType) .collect(), ), + Self::RealTimePaymentType => Some( + enums::RealTimePaymentType::iter() + .map(DirValue::RealTimePaymentType) + .collect(), + ), } } } @@ -549,6 +562,8 @@ pub enum DirValue { SetupFutureUsage(enums::SetupFutureUsage), #[serde(rename = "card_redirect")] CardRedirectType(enums::CardRedirectType), + #[serde(rename = "real_time_payment")] + RealTimePaymentType(enums::RealTimePaymentType), } impl DirValue { @@ -582,6 +597,7 @@ impl DirValue { Self::CardRedirectType(_) => (DirKeyKind::CardRedirectType, None), Self::VoucherType(_) => (DirKeyKind::VoucherType, None), Self::GiftCardType(_) => (DirKeyKind::GiftCardType, None), + Self::RealTimePaymentType(_) => (DirKeyKind::RealTimePaymentType, None), }; DirKey::new(kind, data) @@ -616,6 +632,7 @@ impl DirValue { Self::BusinessLabel(_) => None, Self::SetupFutureUsage(_) => None, Self::CardRedirectType(_) => None, + Self::RealTimePaymentType(_) => None, } } @@ -655,6 +672,7 @@ impl DirValue { (Self::MandateType(mt1), Self::MandateType(mt2)) => mt1 == mt2, (Self::MandateAcceptanceType(mat1), Self::MandateAcceptanceType(mat2)) => mat1 == mat2, (Self::RewardType(rt1), Self::RewardType(rt2)) => rt1 == rt2, + (Self::RealTimePaymentType(rtp1), Self::RealTimePaymentType(rtp2)) => rtp1 == rtp2, (Self::Connector(c1), Self::Connector(c2)) => c1 == c2, (Self::BusinessLabel(bl1), Self::BusinessLabel(bl2)) => bl1 == bl2, (Self::SetupFutureUsage(sfu1), Self::SetupFutureUsage(sfu2)) => sfu1 == sfu2, diff --git a/crates/euclid/src/frontend/dir/enums.rs b/crates/euclid/src/frontend/dir/enums.rs index dd9a2da7a3b..5d0defc7357 100644 --- a/crates/euclid/src/frontend/dir/enums.rs +++ b/crates/euclid/src/frontend/dir/enums.rs @@ -149,6 +149,7 @@ pub enum BankRedirectType { BancontactCard, Blik, Interac, + LocalBankRedirect, OnlineBankingCzechRepublic, OnlineBankingFinland, OnlineBankingPoland, @@ -252,6 +253,28 @@ pub enum CryptoType { CryptoCurrency, } +#[derive( + Clone, + Debug, + Hash, + PartialEq, + Eq, + strum::Display, + strum::VariantNames, + strum::EnumIter, + strum::EnumString, + serde::Serialize, + serde::Deserialize, +)] +#[serde(rename_all = "snake_case")] +#[strum(serialize_all = "snake_case")] +pub enum RealTimePaymentType { + Fps, + DuitNow, + PromptPay, + VietQr, +} + #[derive( Clone, Debug, @@ -321,6 +344,7 @@ collect_variants!(BankRedirectType); collect_variants!(BankDebitType); collect_variants!(CryptoType); collect_variants!(RewardType); +collect_variants!(RealTimePaymentType); collect_variants!(UpiType); collect_variants!(VoucherType); collect_variants!(GiftCardType); diff --git a/crates/euclid/src/frontend/dir/lowering.rs b/crates/euclid/src/frontend/dir/lowering.rs index 1c4cfa7cfbb..f91c63a8166 100644 --- a/crates/euclid/src/frontend/dir/lowering.rs +++ b/crates/euclid/src/frontend/dir/lowering.rs @@ -154,6 +154,7 @@ impl From<enums::BankRedirectType> for global_enums::PaymentMethodType { enums::BankRedirectType::BancontactCard => Self::BancontactCard, enums::BankRedirectType::Blik => Self::Blik, enums::BankRedirectType::Interac => Self::Interac, + enums::BankRedirectType::LocalBankRedirect => Self::LocalBankRedirect, enums::BankRedirectType::OnlineBankingCzechRepublic => Self::OnlineBankingCzechRepublic, enums::BankRedirectType::OnlineBankingFinland => Self::OnlineBankingFinland, enums::BankRedirectType::OnlineBankingPoland => Self::OnlineBankingPoland, @@ -184,6 +185,17 @@ impl From<enums::RewardType> for global_enums::PaymentMethodType { } } +impl From<enums::RealTimePaymentType> for global_enums::PaymentMethodType { + fn from(value: enums::RealTimePaymentType) -> Self { + match value { + enums::RealTimePaymentType::Fps => Self::Fps, + enums::RealTimePaymentType::DuitNow => Self::DuitNow, + enums::RealTimePaymentType::PromptPay => Self::PromptPay, + enums::RealTimePaymentType::VietQr => Self::VietQr, + } + } +} + /// Analyses of the lowering of the DirValues to EuclidValues . /// /// For example, @@ -209,6 +221,7 @@ fn lower_value(dir_value: dir::DirValue) -> Result<EuclidValue, AnalysisErrorTyp dir::DirValue::CardRedirectType(crt) => EuclidValue::PaymentMethodType(crt.into()), dir::DirValue::BankRedirectType(brt) => EuclidValue::PaymentMethodType(brt.into()), dir::DirValue::CryptoType(ct) => EuclidValue::PaymentMethodType(ct.into()), + dir::DirValue::RealTimePaymentType(rtpt) => EuclidValue::PaymentMethodType(rtpt.into()), dir::DirValue::AuthenticationType(at) => EuclidValue::AuthenticationType(at), dir::DirValue::CaptureMethod(cm) => EuclidValue::CaptureMethod(cm), dir::DirValue::PaymentAmount(pa) => EuclidValue::PaymentAmount(pa), diff --git a/crates/euclid/src/frontend/dir/transformers.rs b/crates/euclid/src/frontend/dir/transformers.rs index ff4125712a6..3f83ee3db01 100644 --- a/crates/euclid/src/frontend/dir/transformers.rs +++ b/crates/euclid/src/frontend/dir/transformers.rs @@ -11,7 +11,9 @@ impl IntoDirValue for (global_enums::PaymentMethodType, global_enums::PaymentMet global_enums::PaymentMethodType::Giropay => Ok(dirval!(BankRedirectType = Giropay)), global_enums::PaymentMethodType::Ideal => Ok(dirval!(BankRedirectType = Ideal)), global_enums::PaymentMethodType::Sofort => Ok(dirval!(BankRedirectType = Sofort)), + global_enums::PaymentMethodType::DuitNow => Ok(dirval!(RealTimePaymentType = DuitNow)), global_enums::PaymentMethodType::Eps => Ok(dirval!(BankRedirectType = Eps)), + global_enums::PaymentMethodType::Fps => Ok(dirval!(RealTimePaymentType = Fps)), global_enums::PaymentMethodType::Klarna => Ok(dirval!(PayLaterType = Klarna)), global_enums::PaymentMethodType::Affirm => Ok(dirval!(PayLaterType = Affirm)), global_enums::PaymentMethodType::AfterpayClearpay => { @@ -33,6 +35,7 @@ impl IntoDirValue for (global_enums::PaymentMethodType, global_enums::PaymentMet | global_enums::PaymentMethod::BankRedirect | global_enums::PaymentMethod::Crypto | global_enums::PaymentMethod::Reward + | global_enums::PaymentMethod::RealTimePayment | global_enums::PaymentMethod::Upi | global_enums::PaymentMethod::Voucher | global_enums::PaymentMethod::GiftCard => Err(AnalysisErrorType::NotSupported), @@ -47,6 +50,7 @@ impl IntoDirValue for (global_enums::PaymentMethodType, global_enums::PaymentMet | global_enums::PaymentMethod::BankRedirect | global_enums::PaymentMethod::Crypto | global_enums::PaymentMethod::Reward + | global_enums::PaymentMethod::RealTimePayment | global_enums::PaymentMethod::Upi | global_enums::PaymentMethod::Voucher | global_enums::PaymentMethod::GiftCard => Err(AnalysisErrorType::NotSupported), @@ -62,6 +66,7 @@ impl IntoDirValue for (global_enums::PaymentMethodType, global_enums::PaymentMet | global_enums::PaymentMethod::BankRedirect | global_enums::PaymentMethod::Crypto | global_enums::PaymentMethod::Reward + | global_enums::PaymentMethod::RealTimePayment | global_enums::PaymentMethod::Upi | global_enums::PaymentMethod::Voucher | global_enums::PaymentMethod::GiftCard => Err(AnalysisErrorType::NotSupported), @@ -102,6 +107,9 @@ impl IntoDirValue for (global_enums::PaymentMethodType, global_enums::PaymentMet global_enums::PaymentMethodType::Przelewy24 => { Ok(dirval!(BankRedirectType = Przelewy24)) } + global_enums::PaymentMethodType::PromptPay => { + Ok(dirval!(RealTimePaymentType = PromptPay)) + } global_enums::PaymentMethodType::WeChatPay => Ok(dirval!(WalletType = WeChatPay)), global_enums::PaymentMethodType::ClassicReward => { @@ -116,12 +124,16 @@ impl IntoDirValue for (global_enums::PaymentMethodType, global_enums::PaymentMet global_enums::PaymentMethodType::Twint => Ok(dirval!(WalletType = Twint)), global_enums::PaymentMethodType::Gcash => Ok(dirval!(WalletType = Gcash)), global_enums::PaymentMethodType::Vipps => Ok(dirval!(WalletType = Vipps)), + global_enums::PaymentMethodType::VietQr => Ok(dirval!(RealTimePaymentType = VietQr)), global_enums::PaymentMethodType::Momo => Ok(dirval!(WalletType = Momo)), global_enums::PaymentMethodType::Alma => Ok(dirval!(PayLaterType = Alma)), global_enums::PaymentMethodType::Dana => Ok(dirval!(WalletType = Dana)), global_enums::PaymentMethodType::OnlineBankingFpx => { Ok(dirval!(BankRedirectType = OnlineBankingFpx)) } + global_enums::PaymentMethodType::LocalBankRedirect => { + Ok(dirval!(BankRedirectType = LocalBankRedirect)) + } global_enums::PaymentMethodType::OnlineBankingThailand => { Ok(dirval!(BankRedirectType = OnlineBankingThailand)) } diff --git a/crates/euclid_wasm/src/lib.rs b/crates/euclid_wasm/src/lib.rs index df78786a579..30470510141 100644 --- a/crates/euclid_wasm/src/lib.rs +++ b/crates/euclid_wasm/src/lib.rs @@ -262,6 +262,7 @@ pub fn get_variant_values(key: &str) -> Result<JsValue, JsValue> { dir::DirKeyKind::GiftCardType => dir_enums::GiftCardType::VARIANTS, dir::DirKeyKind::VoucherType => dir_enums::VoucherType::VARIANTS, dir::DirKeyKind::BankDebitType => dir_enums::BankDebitType::VARIANTS, + dir::DirKeyKind::RealTimePaymentType => dir_enums::RealTimePaymentType::VARIANTS, dir::DirKeyKind::PaymentAmount | dir::DirKeyKind::Connector diff --git a/crates/hyperswitch_domain_models/src/payment_method_data.rs b/crates/hyperswitch_domain_models/src/payment_method_data.rs index 89af698b8db..b7305100dda 100644 --- a/crates/hyperswitch_domain_models/src/payment_method_data.rs +++ b/crates/hyperswitch_domain_models/src/payment_method_data.rs @@ -17,6 +17,7 @@ pub enum PaymentMethodData { Crypto(CryptoData), MandatePayment, Reward, + RealTimePayment(Box<RealTimePaymentData>), Upi(UpiData), Voucher(VoucherData), GiftCard(Box<GiftCardData>), @@ -41,6 +42,7 @@ impl PaymentMethodData { Self::BankTransfer(_) => Some(common_enums::PaymentMethod::BankTransfer), Self::Crypto(_) => Some(common_enums::PaymentMethod::Crypto), Self::Reward => Some(common_enums::PaymentMethod::Reward), + Self::RealTimePayment(_) => Some(common_enums::PaymentMethod::RealTimePayment), Self::Upi(_) => Some(common_enums::PaymentMethod::Upi), Self::Voucher(_) => Some(common_enums::PaymentMethod::Voucher), Self::GiftCard(_) => Some(common_enums::PaymentMethod::GiftCard), @@ -245,6 +247,15 @@ pub struct ApplepayPaymentMethod { #[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)] +pub enum RealTimePaymentData { + DuitNow {}, + Fps {}, + PromptPay {}, + VietQr {}, +} + +#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)] + pub enum BankRedirectData { BancontactCard { card_number: Option<cards::CardNumber>, @@ -292,6 +303,7 @@ pub enum BankRedirectData { OnlineBankingThailand { issuer: common_enums::BankNames, }, + LocalBankRedirect {}, } #[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)] @@ -456,6 +468,9 @@ impl From<api_models::payments::PaymentMethodData> for PaymentMethodData { } api_models::payments::PaymentMethodData::MandatePayment => Self::MandatePayment, api_models::payments::PaymentMethodData::Reward => Self::Reward, + api_models::payments::PaymentMethodData::RealTimePayment(real_time_payment_data) => { + Self::RealTimePayment(Box::new(From::from(*real_time_payment_data))) + } api_models::payments::PaymentMethodData::Upi(upi_data) => { Self::Upi(From::from(upi_data)) } @@ -706,6 +721,9 @@ impl From<api_models::payments::BankRedirectData> for BankRedirectData { api_models::payments::BankRedirectData::OnlineBankingThailand { issuer } => { Self::OnlineBankingThailand { issuer } } + api_models::payments::BankRedirectData::LocalBankRedirect { .. } => { + Self::LocalBankRedirect {} + } } } } @@ -874,3 +892,14 @@ impl From<api_models::payments::BankTransferData> for BankTransferData { } } } + +impl From<api_models::payments::RealTimePaymentData> for RealTimePaymentData { + fn from(value: api_models::payments::RealTimePaymentData) -> Self { + match value { + api_models::payments::RealTimePaymentData::Fps {} => Self::Fps {}, + api_models::payments::RealTimePaymentData::DuitNow {} => Self::DuitNow {}, + api_models::payments::RealTimePaymentData::PromptPay {} => Self::PromptPay {}, + api_models::payments::RealTimePaymentData::VietQr {} => Self::VietQr {}, + } + } +} diff --git a/crates/kgraph_utils/src/mca.rs b/crates/kgraph_utils/src/mca.rs index 4d857f43d93..cb24d9de930 100644 --- a/crates/kgraph_utils/src/mca.rs +++ b/crates/kgraph_utils/src/mca.rs @@ -92,6 +92,9 @@ fn get_dir_value_payment_method( api_enums::PaymentMethodType::OnlineBankingThailand => { Ok(dirval!(BankRedirectType = OnlineBankingThailand)) } + api_enums::PaymentMethodType::LocalBankRedirect => { + Ok(dirval!(BankRedirectType = LocalBankRedirect)) + } api_enums::PaymentMethodType::TouchNGo => Ok(dirval!(WalletType = TouchNGo)), api_enums::PaymentMethodType::Atome => Ok(dirval!(PayLaterType = Atome)), api_enums::PaymentMethodType::Boleto => Ok(dirval!(VoucherType = Boleto)), @@ -135,6 +138,10 @@ fn get_dir_value_payment_method( api_enums::PaymentMethodType::UpiIntent => Ok(dirval!(UpiType = UpiIntent)), api_enums::PaymentMethodType::UpiCollect => Ok(dirval!(UpiType = UpiCollect)), api_enums::PaymentMethodType::Mifinity => Ok(dirval!(WalletType = Mifinity)), + api_enums::PaymentMethodType::Fps => Ok(dirval!(RealTimePaymentType = Fps)), + api_enums::PaymentMethodType::DuitNow => Ok(dirval!(RealTimePaymentType = DuitNow)), + api_enums::PaymentMethodType::PromptPay => Ok(dirval!(RealTimePaymentType = PromptPay)), + api_enums::PaymentMethodType::VietQr => Ok(dirval!(RealTimePaymentType = VietQr)), } } @@ -402,6 +409,7 @@ fn global_vec_pmt( global_vector.append(collect_global_variants!(BankDebitType)); global_vector.append(collect_global_variants!(CryptoType)); global_vector.append(collect_global_variants!(RewardType)); + global_vector.append(collect_global_variants!(RealTimePaymentType)); global_vector.append(collect_global_variants!(UpiType)); global_vector.append(collect_global_variants!(VoucherType)); global_vector.append(collect_global_variants!(GiftCardType)); diff --git a/crates/kgraph_utils/src/transformers.rs b/crates/kgraph_utils/src/transformers.rs index 89dbda689c6..1b1bd931200 100644 --- a/crates/kgraph_utils/src/transformers.rs +++ b/crates/kgraph_utils/src/transformers.rs @@ -98,6 +98,7 @@ impl IntoDirValue for api_enums::PaymentMethod { Self::BankDebit => Ok(dirval!(PaymentMethod = BankDebit)), Self::BankTransfer => Ok(dirval!(PaymentMethod = BankTransfer)), Self::Reward => Ok(dirval!(PaymentMethod = Reward)), + Self::RealTimePayment => Ok(dirval!(PaymentMethod = RealTimePayment)), Self::Upi => Ok(dirval!(PaymentMethod = Upi)), Self::Voucher => Ok(dirval!(PaymentMethod = Voucher)), Self::GiftCard => Ok(dirval!(PaymentMethod = GiftCard)), @@ -154,6 +155,7 @@ impl IntoDirValue for (api_enums::PaymentMethodType, api_enums::PaymentMethod) { | api_enums::PaymentMethod::Wallet | api_enums::PaymentMethod::Crypto | api_enums::PaymentMethod::Reward + | api_enums::PaymentMethod::RealTimePayment | api_enums::PaymentMethod::Upi | api_enums::PaymentMethod::Voucher | api_enums::PaymentMethod::GiftCard => Err(KgraphError::ContextConstructionError( @@ -170,6 +172,7 @@ impl IntoDirValue for (api_enums::PaymentMethodType, api_enums::PaymentMethod) { | api_enums::PaymentMethod::Wallet | api_enums::PaymentMethod::Crypto | api_enums::PaymentMethod::Reward + | api_enums::PaymentMethod::RealTimePayment | api_enums::PaymentMethod::Upi | api_enums::PaymentMethod::Voucher | api_enums::PaymentMethod::GiftCard => Err(KgraphError::ContextConstructionError( @@ -187,6 +190,7 @@ impl IntoDirValue for (api_enums::PaymentMethodType, api_enums::PaymentMethod) { | api_enums::PaymentMethod::Wallet | api_enums::PaymentMethod::Crypto | api_enums::PaymentMethod::Reward + | api_enums::PaymentMethod::RealTimePayment | api_enums::PaymentMethod::Upi | api_enums::PaymentMethod::Voucher | api_enums::PaymentMethod::GiftCard => Err(KgraphError::ContextConstructionError( @@ -243,6 +247,9 @@ impl IntoDirValue for (api_enums::PaymentMethodType, api_enums::PaymentMethod) { api_enums::PaymentMethodType::OnlineBankingFpx => { Ok(dirval!(BankRedirectType = OnlineBankingFpx)) } + api_enums::PaymentMethodType::LocalBankRedirect => { + Ok(dirval!(BankRedirectType = LocalBankRedirect)) + } api_enums::PaymentMethodType::OnlineBankingThailand => { Ok(dirval!(BankRedirectType = OnlineBankingThailand)) } @@ -289,6 +296,10 @@ impl IntoDirValue for (api_enums::PaymentMethodType, api_enums::PaymentMethod) { } api_enums::PaymentMethodType::Venmo => Ok(dirval!(WalletType = Venmo)), api_enums::PaymentMethodType::Mifinity => Ok(dirval!(WalletType = Mifinity)), + api_enums::PaymentMethodType::Fps => Ok(dirval!(RealTimePaymentType = Fps)), + api_enums::PaymentMethodType::DuitNow => Ok(dirval!(RealTimePaymentType = DuitNow)), + api_enums::PaymentMethodType::PromptPay => Ok(dirval!(RealTimePaymentType = PromptPay)), + api_enums::PaymentMethodType::VietQr => Ok(dirval!(RealTimePaymentType = VietQr)), } } } diff --git a/crates/openapi/src/openapi.rs b/crates/openapi/src/openapi.rs index 0b9604d6c4d..603c6637aa9 100644 --- a/crates/openapi/src/openapi.rs +++ b/crates/openapi/src/openapi.rs @@ -303,6 +303,7 @@ Never share your secret api keys. Keep them guarded and secure. api_models::payments::AlfamartVoucherData, api_models::payments::IndomaretVoucherData, api_models::payments::BankRedirectData, + api_models::payments::RealTimePaymentData, api_models::payments::BankRedirectBilling, api_models::payments::BankRedirectBilling, api_models::payments::ConnectorMetadata, diff --git a/crates/router/src/compatibility/stripe/payment_intents/types.rs b/crates/router/src/compatibility/stripe/payment_intents/types.rs index 5df2ba14874..3c7562d5078 100644 --- a/crates/router/src/compatibility/stripe/payment_intents/types.rs +++ b/crates/router/src/compatibility/stripe/payment_intents/types.rs @@ -15,6 +15,7 @@ use time::PrimitiveDateTime; use crate::{ compatibility::stripe::refunds::types as stripe_refunds, + connector::utils::AddressData, consts, core::errors, pii::{Email, PeekInterface}, @@ -85,6 +86,8 @@ pub enum StripePaymentMethodType { Card, Wallet, Upi, + BankRedirect, + RealTimePayment, } impl From<StripePaymentMethodType> for api_enums::PaymentMethod { @@ -93,6 +96,8 @@ impl From<StripePaymentMethodType> for api_enums::PaymentMethod { StripePaymentMethodType::Card => Self::Card, StripePaymentMethodType::Wallet => Self::Wallet, StripePaymentMethodType::Upi => Self::Upi, + StripePaymentMethodType::BankRedirect => Self::BankRedirect, + StripePaymentMethodType::RealTimePayment => Self::RealTimePayment, } } } @@ -317,14 +322,17 @@ impl TryFrom<StripePaymentIntentRequest> for payments::PaymentsRequest { let amount = item.amount.map(|amount| MinorUnit::new(amount).into()); let payment_method_data = item.payment_method_data.as_ref().map(|pmd| { + let billing = pmd.billing_details.clone().map(payments::Address::from); let payment_method_data = match pmd.payment_method_details.as_ref() { Some(spmd) => Some(payments::PaymentMethodData::from(spmd.to_owned())), - None => get_pmd_based_on_payment_method_type(item.payment_method_types), + None => { + get_pmd_based_on_payment_method_type(item.payment_method_types, billing.clone()) + } }; payments::PaymentMethodDataRequest { payment_method_data, - billing: pmd.billing_details.clone().map(payments::Address::from), + billing, } }); @@ -898,11 +906,51 @@ pub struct StripePaymentRetrieveBody { //To handle payment types that have empty payment method data fn get_pmd_based_on_payment_method_type( payment_method_type: Option<api_enums::PaymentMethodType>, + billing_details: Option<payments::Address>, ) -> Option<payments::PaymentMethodData> { match payment_method_type { Some(api_enums::PaymentMethodType::UpiIntent) => Some(payments::PaymentMethodData::Upi( payments::UpiData::UpiIntent(payments::UpiIntentData {}), )), + Some(api_enums::PaymentMethodType::Fps) => { + Some(payments::PaymentMethodData::RealTimePayment(Box::new( + payments::RealTimePaymentData::Fps {}, + ))) + } + Some(api_enums::PaymentMethodType::DuitNow) => { + Some(payments::PaymentMethodData::RealTimePayment(Box::new( + payments::RealTimePaymentData::DuitNow {}, + ))) + } + Some(api_enums::PaymentMethodType::PromptPay) => { + Some(payments::PaymentMethodData::RealTimePayment(Box::new( + payments::RealTimePaymentData::PromptPay {}, + ))) + } + Some(api_enums::PaymentMethodType::VietQr) => { + Some(payments::PaymentMethodData::RealTimePayment(Box::new( + payments::RealTimePaymentData::VietQr {}, + ))) + } + Some(api_enums::PaymentMethodType::Ideal) => Some( + payments::PaymentMethodData::BankRedirect(payments::BankRedirectData::Ideal { + billing_details: billing_details.as_ref().map(|billing_data| { + payments::BankRedirectBilling { + billing_name: billing_data.get_optional_full_name(), + email: billing_data.email.clone(), + } + }), + bank_name: None, + country: billing_details + .as_ref() + .and_then(|billing_data| billing_data.get_optional_country()), + }), + ), + Some(api_enums::PaymentMethodType::LocalBankTransfer) => { + Some(payments::PaymentMethodData::BankRedirect( + payments::BankRedirectData::LocalBankRedirect {}, + )) + } _ => None, } } diff --git a/crates/router/src/connector/aci/transformers.rs b/crates/router/src/connector/aci/transformers.rs index 525e6beb032..c9f81ec722b 100644 --- a/crates/router/src/connector/aci/transformers.rs +++ b/crates/router/src/connector/aci/transformers.rs @@ -272,6 +272,7 @@ impl | domain::BankRedirectData::OnlineBankingPoland { .. } | domain::BankRedirectData::OnlineBankingSlovakia { .. } | domain::BankRedirectData::OnlineBankingThailand { .. } + | domain::BankRedirectData::LocalBankRedirect {} | domain::BankRedirectData::OpenBankingUk { .. } => Err( errors::ConnectorError::NotImplemented("Payment method".to_string()), )?, @@ -441,6 +442,7 @@ impl TryFrom<&AciRouterData<&types::PaymentsAuthorizeRouterData>> for AciPayment | domain::PaymentMethodData::BankDebit(_) | domain::PaymentMethodData::BankTransfer(_) | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::GiftCard(_) | domain::PaymentMethodData::CardRedirect(_) | domain::PaymentMethodData::Upi(_) diff --git a/crates/router/src/connector/adyen.rs b/crates/router/src/connector/adyen.rs index 06040b7f6b4..fd2fd2865a0 100644 --- a/crates/router/src/connector/adyen.rs +++ b/crates/router/src/connector/adyen.rs @@ -201,6 +201,8 @@ impl ConnectorValidation for Adyen { } }, PaymentMethodType::CardRedirect + | PaymentMethodType::Fps + | PaymentMethodType::DuitNow | PaymentMethodType::Interac | PaymentMethodType::Multibanco | PaymentMethodType::Przelewy24 @@ -210,6 +212,7 @@ impl ConnectorValidation for Adyen { | PaymentMethodType::LocalBankTransfer | PaymentMethodType::Efecty | PaymentMethodType::PagoEfectivo + | PaymentMethodType::PromptPay | PaymentMethodType::RedCompra | PaymentMethodType::RedPagos | PaymentMethodType::CryptoCurrency @@ -218,7 +221,9 @@ impl ConnectorValidation for Adyen { | PaymentMethodType::Cashapp | PaymentMethodType::UpiCollect | PaymentMethodType::UpiIntent - | PaymentMethodType::Mifinity => { + | PaymentMethodType::VietQr + | PaymentMethodType::Mifinity + | PaymentMethodType::LocalBankRedirect => { capture_method_not_supported!(connector, capture_method, payment_method_type) } }, diff --git a/crates/router/src/connector/adyen/transformers.rs b/crates/router/src/connector/adyen/transformers.rs index dbd522b1b30..9354e7e7442 100644 --- a/crates/router/src/connector/adyen/transformers.rs +++ b/crates/router/src/connector/adyen/transformers.rs @@ -1578,6 +1578,7 @@ impl<'a> TryFrom<&AdyenRouterData<&types::PaymentsAuthorizeRouterData>> domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::CardToken(_) => { Err(errors::ConnectorError::NotImplemented( @@ -2407,6 +2408,7 @@ impl<'a> domain::BankRedirectData::Sofort { .. } => Ok(AdyenPaymentMethod::Sofort), domain::BankRedirectData::Trustly { .. } => Ok(AdyenPaymentMethod::Trustly), domain::BankRedirectData::Interac { .. } + | domain::BankRedirectData::LocalBankRedirect {} | domain::BankRedirectData::Przelewy24 { .. } => { Err(errors::ConnectorError::NotImplemented( utils::get_unimplemented_payment_method_error_message("Adyen"), @@ -2568,6 +2570,7 @@ impl<'a> | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) diff --git a/crates/router/src/connector/airwallex/transformers.rs b/crates/router/src/connector/airwallex/transformers.rs index 9e830cf5aee..fcb492bedfa 100644 --- a/crates/router/src/connector/airwallex/transformers.rs +++ b/crates/router/src/connector/airwallex/transformers.rs @@ -200,6 +200,7 @@ impl TryFrom<&AirwallexRouterData<&types::PaymentsAuthorizeRouterData>> | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) diff --git a/crates/router/src/connector/authorizedotnet/transformers.rs b/crates/router/src/connector/authorizedotnet/transformers.rs index 24f5d08a7ec..26d1cacb5ca 100644 --- a/crates/router/src/connector/authorizedotnet/transformers.rs +++ b/crates/router/src/connector/authorizedotnet/transformers.rs @@ -338,6 +338,7 @@ impl TryFrom<&types::SetupMandateRouterData> for CreateCustomerProfileRequest { | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) @@ -515,6 +516,7 @@ impl TryFrom<&AuthorizedotnetRouterData<&types::PaymentsAuthorizeRouterData>> | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) @@ -572,6 +574,7 @@ impl | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) diff --git a/crates/router/src/connector/bambora/transformers.rs b/crates/router/src/connector/bambora/transformers.rs index af4afeca10d..6bb96f5e9bf 100644 --- a/crates/router/src/connector/bambora/transformers.rs +++ b/crates/router/src/connector/bambora/transformers.rs @@ -181,6 +181,7 @@ impl TryFrom<BamboraRouterData<&types::PaymentsAuthorizeRouterData>> for Bambora | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) diff --git a/crates/router/src/connector/bankofamerica/transformers.rs b/crates/router/src/connector/bankofamerica/transformers.rs index 143c1a4c6fa..5c8aec1686c 100644 --- a/crates/router/src/connector/bankofamerica/transformers.rs +++ b/crates/router/src/connector/bankofamerica/transformers.rs @@ -320,6 +320,7 @@ impl TryFrom<&types::SetupMandateRouterData> for BankOfAmericaPaymentsRequest { | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) @@ -394,6 +395,7 @@ impl<F, T> | common_enums::PaymentMethod::Crypto | common_enums::PaymentMethod::BankDebit | common_enums::PaymentMethod::Reward + | common_enums::PaymentMethod::RealTimePayment | common_enums::PaymentMethod::Upi | common_enums::PaymentMethod::Voucher | common_enums::PaymentMethod::GiftCard => None, @@ -1217,6 +1219,7 @@ impl TryFrom<&BankOfAmericaRouterData<&types::PaymentsAuthorizeRouterData>> | domain::PaymentMethodData::BankTransfer(_) | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) @@ -1267,6 +1270,7 @@ impl TryFrom<(&domain::PaymentMethodData, String)> for BankOfAmericaAuthSetupReq | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) @@ -1891,6 +1895,7 @@ impl TryFrom<&BankOfAmericaRouterData<&types::PaymentsPreProcessingRouterData>> | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) @@ -2000,6 +2005,7 @@ impl TryFrom<&BankOfAmericaRouterData<&types::PaymentsCompleteAuthorizeRouterDat | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) @@ -2228,6 +2234,7 @@ impl<F> | common_enums::PaymentMethod::Crypto | common_enums::PaymentMethod::BankDebit | common_enums::PaymentMethod::Reward + | common_enums::PaymentMethod::RealTimePayment | common_enums::PaymentMethod::Upi | common_enums::PaymentMethod::Voucher | common_enums::PaymentMethod::GiftCard => None, @@ -2301,6 +2308,7 @@ impl<F> | common_enums::PaymentMethod::Crypto | common_enums::PaymentMethod::BankDebit | common_enums::PaymentMethod::Reward + | common_enums::PaymentMethod::RealTimePayment | common_enums::PaymentMethod::Upi | common_enums::PaymentMethod::Voucher | common_enums::PaymentMethod::GiftCard => None, @@ -2516,6 +2524,7 @@ impl<F> | common_enums::PaymentMethod::Crypto | common_enums::PaymentMethod::BankDebit | common_enums::PaymentMethod::Reward + | common_enums::PaymentMethod::RealTimePayment | common_enums::PaymentMethod::Upi | common_enums::PaymentMethod::Voucher | common_enums::PaymentMethod::GiftCard => None, diff --git a/crates/router/src/connector/billwerk/transformers.rs b/crates/router/src/connector/billwerk/transformers.rs index 113f26b55f4..ddaa58cfd04 100644 --- a/crates/router/src/connector/billwerk/transformers.rs +++ b/crates/router/src/connector/billwerk/transformers.rs @@ -99,6 +99,7 @@ impl TryFrom<&types::TokenizationRouterData> for BillwerkTokenRequest { | domain::payments::PaymentMethodData::Crypto(_) | domain::payments::PaymentMethodData::MandatePayment | domain::payments::PaymentMethodData::Reward + | domain::payments::PaymentMethodData::RealTimePayment(_) | domain::payments::PaymentMethodData::Upi(_) | domain::payments::PaymentMethodData::Voucher(_) | domain::payments::PaymentMethodData::GiftCard(_) diff --git a/crates/router/src/connector/bluesnap/transformers.rs b/crates/router/src/connector/bluesnap/transformers.rs index b341f4e0498..281dad58945 100644 --- a/crates/router/src/connector/bluesnap/transformers.rs +++ b/crates/router/src/connector/bluesnap/transformers.rs @@ -228,6 +228,7 @@ impl TryFrom<&BluesnapRouterData<&types::PaymentsAuthorizeRouterData>> | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::CardRedirect(_) | domain::PaymentMethodData::Voucher(_) @@ -391,6 +392,7 @@ impl TryFrom<&BluesnapRouterData<&types::PaymentsAuthorizeRouterData>> for Blues | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::CardRedirect(_) | domain::PaymentMethodData::Voucher(_) diff --git a/crates/router/src/connector/boku/transformers.rs b/crates/router/src/connector/boku/transformers.rs index d07f343c91a..a1a239a6e1b 100644 --- a/crates/router/src/connector/boku/transformers.rs +++ b/crates/router/src/connector/boku/transformers.rs @@ -88,6 +88,7 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for BokuPaymentsRequest { | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) diff --git a/crates/router/src/connector/braintree/braintree_graphql_transformers.rs b/crates/router/src/connector/braintree/braintree_graphql_transformers.rs index 729f1f85922..bb8f2f5e38f 100644 --- a/crates/router/src/connector/braintree/braintree_graphql_transformers.rs +++ b/crates/router/src/connector/braintree/braintree_graphql_transformers.rs @@ -125,6 +125,7 @@ impl TryFrom<&BraintreeRouterData<&types::PaymentsAuthorizeRouterData>> | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) @@ -157,6 +158,7 @@ impl TryFrom<&BraintreeRouterData<&types::PaymentsCompleteAuthorizeRouterData>> | api_models::enums::PaymentMethod::Crypto | api_models::enums::PaymentMethod::BankDebit | api_models::enums::PaymentMethod::Reward + | api_models::enums::PaymentMethod::RealTimePayment | api_models::enums::PaymentMethod::Upi | api_models::enums::PaymentMethod::Voucher | api_models::enums::PaymentMethod::GiftCard => { @@ -881,6 +883,7 @@ impl TryFrom<&types::TokenizationRouterData> for BraintreeTokenRequest { | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) @@ -1434,6 +1437,7 @@ fn get_braintree_redirect_form( | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) diff --git a/crates/router/src/connector/braintree/transformers.rs b/crates/router/src/connector/braintree/transformers.rs index 2da6271b344..7fc34e75f97 100644 --- a/crates/router/src/connector/braintree/transformers.rs +++ b/crates/router/src/connector/braintree/transformers.rs @@ -171,6 +171,7 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for BraintreePaymentsRequest { | domain::PaymentMethodData::CardRedirect(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) diff --git a/crates/router/src/connector/checkout/transformers.rs b/crates/router/src/connector/checkout/transformers.rs index 35562907311..0a73d135f43 100644 --- a/crates/router/src/connector/checkout/transformers.rs +++ b/crates/router/src/connector/checkout/transformers.rs @@ -126,6 +126,7 @@ impl TryFrom<&types::TokenizationRouterData> for TokenRequest { | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::CardRedirect(_) @@ -361,6 +362,7 @@ impl TryFrom<&CheckoutRouterData<&types::PaymentsAuthorizeRouterData>> for Payme | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::CardRedirect(_) diff --git a/crates/router/src/connector/cryptopay/transformers.rs b/crates/router/src/connector/cryptopay/transformers.rs index 6c999727841..1101d42d4c1 100644 --- a/crates/router/src/connector/cryptopay/transformers.rs +++ b/crates/router/src/connector/cryptopay/transformers.rs @@ -74,6 +74,7 @@ impl TryFrom<&CryptopayRouterData<&types::PaymentsAuthorizeRouterData>> | domain::PaymentMethodData::BankTransfer(_) | domain::PaymentMethodData::MandatePayment {} | domain::PaymentMethodData::Reward {} + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) diff --git a/crates/router/src/connector/cybersource/transformers.rs b/crates/router/src/connector/cybersource/transformers.rs index a76a336fa10..b51bb5f4eb4 100644 --- a/crates/router/src/connector/cybersource/transformers.rs +++ b/crates/router/src/connector/cybersource/transformers.rs @@ -210,6 +210,7 @@ impl TryFrom<&types::SetupMandateRouterData> for CybersourceZeroMandateRequest { | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) @@ -1371,6 +1372,7 @@ impl TryFrom<&CybersourceRouterData<&types::PaymentsAuthorizeRouterData>> | domain::PaymentMethodData::BankTransfer(_) | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) @@ -1470,6 +1472,7 @@ impl TryFrom<&CybersourceRouterData<&types::PaymentsAuthorizeRouterData>> | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) @@ -2209,6 +2212,7 @@ impl TryFrom<&CybersourceRouterData<&types::PaymentsPreProcessingRouterData>> | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) @@ -2317,6 +2321,7 @@ impl TryFrom<&CybersourceRouterData<&types::PaymentsCompleteAuthorizeRouterData> | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) diff --git a/crates/router/src/connector/dlocal/transformers.rs b/crates/router/src/connector/dlocal/transformers.rs index b736c6a6c5a..b018dbcd2e9 100644 --- a/crates/router/src/connector/dlocal/transformers.rs +++ b/crates/router/src/connector/dlocal/transformers.rs @@ -162,6 +162,7 @@ impl TryFrom<&DlocalRouterData<&types::PaymentsAuthorizeRouterData>> for DlocalP | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) diff --git a/crates/router/src/connector/fiserv/transformers.rs b/crates/router/src/connector/fiserv/transformers.rs index 2dedb92d1dd..d2ed4a3c15c 100644 --- a/crates/router/src/connector/fiserv/transformers.rs +++ b/crates/router/src/connector/fiserv/transformers.rs @@ -184,6 +184,7 @@ impl TryFrom<&FiservRouterData<&types::PaymentsAuthorizeRouterData>> for FiservP | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) diff --git a/crates/router/src/connector/forte/transformers.rs b/crates/router/src/connector/forte/transformers.rs index 9a0881f63d1..637a3acd1e1 100644 --- a/crates/router/src/connector/forte/transformers.rs +++ b/crates/router/src/connector/forte/transformers.rs @@ -111,6 +111,7 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for FortePaymentsRequest { | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment {} | domain::PaymentMethodData::Reward {} + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) diff --git a/crates/router/src/connector/globepay/transformers.rs b/crates/router/src/connector/globepay/transformers.rs index ee2dedfe0a8..3cf1204a697 100644 --- a/crates/router/src/connector/globepay/transformers.rs +++ b/crates/router/src/connector/globepay/transformers.rs @@ -69,6 +69,7 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for GlobepayPaymentsRequest { | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) diff --git a/crates/router/src/connector/gocardless/transformers.rs b/crates/router/src/connector/gocardless/transformers.rs index 465086f60eb..d31d985500a 100644 --- a/crates/router/src/connector/gocardless/transformers.rs +++ b/crates/router/src/connector/gocardless/transformers.rs @@ -242,6 +242,7 @@ impl TryFrom<&types::TokenizationRouterData> for CustomerBankAccount { | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) @@ -410,6 +411,7 @@ impl TryFrom<&types::SetupMandateRouterData> for GocardlessMandateRequest { | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) diff --git a/crates/router/src/connector/helcim/transformers.rs b/crates/router/src/connector/helcim/transformers.rs index a3341ddab47..f882b341f63 100644 --- a/crates/router/src/connector/helcim/transformers.rs +++ b/crates/router/src/connector/helcim/transformers.rs @@ -159,6 +159,7 @@ impl TryFrom<&types::SetupMandateRouterData> for HelcimVerifyRequest { | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) @@ -260,6 +261,7 @@ impl TryFrom<&HelcimRouterData<&types::PaymentsAuthorizeRouterData>> for HelcimP | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) diff --git a/crates/router/src/connector/iatapay/transformers.rs b/crates/router/src/connector/iatapay/transformers.rs index b36792e90ca..f733dcdc96c 100644 --- a/crates/router/src/connector/iatapay/transformers.rs +++ b/crates/router/src/connector/iatapay/transformers.rs @@ -1,6 +1,5 @@ use std::collections::HashMap; -use api_models::enums::PaymentMethod; use common_utils::{errors::CustomResult, ext_traits::Encode}; use error_stack::ResultExt; use masking::{Secret, SwitchStrategy}; @@ -98,8 +97,8 @@ pub struct IatapayPaymentsRequest { merchant_id: Secret<String>, merchant_payment_id: Option<String>, amount: f64, - currency: String, - country: String, + currency: common_enums::Currency, + country: common_enums::CountryAlpha2, locale: String, redirect_urls: RedirectUrls, notification_url: String, @@ -130,38 +129,101 @@ impl >, >, ) -> Result<Self, Self::Error> { - let payment_method = item.router_data.payment_method; - let country = match payment_method { - PaymentMethod::Upi => "IN".to_string(), - PaymentMethod::Card - | PaymentMethod::CardRedirect - | PaymentMethod::PayLater - | PaymentMethod::Wallet - | PaymentMethod::BankRedirect - | PaymentMethod::BankTransfer - | PaymentMethod::Crypto - | PaymentMethod::BankDebit - | PaymentMethod::Reward - | PaymentMethod::Voucher - | PaymentMethod::GiftCard => item.router_data.get_billing_country()?.to_string(), - }; let return_url = item.router_data.get_return_url()?; - let (payer_info, preferred_checkout_method) = + // Iatapay processes transactions through the payment method selected based on the country + let (country, payer_info, preferred_checkout_method) = match item.router_data.request.payment_method_data.clone() { domain::PaymentMethodData::Upi(upi_type) => match upi_type { domain::UpiData::UpiCollect(upi_data) => ( + common_enums::CountryAlpha2::IN, upi_data.vpa_id.map(|id| PayerInfo { token_id: id.switch_strategy(), }), Some(PreferredCheckoutMethod::Vpa), ), - domain::UpiData::UpiIntent(_) => (None, Some(PreferredCheckoutMethod::Qr)), + domain::UpiData::UpiIntent(_) => ( + common_enums::CountryAlpha2::IN, + None, + Some(PreferredCheckoutMethod::Qr), + ), }, + domain::PaymentMethodData::BankRedirect(bank_redirect_data) => { + match bank_redirect_data { + domain::BankRedirectData::Ideal { .. } => { + (common_enums::CountryAlpha2::NL, None, None) + } + domain::BankRedirectData::LocalBankRedirect {} => { + let billing_country = item.router_data.get_billing_country()?; + ( + if matches!( + billing_country, + common_enums::CountryAlpha2::AT + | common_enums::CountryAlpha2::BE + | common_enums::CountryAlpha2::DE + | common_enums::CountryAlpha2::EE + | common_enums::CountryAlpha2::ES + | common_enums::CountryAlpha2::FI + | common_enums::CountryAlpha2::FR + | common_enums::CountryAlpha2::IE + | common_enums::CountryAlpha2::IT + | common_enums::CountryAlpha2::LU + | common_enums::CountryAlpha2::LV + | common_enums::CountryAlpha2::LT + | common_enums::CountryAlpha2::NL + | common_enums::CountryAlpha2::PT + ) { + billing_country + } else { + common_enums::CountryAlpha2::AT + }, + None, + None, + ) + } + domain::BankRedirectData::BancontactCard { .. } + | domain::BankRedirectData::Bizum {} + | domain::BankRedirectData::Blik { .. } + | domain::BankRedirectData::Eps { .. } + | domain::BankRedirectData::Giropay { .. } + | domain::BankRedirectData::Interac { .. } + | domain::BankRedirectData::OnlineBankingCzechRepublic { .. } + | domain::BankRedirectData::OnlineBankingFinland {} + | domain::BankRedirectData::OnlineBankingPoland { .. } + | domain::BankRedirectData::OnlineBankingSlovakia { .. } + | domain::BankRedirectData::OpenBankingUk { .. } + | domain::BankRedirectData::Przelewy24 { .. } + | domain::BankRedirectData::Sofort { .. } + | domain::BankRedirectData::Trustly { .. } + | domain::BankRedirectData::OnlineBankingFpx { .. } + | domain::BankRedirectData::OnlineBankingThailand { .. } => { + Err(errors::ConnectorError::NotImplemented( + connector_util::get_unimplemented_payment_method_error_message( + "iatapay", + ), + ))? + } + } + } + domain::PaymentMethodData::RealTimePayment(real_time_payment_data) => { + match *real_time_payment_data { + domain::RealTimePaymentData::DuitNow {} => { + (common_enums::CountryAlpha2::MY, None, None) + } + domain::RealTimePaymentData::Fps {} => { + (common_enums::CountryAlpha2::HK, None, None) + } + domain::RealTimePaymentData::PromptPay {} => { + (common_enums::CountryAlpha2::TH, None, None) + } + domain::RealTimePaymentData::VietQr {} => { + (common_enums::CountryAlpha2::VN, None, None) + } + } + } domain::PaymentMethodData::Card(_) | domain::PaymentMethodData::CardRedirect(_) | domain::PaymentMethodData::Wallet(_) | domain::PaymentMethodData::PayLater(_) - | domain::PaymentMethodData::BankRedirect(_) | domain::PaymentMethodData::BankDebit(_) | domain::PaymentMethodData::BankTransfer(_) | domain::PaymentMethodData::Crypto(_) @@ -169,15 +231,19 @@ impl | domain::PaymentMethodData::Reward | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) - | domain::PaymentMethodData::CardToken(_) => (None, None), + | domain::PaymentMethodData::CardToken(_) => { + Err(errors::ConnectorError::NotImplemented( + connector_util::get_unimplemented_payment_method_error_message("iatapay"), + ))? + } }; let payload = Self { merchant_id: IatapayAuthType::try_from(&item.router_data.connector_auth_type)? .merchant_id, merchant_payment_id: Some(item.router_data.connector_request_reference_id.clone()), amount: item.amount, - currency: item.router_data.request.currency.to_string(), - country: country.clone(), + currency: item.router_data.request.currency, + country, locale: format!("en-{}", country), redirect_urls: get_redirect_url(return_url), payer_info, diff --git a/crates/router/src/connector/klarna.rs b/crates/router/src/connector/klarna.rs index c5c078711c6..4796f15cb64 100644 --- a/crates/router/src/connector/klarna.rs +++ b/crates/router/src/connector/klarna.rs @@ -585,6 +585,7 @@ impl | common_enums::PaymentMethodType::Momo | common_enums::PaymentMethodType::MomoAtm | common_enums::PaymentMethodType::Multibanco + | common_enums::PaymentMethodType::LocalBankRedirect | common_enums::PaymentMethodType::OnlineBankingThailand | common_enums::PaymentMethodType::OnlineBankingCzechRepublic | common_enums::PaymentMethodType::OnlineBankingFinland @@ -623,7 +624,11 @@ impl | common_enums::PaymentMethodType::FamilyMart | common_enums::PaymentMethodType::Seicomart | common_enums::PaymentMethodType::PayEasy - | common_enums::PaymentMethodType::Mifinity, + | common_enums::PaymentMethodType::Mifinity + | common_enums::PaymentMethodType::Fps + | common_enums::PaymentMethodType::DuitNow + | common_enums::PaymentMethodType::PromptPay + | common_enums::PaymentMethodType::VietQr, ) => Err(error_stack::report!(errors::ConnectorError::NotSupported { message: payment_method_type.to_string(), connector: "klarna", @@ -641,6 +646,7 @@ impl | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) diff --git a/crates/router/src/connector/mifinity/transformers.rs b/crates/router/src/connector/mifinity/transformers.rs index ec68c399adb..5f0e4b9c9df 100644 --- a/crates/router/src/connector/mifinity/transformers.rs +++ b/crates/router/src/connector/mifinity/transformers.rs @@ -188,6 +188,7 @@ impl TryFrom<&MifinityRouterData<&types::PaymentsAuthorizeRouterData>> for Mifin | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) diff --git a/crates/router/src/connector/multisafepay/transformers.rs b/crates/router/src/connector/multisafepay/transformers.rs index 49e4c516265..2daf83cbacf 100644 --- a/crates/router/src/connector/multisafepay/transformers.rs +++ b/crates/router/src/connector/multisafepay/transformers.rs @@ -522,7 +522,8 @@ impl TryFrom<&MultisafepayRouterData<&types::PaymentsAuthorizeRouterData>> | domain::BankRedirectData::Sofort { .. } | domain::BankRedirectData::Trustly { .. } | domain::BankRedirectData::OnlineBankingFpx { .. } - | domain::BankRedirectData::OnlineBankingThailand { .. } => { + | domain::BankRedirectData::OnlineBankingThailand { .. } + | domain::BankRedirectData::LocalBankRedirect {} => { Err(errors::ConnectorError::NotImplemented( utils::get_unimplemented_payment_method_error_message("multisafepay"), ))? @@ -584,7 +585,8 @@ impl TryFrom<&MultisafepayRouterData<&types::PaymentsAuthorizeRouterData>> | domain::BankRedirectData::Sofort { .. } | domain::BankRedirectData::Trustly { .. } | domain::BankRedirectData::OnlineBankingFpx { .. } - | domain::BankRedirectData::OnlineBankingThailand { .. } => { + | domain::BankRedirectData::OnlineBankingThailand { .. } + | domain::BankRedirectData::LocalBankRedirect {} => { Err(errors::ConnectorError::NotImplemented( utils::get_unimplemented_payment_method_error_message("multisafepay"), ))? @@ -600,6 +602,7 @@ impl TryFrom<&MultisafepayRouterData<&types::PaymentsAuthorizeRouterData>> | domain::PaymentMethodData::BankTransfer(_) | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) @@ -769,7 +772,8 @@ impl TryFrom<&MultisafepayRouterData<&types::PaymentsAuthorizeRouterData>> | domain::BankRedirectData::Sofort { .. } | domain::BankRedirectData::Trustly { .. } | domain::BankRedirectData::OnlineBankingFpx { .. } - | domain::BankRedirectData::OnlineBankingThailand { .. } => None, + | domain::BankRedirectData::OnlineBankingThailand { .. } + | domain::BankRedirectData::LocalBankRedirect {} => None, } } domain::PaymentMethodData::MandatePayment => None, @@ -778,6 +782,7 @@ impl TryFrom<&MultisafepayRouterData<&types::PaymentsAuthorizeRouterData>> | domain::PaymentMethodData::BankTransfer(_) | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) diff --git a/crates/router/src/connector/nexinets/transformers.rs b/crates/router/src/connector/nexinets/transformers.rs index 8491091b9e7..c25da631b71 100644 --- a/crates/router/src/connector/nexinets/transformers.rs +++ b/crates/router/src/connector/nexinets/transformers.rs @@ -607,7 +607,8 @@ fn get_payment_details_and_product( | domain::BankRedirectData::Przelewy24 { .. } | domain::BankRedirectData::Trustly { .. } | domain::BankRedirectData::OnlineBankingFpx { .. } - | domain::BankRedirectData::OnlineBankingThailand { .. } => { + | domain::BankRedirectData::OnlineBankingThailand { .. } + | domain::BankRedirectData::LocalBankRedirect {} => { Err(errors::ConnectorError::NotImplemented( utils::get_unimplemented_payment_method_error_message("nexinets"), ))? @@ -620,6 +621,7 @@ fn get_payment_details_and_product( | PaymentMethodData::Crypto(_) | PaymentMethodData::MandatePayment | PaymentMethodData::Reward + | PaymentMethodData::RealTimePayment(_) | PaymentMethodData::Upi(_) | PaymentMethodData::Voucher(_) | PaymentMethodData::GiftCard(_) diff --git a/crates/router/src/connector/nmi/transformers.rs b/crates/router/src/connector/nmi/transformers.rs index b13b14d2758..c9d86b17ba8 100644 --- a/crates/router/src/connector/nmi/transformers.rs +++ b/crates/router/src/connector/nmi/transformers.rs @@ -585,6 +585,7 @@ impl | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) diff --git a/crates/router/src/connector/noon/transformers.rs b/crates/router/src/connector/noon/transformers.rs index 720851f79fa..0624e3cf957 100644 --- a/crates/router/src/connector/noon/transformers.rs +++ b/crates/router/src/connector/noon/transformers.rs @@ -323,6 +323,7 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for NoonPaymentsRequest { | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment {} | domain::PaymentMethodData::Reward {} + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) diff --git a/crates/router/src/connector/nuvei/transformers.rs b/crates/router/src/connector/nuvei/transformers.rs index 2f3b9459ee3..a23a05e34e3 100644 --- a/crates/router/src/connector/nuvei/transformers.rs +++ b/crates/router/src/connector/nuvei/transformers.rs @@ -959,7 +959,8 @@ where | domain::BankRedirectData::Trustly { .. } | domain::BankRedirectData::OnlineBankingFpx { .. } | domain::BankRedirectData::OnlineBankingThailand { .. } - | domain::BankRedirectData::OpenBankingUk { .. } => { + | domain::BankRedirectData::OpenBankingUk { .. } + | domain::BankRedirectData::LocalBankRedirect {} => { Err(errors::ConnectorError::NotImplemented( utils::get_unimplemented_payment_method_error_message("nuvei"), ) @@ -989,6 +990,7 @@ where | domain::PaymentMethodData::BankTransfer(_) | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::CardRedirect(_) @@ -1192,6 +1194,7 @@ impl TryFrom<(&types::PaymentsCompleteAuthorizeRouterData, Secret<String>)> | Some(domain::PaymentMethodData::Voucher(..)) | Some(domain::PaymentMethodData::CardRedirect(..)) | Some(domain::PaymentMethodData::Reward) + | Some(domain::PaymentMethodData::RealTimePayment(..)) | Some(domain::PaymentMethodData::Upi(..)) | Some(domain::PaymentMethodData::CardToken(..)) | None => Err(errors::ConnectorError::NotImplemented( diff --git a/crates/router/src/connector/opayo/transformers.rs b/crates/router/src/connector/opayo/transformers.rs index 327ec5def05..b6c05dff2d3 100644 --- a/crates/router/src/connector/opayo/transformers.rs +++ b/crates/router/src/connector/opayo/transformers.rs @@ -52,6 +52,7 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for OpayoPaymentsRequest { | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) diff --git a/crates/router/src/connector/payeezy/transformers.rs b/crates/router/src/connector/payeezy/transformers.rs index 9b6da9a0e93..c2d8e0dfddb 100644 --- a/crates/router/src/connector/payeezy/transformers.rs +++ b/crates/router/src/connector/payeezy/transformers.rs @@ -134,6 +134,7 @@ impl TryFrom<&PayeezyRouterData<&types::PaymentsAuthorizeRouterData>> for Payeez | diesel_models::enums::PaymentMethod::Crypto | diesel_models::enums::PaymentMethod::BankDebit | diesel_models::enums::PaymentMethod::Reward + | diesel_models::enums::PaymentMethod::RealTimePayment | diesel_models::enums::PaymentMethod::Upi | diesel_models::enums::PaymentMethod::Voucher | diesel_models::enums::PaymentMethod::GiftCard => { @@ -254,6 +255,7 @@ fn get_payment_method_data( | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) diff --git a/crates/router/src/connector/payme/transformers.rs b/crates/router/src/connector/payme/transformers.rs index 6e7653887bc..7c6f426d38b 100644 --- a/crates/router/src/connector/payme/transformers.rs +++ b/crates/router/src/connector/payme/transformers.rs @@ -420,6 +420,7 @@ impl TryFrom<&PaymentMethodData> for SalePaymentMethod { | PaymentMethodData::Crypto(_) | PaymentMethodData::MandatePayment | PaymentMethodData::Reward + | PaymentMethodData::RealTimePayment(_) | PaymentMethodData::GiftCard(_) | PaymentMethodData::CardRedirect(_) | PaymentMethodData::Upi(_) @@ -661,6 +662,7 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for PayRequest { | PaymentMethodData::Crypto(_) | PaymentMethodData::MandatePayment | PaymentMethodData::Reward + | PaymentMethodData::RealTimePayment(_) | PaymentMethodData::Upi(_) | PaymentMethodData::Voucher(_) | PaymentMethodData::GiftCard(_) @@ -719,6 +721,7 @@ impl TryFrom<&types::PaymentsCompleteAuthorizeRouterData> for Pay3dsRequest { | Some(PaymentMethodData::Crypto(_)) | Some(PaymentMethodData::MandatePayment) | Some(PaymentMethodData::Reward) + | Some(PaymentMethodData::RealTimePayment(_)) | Some(PaymentMethodData::Upi(_)) | Some(PaymentMethodData::Voucher(_)) | Some(PaymentMethodData::GiftCard(_)) @@ -757,6 +760,7 @@ impl TryFrom<&types::TokenizationRouterData> for CaptureBuyerRequest { | PaymentMethodData::Crypto(_) | PaymentMethodData::MandatePayment | PaymentMethodData::Reward + | PaymentMethodData::RealTimePayment(_) | PaymentMethodData::Upi(_) | PaymentMethodData::Voucher(_) | PaymentMethodData::GiftCard(_) diff --git a/crates/router/src/connector/paypal/transformers.rs b/crates/router/src/connector/paypal/transformers.rs index 0a0e96c501c..755623b8781 100644 --- a/crates/router/src/connector/paypal/transformers.rs +++ b/crates/router/src/connector/paypal/transformers.rs @@ -363,7 +363,8 @@ fn get_payment_source( | domain::BankRedirectData::OpenBankingUk { .. } | domain::BankRedirectData::Trustly { .. } | domain::BankRedirectData::OnlineBankingFpx { .. } - | domain::BankRedirectData::OnlineBankingThailand { .. } => { + | domain::BankRedirectData::OnlineBankingThailand { .. } + | domain::BankRedirectData::LocalBankRedirect {} => { Err(errors::ConnectorError::NotImplemented( utils::get_unimplemented_payment_method_error_message("Paypal"), ))? @@ -557,6 +558,7 @@ impl TryFrom<&PaypalRouterData<&types::PaymentsAuthorizeRouterData>> for PaypalP .into()) } domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::CardToken(_) => { diff --git a/crates/router/src/connector/placetopay/transformers.rs b/crates/router/src/connector/placetopay/transformers.rs index ef6bde8f1a2..50813a81629 100644 --- a/crates/router/src/connector/placetopay/transformers.rs +++ b/crates/router/src/connector/placetopay/transformers.rs @@ -147,6 +147,7 @@ impl TryFrom<&PlacetopayRouterData<&types::PaymentsAuthorizeRouterData>> | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) diff --git a/crates/router/src/connector/powertranz/transformers.rs b/crates/router/src/connector/powertranz/transformers.rs index e47e0f51206..6fe1a7173be 100644 --- a/crates/router/src/connector/powertranz/transformers.rs +++ b/crates/router/src/connector/powertranz/transformers.rs @@ -112,6 +112,7 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for PowertranzPaymentsRequest | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) diff --git a/crates/router/src/connector/shift4/transformers.rs b/crates/router/src/connector/shift4/transformers.rs index ac597b73461..80ef0daaf21 100644 --- a/crates/router/src/connector/shift4/transformers.rs +++ b/crates/router/src/connector/shift4/transformers.rs @@ -245,6 +245,7 @@ where | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::CardToken(_) => { Err(errors::ConnectorError::NotImplemented( @@ -466,6 +467,7 @@ impl<T> TryFrom<&types::RouterData<T, types::CompleteAuthorizeData, types::Payme | Some(domain::PaymentMethodData::MandatePayment) | Some(domain::PaymentMethodData::Voucher(_)) | Some(domain::PaymentMethodData::Reward) + | Some(domain::PaymentMethodData::RealTimePayment(_)) | Some(domain::PaymentMethodData::Upi(_)) | Some(domain::PaymentMethodData::CardToken(_)) | None => Err(errors::ConnectorError::NotImplemented( @@ -496,7 +498,8 @@ impl TryFrom<&domain::BankRedirectData> for PaymentMethodType { | domain::BankRedirectData::OnlineBankingSlovakia { .. } | domain::BankRedirectData::OpenBankingUk { .. } | domain::BankRedirectData::OnlineBankingFpx { .. } - | domain::BankRedirectData::OnlineBankingThailand { .. } => { + | domain::BankRedirectData::OnlineBankingThailand { .. } + | domain::BankRedirectData::LocalBankRedirect {} => { Err(errors::ConnectorError::NotImplemented( utils::get_unimplemented_payment_method_error_message("Shift4"), ) diff --git a/crates/router/src/connector/square/transformers.rs b/crates/router/src/connector/square/transformers.rs index 8e7b7a7c336..15de18c8890 100644 --- a/crates/router/src/connector/square/transformers.rs +++ b/crates/router/src/connector/square/transformers.rs @@ -171,6 +171,7 @@ impl TryFrom<&types::TokenizationRouterData> for SquareTokenRequest { | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::CardToken(_) => { @@ -286,6 +287,7 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for SquarePaymentsRequest { | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::CardToken(_) => { diff --git a/crates/router/src/connector/stax/transformers.rs b/crates/router/src/connector/stax/transformers.rs index d3072654028..65ee90830a3 100644 --- a/crates/router/src/connector/stax/transformers.rs +++ b/crates/router/src/connector/stax/transformers.rs @@ -103,6 +103,7 @@ impl TryFrom<&StaxRouterData<&types::PaymentsAuthorizeRouterData>> for StaxPayme | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) | domain::PaymentMethodData::CardRedirect(_) @@ -254,6 +255,7 @@ impl TryFrom<&types::TokenizationRouterData> for StaxTokenRequest { | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) | domain::PaymentMethodData::CardRedirect(_) diff --git a/crates/router/src/connector/stripe/transformers.rs b/crates/router/src/connector/stripe/transformers.rs index 37122aa08f5..10d091a3b84 100644 --- a/crates/router/src/connector/stripe/transformers.rs +++ b/crates/router/src/connector/stripe/transformers.rs @@ -694,6 +694,7 @@ impl TryFrom<enums::PaymentMethodType> for StripePaymentMethodType { | enums::PaymentMethodType::Gcash | enums::PaymentMethodType::Interac | enums::PaymentMethodType::KakaoPay + | enums::PaymentMethodType::LocalBankRedirect | enums::PaymentMethodType::MbWay | enums::PaymentMethodType::MobilePay | enums::PaymentMethodType::Momo @@ -737,6 +738,10 @@ impl TryFrom<enums::PaymentMethodType> for StripePaymentMethodType { | enums::PaymentMethodType::PayEasy | enums::PaymentMethodType::LocalBankTransfer | enums::PaymentMethodType::Walley + | enums::PaymentMethodType::Fps + | enums::PaymentMethodType::DuitNow + | enums::PaymentMethodType::PromptPay + | enums::PaymentMethodType::VietQr | enums::PaymentMethodType::Mifinity => Err(errors::ConnectorError::NotImplemented( connector_util::get_unimplemented_payment_method_error_message("stripe"), ) @@ -1009,7 +1014,8 @@ impl TryFrom<&domain::BankRedirectData> for StripePaymentMethodType { | domain::BankRedirectData::OnlineBankingSlovakia { .. } | domain::BankRedirectData::OnlineBankingThailand { .. } | domain::BankRedirectData::OpenBankingUk { .. } - | domain::BankRedirectData::Trustly { .. } => { + | domain::BankRedirectData::Trustly { .. } + | domain::BankRedirectData::LocalBankRedirect {} => { Err(errors::ConnectorError::NotImplemented( connector_util::get_unimplemented_payment_method_error_message("stripe"), )) @@ -1323,6 +1329,7 @@ fn create_stripe_payment_method( }, domain::PaymentMethodData::Upi(_) + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::CardToken(_) => Err(errors::ConnectorError::NotImplemented( connector_util::get_unimplemented_payment_method_error_message("stripe"), @@ -1538,7 +1545,8 @@ impl TryFrom<(&domain::BankRedirectData, Option<StripeBillingAddress>)> | domain::BankRedirectData::OnlineBankingSlovakia { .. } | domain::BankRedirectData::OnlineBankingThailand { .. } | domain::BankRedirectData::OpenBankingUk { .. } - | domain::BankRedirectData::Trustly { .. } => { + | domain::BankRedirectData::Trustly { .. } + | domain::BankRedirectData::LocalBankRedirect {} => { Err(errors::ConnectorError::NotImplemented( connector_util::get_unimplemented_payment_method_error_message("stripe"), ) @@ -1695,6 +1703,7 @@ impl TryFrom<(&types::PaymentsAuthorizeRouterData, MinorUnit)> for PaymentIntent | domain::payments::PaymentMethodData::Crypto(_) | domain::payments::PaymentMethodData::MandatePayment | domain::payments::PaymentMethodData::Reward + | domain::payments::PaymentMethodData::RealTimePayment(_) | domain::payments::PaymentMethodData::Upi(_) | domain::payments::PaymentMethodData::Voucher(_) | domain::payments::PaymentMethodData::GiftCard(_) @@ -3263,6 +3272,7 @@ impl | Some(domain::PaymentMethodData::PayLater(..)) | Some(domain::PaymentMethodData::Crypto(..)) | Some(domain::PaymentMethodData::Reward) + | Some(domain::PaymentMethodData::RealTimePayment(..)) | Some(domain::PaymentMethodData::MandatePayment) | Some(domain::PaymentMethodData::Upi(..)) | Some(domain::PaymentMethodData::GiftCard(..)) @@ -3716,6 +3726,7 @@ impl domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::GiftCard(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::CardRedirect(_) diff --git a/crates/router/src/connector/trustpay/transformers.rs b/crates/router/src/connector/trustpay/transformers.rs index f6c494170f2..1227191beb3 100644 --- a/crates/router/src/connector/trustpay/transformers.rs +++ b/crates/router/src/connector/trustpay/transformers.rs @@ -241,7 +241,8 @@ impl TryFrom<&domain::BankRedirectData> for TrustpayPaymentMethod { | domain::BankRedirectData::Przelewy24 { .. } | domain::BankRedirectData::Trustly { .. } | domain::BankRedirectData::OnlineBankingFpx { .. } - | domain::BankRedirectData::OnlineBankingThailand { .. } => { + | domain::BankRedirectData::OnlineBankingThailand { .. } + | domain::BankRedirectData::LocalBankRedirect {} => { Err(errors::ConnectorError::NotImplemented( utils::get_unimplemented_payment_method_error_message("trustpay"), ) @@ -435,6 +436,7 @@ impl TryFrom<&TrustpayRouterData<&types::PaymentsAuthorizeRouterData>> for Trust | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) diff --git a/crates/router/src/connector/tsys/transformers.rs b/crates/router/src/connector/tsys/transformers.rs index 2febb9c72ec..cea51ce77e1 100644 --- a/crates/router/src/connector/tsys/transformers.rs +++ b/crates/router/src/connector/tsys/transformers.rs @@ -72,6 +72,7 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for TsysPaymentsRequest { | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) diff --git a/crates/router/src/connector/utils.rs b/crates/router/src/connector/utils.rs index 0f84545cc1f..e1ef11265c0 100644 --- a/crates/router/src/connector/utils.rs +++ b/crates/router/src/connector/utils.rs @@ -588,6 +588,8 @@ impl<Flow, Request, Response> RouterData for types::RouterData<Flow, Request, Re pub trait AddressData { fn get_email(&self) -> Result<Email, Error>; fn get_phone_with_country_code(&self) -> Result<Secret<String>, Error>; + fn get_optional_country(&self) -> Option<enums::CountryAlpha2>; + fn get_optional_full_name(&self) -> Option<Secret<String>>; } impl AddressData for api::Address { @@ -602,6 +604,18 @@ impl AddressData for api::Address { .transpose()? .ok_or_else(missing_field_err("phone")) } + + fn get_optional_country(&self) -> Option<enums::CountryAlpha2> { + self.address + .as_ref() + .and_then(|billing_address_details| billing_address_details.country) + } + + fn get_optional_full_name(&self) -> Option<Secret<String>> { + self.address + .as_ref() + .and_then(|billing_address| billing_address.get_optional_full_name()) + } } pub trait PaymentsPreProcessingData { @@ -2555,6 +2569,7 @@ pub enum PaymentMethodDataType { ApplePayRedirect, ApplePayThirdPartySdk, DanaRedirect, + DuitNow, GooglePay, GooglePayRedirect, GooglePayThirdPartySdk, @@ -2585,6 +2600,7 @@ pub enum PaymentMethodDataType { Giropay, Ideal, Interac, + LocalBankRedirect, OnlineBankingCzechRepublic, OnlineBankingFinland, OnlineBankingPoland, @@ -2635,6 +2651,9 @@ pub enum PaymentMethodDataType { CardToken, LocalBankTransfer, Mifinity, + Fps, + PromptPay, + VietQr, } impl From<domain::payments::PaymentMethodData> for PaymentMethodDataType { @@ -2727,6 +2746,9 @@ impl From<domain::payments::PaymentMethodData> for PaymentMethodDataType { domain::payments::BankRedirectData::OnlineBankingThailand { .. } => { Self::OnlineBankingThailand } + domain::payments::BankRedirectData::LocalBankRedirect { } => { + Self::LocalBankRedirect + } } } domain::payments::PaymentMethodData::BankDebit(bank_debit_data) => { @@ -2799,6 +2821,12 @@ impl From<domain::payments::PaymentMethodData> for PaymentMethodDataType { domain::payments::VoucherData::Seicomart(_) => Self::Seicomart, domain::payments::VoucherData::PayEasy(_) => Self::PayEasy, }, + domain::PaymentMethodData::RealTimePayment(real_time_payment_data) => match *real_time_payment_data{ + hyperswitch_domain_models::payment_method_data::RealTimePaymentData::DuitNow { } => Self::DuitNow, + hyperswitch_domain_models::payment_method_data::RealTimePaymentData::Fps { } => Self::Fps, + hyperswitch_domain_models::payment_method_data::RealTimePaymentData::PromptPay { } => Self::PromptPay, + hyperswitch_domain_models::payment_method_data::RealTimePaymentData::VietQr { } => Self::VietQr, + }, domain::payments::PaymentMethodData::GiftCard(gift_card_data) => { match *gift_card_data { domain::payments::GiftCardData::Givex(_) => Self::Givex, diff --git a/crates/router/src/connector/volt/transformers.rs b/crates/router/src/connector/volt/transformers.rs index 19e3b06fae0..12064fdf0f4 100644 --- a/crates/router/src/connector/volt/transformers.rs +++ b/crates/router/src/connector/volt/transformers.rs @@ -129,7 +129,8 @@ impl TryFrom<&VoltRouterData<&types::PaymentsAuthorizeRouterData>> for VoltPayme | domain::BankRedirectData::Sofort { .. } | domain::BankRedirectData::Trustly { .. } | domain::BankRedirectData::OnlineBankingFpx { .. } - | domain::BankRedirectData::OnlineBankingThailand { .. } => { + | domain::BankRedirectData::OnlineBankingThailand { .. } + | domain::BankRedirectData::LocalBankRedirect {} => { Err(errors::ConnectorError::NotImplemented( utils::get_unimplemented_payment_method_error_message("Volt"), ) @@ -145,6 +146,7 @@ impl TryFrom<&VoltRouterData<&types::PaymentsAuthorizeRouterData>> for VoltPayme | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) diff --git a/crates/router/src/connector/worldline/transformers.rs b/crates/router/src/connector/worldline/transformers.rs index 06d608a172e..fe1bcab0bb2 100644 --- a/crates/router/src/connector/worldline/transformers.rs +++ b/crates/router/src/connector/worldline/transformers.rs @@ -245,6 +245,7 @@ impl | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) @@ -403,7 +404,8 @@ fn make_bank_redirect_request( | domain::BankRedirectData::Sofort { .. } | domain::BankRedirectData::Trustly { .. } | domain::BankRedirectData::OnlineBankingFpx { .. } - | domain::BankRedirectData::OnlineBankingThailand { .. } => { + | domain::BankRedirectData::OnlineBankingThailand { .. } + | domain::BankRedirectData::LocalBankRedirect {} => { return Err(errors::ConnectorError::NotImplemented( utils::get_unimplemented_payment_method_error_message("worldline"), ) diff --git a/crates/router/src/connector/worldpay/transformers.rs b/crates/router/src/connector/worldpay/transformers.rs index b82aa338e27..5caf6b0e1f1 100644 --- a/crates/router/src/connector/worldpay/transformers.rs +++ b/crates/router/src/connector/worldpay/transformers.rs @@ -103,6 +103,7 @@ fn fetch_payment_instrument( | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::CardRedirect(_) diff --git a/crates/router/src/connector/zen/transformers.rs b/crates/router/src/connector/zen/transformers.rs index a8edd9f99e0..026c39f0e3e 100644 --- a/crates/router/src/connector/zen/transformers.rs +++ b/crates/router/src/connector/zen/transformers.rs @@ -692,6 +692,7 @@ impl TryFrom<&ZenRouterData<&types::PaymentsAuthorizeRouterData>> for ZenPayment domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::CardToken(_) => { Err(errors::ConnectorError::NotImplemented( @@ -722,7 +723,8 @@ impl TryFrom<&domain::BankRedirectData> for ZenPaymentsRequest { | domain::BankRedirectData::OnlineBankingSlovakia { .. } | domain::BankRedirectData::OpenBankingUk { .. } | domain::BankRedirectData::OnlineBankingFpx { .. } - | domain::BankRedirectData::OnlineBankingThailand { .. } => { + | domain::BankRedirectData::OnlineBankingThailand { .. } + | domain::BankRedirectData::LocalBankRedirect {} => { Err(errors::ConnectorError::NotImplemented( utils::get_unimplemented_payment_method_error_message("Zen"), ) diff --git a/crates/router/src/connector/zsl/transformers.rs b/crates/router/src/connector/zsl/transformers.rs index 83aa2189950..f44d46cd8e0 100644 --- a/crates/router/src/connector/zsl/transformers.rs +++ b/crates/router/src/connector/zsl/transformers.rs @@ -177,6 +177,7 @@ impl TryFrom<&ZslRouterData<&types::PaymentsAuthorizeRouterData>> for ZslPayment | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::MandatePayment | domain::PaymentMethodData::Reward + | domain::PaymentMethodData::RealTimePayment(_) | domain::PaymentMethodData::Upi(_) | domain::PaymentMethodData::Voucher(_) | domain::PaymentMethodData::GiftCard(_) diff --git a/crates/router/src/core/payment_methods.rs b/crates/router/src/core/payment_methods.rs index 1172ed0eabc..4bde9f42c81 100644 --- a/crates/router/src/core/payment_methods.rs +++ b/crates/router/src/core/payment_methods.rs @@ -49,6 +49,7 @@ pub async fn retrieve_payment_method( pm @ Some(api::PaymentMethodData::Upi(_)) => Ok((pm.to_owned(), None)), pm @ Some(api::PaymentMethodData::Voucher(_)) => Ok((pm.to_owned(), None)), pm @ Some(api::PaymentMethodData::Reward) => Ok((pm.to_owned(), None)), + pm @ Some(api::PaymentMethodData::RealTimePayment(_)) => Ok((pm.to_owned(), None)), pm @ Some(api::PaymentMethodData::CardRedirect(_)) => Ok((pm.to_owned(), None)), pm @ Some(api::PaymentMethodData::GiftCard(_)) => Ok((pm.to_owned(), None)), pm_opt @ Some(pm @ api::PaymentMethodData::BankTransfer(_)) => { diff --git a/crates/router/src/core/payments/helpers.rs b/crates/router/src/core/payments/helpers.rs index c94c1c714c7..052c4b19286 100644 --- a/crates/router/src/core/payments/helpers.rs +++ b/crates/router/src/core/payments/helpers.rs @@ -2305,6 +2305,7 @@ pub fn validate_payment_method_type_against_payment_method( | api_enums::PaymentMethodType::Eps | api_enums::PaymentMethodType::BancontactCard | api_enums::PaymentMethodType::Blik + | api_enums::PaymentMethodType::LocalBankRedirect | api_enums::PaymentMethodType::OnlineBankingThailand | api_enums::PaymentMethodType::OnlineBankingCzechRepublic | api_enums::PaymentMethodType::OnlineBankingFinland @@ -2349,6 +2350,13 @@ pub fn validate_payment_method_type_against_payment_method( payment_method_type, api_enums::PaymentMethodType::Evoucher | api_enums::PaymentMethodType::ClassicReward ), + api_enums::PaymentMethod::RealTimePayment => matches!( + payment_method_type, + api_enums::PaymentMethodType::Fps + | api_enums::PaymentMethodType::DuitNow + | api_enums::PaymentMethodType::PromptPay + | api_enums::PaymentMethodType::VietQr + ), api_enums::PaymentMethod::Upi => matches!( payment_method_type, api_enums::PaymentMethodType::UpiCollect | api_enums::PaymentMethodType::UpiIntent @@ -3880,6 +3888,9 @@ pub async fn get_additional_payment_data( api_models::payments::PaymentMethodData::Reward => { api_models::payments::AdditionalPaymentData::Reward {} } + api_models::payments::PaymentMethodData::RealTimePayment(_) => { + api_models::payments::AdditionalPaymentData::RealTimePayment {} + } api_models::payments::PaymentMethodData::Upi(_) => { api_models::payments::AdditionalPaymentData::Upi {} } @@ -4347,6 +4358,11 @@ pub fn get_key_params_for_surcharge_details( )), api_models::payments::PaymentMethodData::MandatePayment => None, api_models::payments::PaymentMethodData::Reward => None, + api_models::payments::PaymentMethodData::RealTimePayment(real_time_payment) => Some(( + common_enums::PaymentMethod::RealTimePayment, + real_time_payment.get_payment_method_type(), + None, + )), api_models::payments::PaymentMethodData::Upi(upi_data) => Some(( common_enums::PaymentMethod::Upi, upi_data.get_payment_method_type(), diff --git a/crates/router/src/types/domain/payments.rs b/crates/router/src/types/domain/payments.rs index 6fc8f26db51..a3ed6b886a1 100644 --- a/crates/router/src/types/domain/payments.rs +++ b/crates/router/src/types/domain/payments.rs @@ -5,6 +5,7 @@ pub use hyperswitch_domain_models::payment_method_data::{ GoPayRedirection, GooglePayPaymentMethodInfo, GooglePayRedirectData, GooglePayThirdPartySdkData, GooglePayWalletData, GpayTokenizationData, IndomaretVoucherData, KakaoPayRedirection, MbWayRedirection, MifinityData, PayLaterData, PaymentMethodData, - SamsungPayWalletData, SepaAndBacsBillingDetails, SwishQrData, TouchNGoRedirection, - UpiCollectData, UpiData, UpiIntentData, VoucherData, WalletData, WeChatPayQr, + RealTimePaymentData, SamsungPayWalletData, SepaAndBacsBillingDetails, SwishQrData, + TouchNGoRedirection, UpiCollectData, UpiData, UpiIntentData, VoucherData, WalletData, + WeChatPayQr, }; diff --git a/crates/router/src/types/transformers.rs b/crates/router/src/types/transformers.rs index b71a14c4b2b..94d84d8ccae 100644 --- a/crates/router/src/types/transformers.rs +++ b/crates/router/src/types/transformers.rs @@ -452,6 +452,7 @@ impl ForeignFrom<api_enums::PaymentMethodType> for api_enums::PaymentMethod { | api_enums::PaymentMethodType::Eps | api_enums::PaymentMethodType::BancontactCard | api_enums::PaymentMethodType::Blik + | api_enums::PaymentMethodType::LocalBankRedirect | api_enums::PaymentMethodType::OnlineBankingThailand | api_enums::PaymentMethodType::OnlineBankingCzechRepublic | api_enums::PaymentMethodType::OnlineBankingFinland @@ -508,6 +509,10 @@ impl ForeignFrom<api_enums::PaymentMethodType> for api_enums::PaymentMethod { | api_enums::PaymentMethodType::Knet | api_enums::PaymentMethodType::MomoAtm | api_enums::PaymentMethodType::CardRedirect => Self::CardRedirect, + api_enums::PaymentMethodType::Fps + | api_enums::PaymentMethodType::DuitNow + | api_enums::PaymentMethodType::PromptPay + | api_enums::PaymentMethodType::VietQr => Self::RealTimePayment, } } } @@ -528,6 +533,7 @@ impl ForeignTryFrom<payments::PaymentMethodData> for api_enums::PaymentMethod { payments::PaymentMethodData::BankTransfer(..) => Ok(Self::BankTransfer), payments::PaymentMethodData::Crypto(..) => Ok(Self::Crypto), payments::PaymentMethodData::Reward => Ok(Self::Reward), + payments::PaymentMethodData::RealTimePayment(..) => Ok(Self::RealTimePayment), payments::PaymentMethodData::Upi(..) => Ok(Self::Upi), payments::PaymentMethodData::Voucher(..) => Ok(Self::Voucher), payments::PaymentMethodData::GiftCard(..) => Ok(Self::GiftCard),
feat
[Iatapay] add payment methods (#4968)
f0db9937c7b33858a1ff3e17eaecba094ca4c18c
2023-05-25 17:09:08
Abhishek Marrivagu
refactor(configs): make kms module and KmsDecrypt pub (#1274)
false
diff --git a/crates/router/src/configs.rs b/crates/router/src/configs.rs index 95bdd524022..bb8f61646f2 100644 --- a/crates/router/src/configs.rs +++ b/crates/router/src/configs.rs @@ -1,5 +1,5 @@ mod defaults; #[cfg(feature = "kms")] -pub(super) mod kms; +pub mod kms; pub mod settings; mod validations; diff --git a/crates/router/src/configs/kms.rs b/crates/router/src/configs/kms.rs index 367a1b6a4a7..5f1c4726d7f 100644 --- a/crates/router/src/configs/kms.rs +++ b/crates/router/src/configs/kms.rs @@ -6,7 +6,7 @@ use crate::configs::settings; #[async_trait::async_trait] // This trait performs inplace decryption of the structure on which this is implemented -pub(crate) trait KmsDecrypt { +pub trait KmsDecrypt { async fn decrypt_inner(self, kms_config: &kms::KmsConfig) -> CustomResult<Self, kms::KmsError> where Self: Sized;
refactor
make kms module and KmsDecrypt pub (#1274)
90c932a6d798453f7e828c55a7668c5c64c933a5
2025-01-21 12:07:29
Pa1NarK
fix(cypress): address cybersource redirection inconsistency (#7057)
false
diff --git a/.github/workflows/cypress-tests-runner.yml b/.github/workflows/cypress-tests-runner.yml index 6272da95ced..72429627ff7 100644 --- a/.github/workflows/cypress-tests-runner.yml +++ b/.github/workflows/cypress-tests-runner.yml @@ -14,7 +14,7 @@ env: CARGO_INCREMENTAL: 0 CARGO_NET_RETRY: 10 PAYMENTS_CONNECTORS: "cybersource stripe" - PAYOUTS_CONNECTORS: "adyenplatform wise" + PAYOUTS_CONNECTORS: "wise" RUST_BACKTRACE: short RUSTUP_MAX_RETRIES: 10 RUN_TESTS: ${{ ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name)) || (github.event_name == 'merge_group')}} @@ -149,7 +149,7 @@ jobs: run: | LOCAL_ADMIN_API_KEY=$(yq '.secrets.admin_api_key' ${TOML_PATH}) echo "CYPRESS_ADMINAPIKEY=${LOCAL_ADMIN_API_KEY}" >> $GITHUB_ENV - + - name: Install mold linker if: ${{ runner.os == 'Linux' && env.RUN_TESTS == 'true' }} uses: rui314/setup-mold@v1 diff --git a/cypress-tests/.gitignore b/cypress-tests/.gitignore index 663fbaa3f4d..fc03eb39cb3 100644 --- a/cypress-tests/.gitignore +++ b/cypress-tests/.gitignore @@ -1,5 +1,10 @@ +# Mac OS files .DS_Store + +# Output files +reports/ +screenshots/ +videos/ + creds.json -reports run_all.sh -screenshots diff --git a/cypress-tests/cypress.config.js b/cypress-tests/cypress.config.js index a501f7b3e80..913663c509e 100644 --- a/cypress-tests/cypress.config.js +++ b/cypress-tests/cypress.config.js @@ -1,5 +1,6 @@ import { defineConfig } from "cypress"; import mochawesome from "cypress-mochawesome-reporter/plugin.js"; +import fs from "fs"; let globalState; @@ -28,7 +29,18 @@ export default defineConfig({ return null; }, }); - + on("after:spec", (spec, results) => { + if (results && results.video) { + // Do we have failures for any retry attempts? + const failures = results.tests.some((test) => + test.attempts.some((attempt) => attempt.state === "failed") + ); + if (!failures) { + // delete the video if the spec passed and no tests retried + fs.unlinkSync(results.video); + } + } + }); return config; }, experimentalRunAllSpecs: true, @@ -47,5 +59,8 @@ export default defineConfig({ chromeWebSecurity: false, defaultCommandTimeout: 10000, pageLoadTimeout: 20000, + responseTimeout: 30000, screenshotsFolder: screenshotsFolderName, + video: true, + videoCompression: 32, }); diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Cybersource.js b/cypress-tests/cypress/e2e/PaymentUtils/Cybersource.js index 6877d609ac1..f918fb2592e 100644 --- a/cypress-tests/cypress/e2e/PaymentUtils/Cybersource.js +++ b/cypress-tests/cypress/e2e/PaymentUtils/Cybersource.js @@ -12,7 +12,7 @@ const successfulNo3DSCardDetails = { }; const successfulThreeDSTestCardDetails = { - card_number: "4000000000001091", + card_number: "4000000000002701", card_exp_month: "01", card_exp_year: "50", card_holder_name: "joseph Doe", @@ -79,7 +79,7 @@ const payment_method_data_no3ds = { const payment_method_data_3ds = { card: { - last4: "1091", + last4: "2701", card_type: "CREDIT", card_network: "Visa", card_issuer: "INTL HDQTRS-CENTER OWNED", diff --git a/cypress-tests/cypress/support/e2e.js b/cypress-tests/cypress/support/e2e.js index a3e0203027c..7013dc8ddc0 100644 --- a/cypress-tests/cypress/support/e2e.js +++ b/cypress-tests/cypress/support/e2e.js @@ -19,3 +19,9 @@ import "./commands"; // Alternatively you can use CommonJS syntax: // require('./commands') + +Cypress.on("uncaught:exception", (err) => { + // returning false here prevents Cypress from failing the test + cy.log(`Unhandled exception: ${err}`); + return false; +}); diff --git a/cypress-tests/cypress/support/redirectionHandler.js b/cypress-tests/cypress/support/redirectionHandler.js index e6d1f21a14c..2cfa8a1f72b 100644 --- a/cypress-tests/cypress/support/redirectionHandler.js +++ b/cypress-tests/cypress/support/redirectionHandler.js @@ -272,12 +272,18 @@ function bankRedirectRedirection( } cy.then(() => { - verifyReturnUrl(redirection_url, expected_url, verifyUrl); + try { + verifyReturnUrl(redirection_url, expected_url, verifyUrl); + } catch (error) { + cy.log("Error during return URL verification:", error); + throw error; + } }); } function threeDsRedirection(redirection_url, expected_url, connectorId) { cy.visit(redirection_url.href); + if (connectorId === "adyen") { cy.get("iframe") .its("0.contentDocument.body") @@ -286,17 +292,32 @@ function threeDsRedirection(redirection_url, expected_url, connectorId) { cy.get('input[type="password"]').type("password"); cy.get("#buttonSubmit").click(); }); - } else if ( - connectorId === "bankofamerica" || - connectorId === "cybersource" || - connectorId === "wellsfargo" - ) { + } else if (connectorId === "bankofamerica" || connectorId === "wellsfargo") { + // Wait for iframe to be present and visible cy.get("iframe", { timeout: TIMEOUT }) + .should("be.visible") .its("0.contentDocument.body") + .should("not.be.empty") // Ensure body has content .within(() => { - cy.get('input[type="text"]').click().type("1234"); - cy.get('input[value="SUBMIT"]').click(); + // Add retry ability and multiple selector attempts + cy.get( + 'input[type="text"], input[type="password"], input[name="challengeDataEntry"]', + { timeout: TIMEOUT } + ) + .should("be.visible") + .should("be.enabled") + .click() + .type("1234"); + + cy.get('input[value="SUBMIT"], button[type="submit"]', { + timeout: TIMEOUT, + }) + .should("be.visible") + .click(); }); + } else if (connectorId === "cybersource") { + cy.url({ timeout: TIMEOUT }).should("include", expected_url.origin); + return; // this is mandatory, else refunds section will fail with unhandled promise rejections even though it is handled } else if (connectorId === "checkout") { cy.get("iframe", { timeout: TIMEOUT }) .its("0.contentDocument.body") @@ -381,7 +402,12 @@ function threeDsRedirection(redirection_url, expected_url, connectorId) { } cy.then(() => { - verifyReturnUrl(redirection_url, expected_url, true); + try { + verifyReturnUrl(redirection_url, expected_url, true); + } catch (error) { + cy.log("Error during return URL verification:", error); + throw error; + } }); } @@ -422,7 +448,12 @@ function upiRedirection( } cy.then(() => { - verifyReturnUrl(redirection_url, expected_url, verifyUrl); + try { + verifyReturnUrl(redirection_url, expected_url, verifyUrl); + } catch (error) { + cy.log("Error during return URL verification:", error); + throw error; + } }); }
fix
address cybersource redirection inconsistency (#7057)
9e450b81ca8bc4b1ddbbe2c1d732dbc58c61934e
2023-10-17 23:59:03
Bhimesh Agrawal
feat(connector): [Aci] Update connector_response_reference_id with merchant reference (#2551)
false
diff --git a/crates/router/src/connector/aci/transformers.rs b/crates/router/src/connector/aci/transformers.rs index 7d30c80c49c..f6c1daffe4d 100644 --- a/crates/router/src/connector/aci/transformers.rs +++ b/crates/router/src/connector/aci/transformers.rs @@ -682,12 +682,12 @@ impl<F, T> } }, response: Ok(types::PaymentsResponseData::TransactionResponse { - resource_id: types::ResponseId::ConnectorTransactionId(item.response.id), + resource_id: types::ResponseId::ConnectorTransactionId(item.response.id.clone()), redirection_data, mandate_reference, connector_metadata: None, network_txn_id: None, - connector_response_reference_id: None, + connector_response_reference_id: Some(item.response.id), }), ..item.data })
feat
[Aci] Update connector_response_reference_id with merchant reference (#2551)
5335f2d21ce6f0c11dc84fd56b3cd2c80e8b064f
2024-09-20 16:50:53
Narayan Bhat
refactor(payment_intent_v2): payment intent fields refactoring (#5880)
false
diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rs index 535a5abffce..d1b658dab4e 100644 --- a/crates/api_models/src/payments.rs +++ b/crates/api_models/src/payments.rs @@ -18,11 +18,7 @@ use error_stack::ResultExt; use masking::{ExposeInterface, PeekInterface, Secret, SwitchStrategy, WithType}; use router_derive::Setter; use rustc_hash::FxHashMap; -use serde::{ - de::{self, Unexpected, Visitor}, - ser::Serializer, - Deserialize, Deserializer, Serialize, -}; +use serde::{de, ser::Serializer, Deserialize, Deserializer, Serialize}; use strum::Display; use time::{Date, PrimitiveDateTime}; use url::Url; @@ -68,154 +64,6 @@ pub struct BankCodeResponse { pub eligible_connectors: Vec<String>, } -#[derive(Debug, PartialEq, Clone)] -pub struct ClientSecret { - pub payment_id: id_type::PaymentId, - pub secret: String, -} - -impl ClientSecret { - pub fn get_client_secret(&self) -> String { - format!( - "{}_secret_{}", - self.payment_id.get_string_repr(), - self.secret - ) - } -} - -impl<'de> Deserialize<'de> for ClientSecret { - fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> - where - D: Deserializer<'de>, - { - struct ClientSecretVisitor; - - impl<'de> Visitor<'de> for ClientSecretVisitor { - type Value = ClientSecret; - - fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { - formatter.write_str("a string in the format '{payment_id}_secret_{secret}'") - } - - fn visit_str<E>(self, value: &str) -> Result<ClientSecret, E> - where - E: de::Error, - { - let (payment_id, secret) = value.rsplit_once("_secret_").ok_or_else(|| { - E::invalid_value(Unexpected::Str(value), &"a string with '_secret_'") - })?; - - let payment_id = - id_type::PaymentId::try_from(std::borrow::Cow::Owned(payment_id.to_owned())) - .map_err(de::Error::custom)?; - - Ok(ClientSecret { - payment_id, - secret: secret.to_owned(), - }) - } - } - - deserializer.deserialize_str(ClientSecretVisitor) - } -} - -impl Serialize for ClientSecret { - fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> - where - S: Serializer, - { - let combined = format!( - "{}_secret_{}", - self.payment_id.get_string_repr(), - self.secret - ); - serializer.serialize_str(&combined) - } -} - -#[cfg(test)] -mod client_secret_tests { - #![allow(clippy::expect_used)] - #![allow(clippy::unwrap_used)] - - use serde_json; - - use super::*; - - #[test] - fn test_serialize_client_secret() { - let client_secret1 = ClientSecret { - payment_id: id_type::PaymentId::try_from(std::borrow::Cow::Borrowed( - "pay_3TgelAms4RQec8xSStjF", - )) - .unwrap(), - secret: "fc34taHLw1ekPgNh92qr".to_string(), - }; - let client_secret2 = ClientSecret { - payment_id: id_type::PaymentId::try_from(std::borrow::Cow::Borrowed( - "pay_3Tgel__Ams4RQ_secret_ec8xSStjF", - )) - .unwrap(), - secret: "fc34taHLw1ekPgNh92qr".to_string(), - }; - - let expected_str1 = r#""pay_3TgelAms4RQec8xSStjF_secret_fc34taHLw1ekPgNh92qr""#; - let expected_str2 = r#""pay_3Tgel__Ams4RQ_secret_ec8xSStjF_secret_fc34taHLw1ekPgNh92qr""#; - - let actual_str1 = - serde_json::to_string(&client_secret1).expect("Failed to serialize client_secret1"); - let actual_str2 = - serde_json::to_string(&client_secret2).expect("Failed to serialize client_secret2"); - - assert_eq!(expected_str1, actual_str1); - assert_eq!(expected_str2, actual_str2); - } - - #[test] - fn test_deserialize_client_secret() { - let client_secret_str1 = r#""pay_3TgelAms4RQec8xSStjF_secret_fc34taHLw1ekPgNh92qr""#; - let client_secret_str2 = - r#""pay_3Tgel__Ams4RQ_secret_ec8xSStjF_secret_fc34taHLw1ekPgNh92qr""#; - let client_secret_str3 = - r#""pay_3Tgel__Ams4RQ_secret_ec8xSStjF_secret__secret_fc34taHLw1ekPgNh92qr""#; - - let expected1 = ClientSecret { - payment_id: id_type::PaymentId::try_from(std::borrow::Cow::Borrowed( - "pay_3TgelAms4RQec8xSStjF", - )) - .unwrap(), - secret: "fc34taHLw1ekPgNh92qr".to_string(), - }; - let expected2 = ClientSecret { - payment_id: id_type::PaymentId::try_from(std::borrow::Cow::Borrowed( - "pay_3Tgel__Ams4RQ_secret_ec8xSStjF", - )) - .unwrap(), - secret: "fc34taHLw1ekPgNh92qr".to_string(), - }; - let expected3 = ClientSecret { - payment_id: id_type::PaymentId::try_from(std::borrow::Cow::Borrowed( - "pay_3Tgel__Ams4RQ_secret_ec8xSStjF_secret_", - )) - .unwrap(), - secret: "fc34taHLw1ekPgNh92qr".to_string(), - }; - - let actual1: ClientSecret = serde_json::from_str(client_secret_str1) - .expect("Failed to deserialize client_secret_str1"); - let actual2: ClientSecret = serde_json::from_str(client_secret_str2) - .expect("Failed to deserialize client_secret_str2"); - let actual3: ClientSecret = serde_json::from_str(client_secret_str3) - .expect("Failed to deserialize client_secret_str3"); - - assert_eq!(expected1, actual1); - assert_eq!(expected2, actual2); - assert_eq!(expected3, actual3); - } -} - /// Passing this object creates a new customer or attaches an existing customer to the payment #[derive(Debug, serde::Deserialize, serde::Serialize, Clone, ToSchema, PartialEq)] pub struct CustomerDetails { diff --git a/crates/common_enums/src/enums.rs b/crates/common_enums/src/enums.rs index 31cb43669b2..65ef8d87255 100644 --- a/crates/common_enums/src/enums.rs +++ b/crates/common_enums/src/enums.rs @@ -3213,3 +3213,39 @@ pub enum DeleteStatus { Active, Redacted, } + +/// Whether 3ds authentication is requested or not +#[derive(Clone, Debug, PartialEq, serde::Serialize)] +pub enum External3dsAuthenticationRequest { + /// Request for 3ds authentication + Enable, + /// Skip 3ds authentication + Skip, +} + +/// Whether payment link is requested to be enabled or not for this transaction +#[derive(Clone, Debug, PartialEq, serde::Serialize)] +pub enum EnablePaymentLinkRequest { + /// Request for enabling payment link + Enable, + /// Skip enabling payment link + Skip, +} + +/// Whether mit exemption is requested or not +#[derive(Clone, Debug, PartialEq, serde::Serialize)] +pub enum MitExemptionRequest { + /// Request for applying MIT exemption + Apply, + /// Skip applying MIT exemption + Skip, +} + +/// Whether customer is present / absent during the payment +#[derive(Clone, Debug, PartialEq, serde::Serialize)] +pub enum PresenceOfCustomerDuringPayment { + /// Customer is present during the payment. This is the default value + Present, + /// Customer is absent during the payment + Absent, +} diff --git a/crates/common_enums/src/transformers.rs b/crates/common_enums/src/transformers.rs index fab570542c8..db4162a8bb1 100644 --- a/crates/common_enums/src/transformers.rs +++ b/crates/common_enums/src/transformers.rs @@ -1991,6 +1991,79 @@ mod custom_serde { } } +impl From<Option<bool>> for super::External3dsAuthenticationRequest { + fn from(value: Option<bool>) -> Self { + match value { + Some(true) => Self::Enable, + _ => Self::Skip, + } + } +} + +/// Get the boolean value of the `External3dsAuthenticationRequest`. +impl super::External3dsAuthenticationRequest { + pub fn as_bool(&self) -> bool { + match self { + Self::Enable => true, + Self::Skip => false, + } + } +} + +impl super::EnablePaymentLinkRequest { + pub fn as_bool(&self) -> bool { + match self { + Self::Enable => true, + Self::Skip => false, + } + } +} + +impl From<Option<bool>> for super::EnablePaymentLinkRequest { + fn from(value: Option<bool>) -> Self { + match value { + Some(true) => Self::Enable, + _ => Self::Skip, + } + } +} + +impl From<Option<bool>> for super::MitExemptionRequest { + fn from(value: Option<bool>) -> Self { + match value { + Some(true) => Self::Apply, + _ => Self::Skip, + } + } +} + +impl super::MitExemptionRequest { + pub fn as_bool(&self) -> bool { + match self { + Self::Apply => true, + Self::Skip => false, + } + } +} + +impl From<Option<bool>> for super::PresenceOfCustomerDuringPayment { + fn from(value: Option<bool>) -> Self { + match value { + Some(false) => Self::Absent, + _ => Self::Present, + } + } +} + +impl super::PresenceOfCustomerDuringPayment { + pub fn as_bool(&self) -> bool { + match self { + Self::Present => true, + Self::Absent => false, + } + } +} + #[cfg(test)] mod tests { #![allow(clippy::unwrap_used)] diff --git a/crates/common_utils/src/consts.rs b/crates/common_utils/src/consts.rs index 70f00ad9b3f..ce9a3b2caef 100644 --- a/crates/common_utils/src/consts.rs +++ b/crates/common_utils/src/consts.rs @@ -147,5 +147,10 @@ pub const ROLE_ID_INTERNAL_VIEW_ONLY_USER: &str = "internal_view_only"; /// Role ID for Internal Admin pub const ROLE_ID_INTERNAL_ADMIN: &str = "internal_admin"; +/// Max length allowed for Description +pub const MAX_DESCRIPTION_LENGTH: u16 = 255; + +/// Max length allowed for Statement Descriptor +pub const MAX_STATEMENT_DESCRIPTOR_LENGTH: u16 = 255; /// Payout flow identifier used for performing GSM operations pub const PAYOUT_FLOW_STR: &str = "payout_flow"; diff --git a/crates/common_utils/src/id_type.rs b/crates/common_utils/src/id_type.rs index 20dc423310a..26d2c0cdf62 100644 --- a/crates/common_utils/src/id_type.rs +++ b/crates/common_utils/src/id_type.rs @@ -11,9 +11,8 @@ mod payment; mod profile; mod routing; +#[cfg(feature = "v2")] mod global_id; -#[cfg(all(feature = "v2", feature = "payment_methods_v2"))] -mod payment_methods; pub use customer::CustomerId; use diesel::{ @@ -23,12 +22,12 @@ use diesel::{ serialize::{Output, ToSql}, sql_types, }; +#[cfg(feature = "v2")] +pub use global_id::{payment::GlobalPaymentId, payment_methods::GlobalPaymentMethodId, CellId}; pub use merchant::MerchantId; pub use merchant_connector_account::MerchantConnectorAccountId; pub use organization::OrganizationId; pub use payment::PaymentId; -#[cfg(all(feature = "v2", feature = "payment_methods_v2"))] -pub use payment_methods::GlobalPaymentMethodId; pub use profile::ProfileId; pub use routing::RoutingId; use serde::{Deserialize, Serialize}; @@ -155,6 +154,7 @@ impl<const MAX_LENGTH: u8, const MIN_LENGTH: u8> LengthId<MAX_LENGTH, MIN_LENGTH Self(alphanumeric_id) } + #[cfg(feature = "v2")] /// Create a new LengthId from aplhanumeric id pub(crate) fn from_alphanumeric_id( alphanumeric_id: AlphaNumericId, diff --git a/crates/common_utils/src/id_type/global_id.rs b/crates/common_utils/src/id_type/global_id.rs index 8efbc3636f9..5ed23a177b6 100644 --- a/crates/common_utils/src/id_type/global_id.rs +++ b/crates/common_utils/src/id_type/global_id.rs @@ -1,4 +1,6 @@ #![allow(unused)] +pub mod payment; +pub mod payment_methods; use diesel::{backend::Backend, deserialize::FromSql, serialize::ToSql, sql_types}; use error_stack::ResultExt; @@ -34,8 +36,9 @@ impl GlobalEntity { } } +/// Cell identifier for an instance / deployment of application #[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub(crate) struct CellId(LengthId<CELL_IDENTIFIER_LENGTH, CELL_IDENTIFIER_LENGTH>); +pub struct CellId(LengthId<CELL_IDENTIFIER_LENGTH, CELL_IDENTIFIER_LENGTH>); #[derive(Debug, Error, PartialEq, Eq)] pub enum CellIdError { @@ -107,7 +110,9 @@ impl GlobalId { Self(LengthId::new_unchecked(alphanumeric_id)) } - pub fn from_string(input_string: String) -> Result<Self, GlobalIdError> { + pub(crate) fn from_string( + input_string: std::borrow::Cow<'static, str>, + ) -> Result<Self, GlobalIdError> { let length_id = LengthId::from(input_string.into())?; let input_string = &length_id.0 .0; let (cell_id, remaining) = input_string @@ -118,6 +123,10 @@ impl GlobalId { Ok(Self(length_id)) } + + pub(crate) fn get_string_repr(&self) -> &str { + &self.0 .0 .0 + } } impl<DB> ToSql<sql_types::Text, DB> for GlobalId @@ -154,7 +163,7 @@ impl<'de> serde::Deserialize<'de> for GlobalId { D: serde::Deserializer<'de>, { let deserialized_string = String::deserialize(deserializer)?; - Self::from_string(deserialized_string).map_err(serde::de::Error::custom) + Self::from_string(deserialized_string.into()).map_err(serde::de::Error::custom) } } @@ -187,7 +196,7 @@ mod global_id_tests { #[test] fn test_global_id_from_string() { let input_string = "12345_cus_abcdefghijklmnopqrstuvwxyz1234567890"; - let global_id = GlobalId::from_string(input_string.to_string()).unwrap(); + let global_id = GlobalId::from_string(input_string.into()).unwrap(); assert_eq!(global_id.0 .0 .0, input_string); } diff --git a/crates/common_utils/src/id_type/global_id/payment.rs b/crates/common_utils/src/id_type/global_id/payment.rs new file mode 100644 index 00000000000..edc7e3fb960 --- /dev/null +++ b/crates/common_utils/src/id_type/global_id/payment.rs @@ -0,0 +1,63 @@ +use crate::errors; + +/// A global id that can be used to identify a payment +#[derive( + Debug, + Clone, + Hash, + PartialEq, + Eq, + serde::Serialize, + serde::Deserialize, + diesel::expression::AsExpression, +)] +#[diesel(sql_type = diesel::sql_types::Text)] +pub struct GlobalPaymentId(super::GlobalId); + +// Database related implementations so that this field can be used directly in the database tables +crate::impl_queryable_id_type!(GlobalPaymentId); + +impl GlobalPaymentId { + /// Get string representation of the id + pub fn get_string_repr(&self) -> &str { + self.0.get_string_repr() + } +} + +// TODO: refactor the macro to include this id use case as well +impl TryFrom<std::borrow::Cow<'static, str>> for GlobalPaymentId { + type Error = error_stack::Report<errors::ValidationError>; + fn try_from(value: std::borrow::Cow<'static, str>) -> Result<Self, Self::Error> { + use error_stack::ResultExt; + let merchant_ref_id = super::GlobalId::from_string(value).change_context( + errors::ValidationError::IncorrectValueProvided { + field_name: "payment_id", + }, + )?; + Ok(Self(merchant_ref_id)) + } +} + +// TODO: refactor the macro to include this id use case as well +impl<DB> diesel::serialize::ToSql<diesel::sql_types::Text, DB> for GlobalPaymentId +where + DB: diesel::backend::Backend, + super::GlobalId: diesel::serialize::ToSql<diesel::sql_types::Text, DB>, +{ + fn to_sql<'b>( + &'b self, + out: &mut diesel::serialize::Output<'b, '_, DB>, + ) -> diesel::serialize::Result { + self.0.to_sql(out) + } +} + +impl<DB> diesel::deserialize::FromSql<diesel::sql_types::Text, DB> for GlobalPaymentId +where + DB: diesel::backend::Backend, + super::GlobalId: diesel::deserialize::FromSql<diesel::sql_types::Text, DB>, +{ + fn from_sql(value: DB::RawValue<'_>) -> diesel::deserialize::Result<Self> { + super::GlobalId::from_sql(value).map(Self) + } +} diff --git a/crates/common_utils/src/id_type/payment_methods.rs b/crates/common_utils/src/id_type/global_id/payment_methods.rs similarity index 86% rename from crates/common_utils/src/id_type/payment_methods.rs rename to crates/common_utils/src/id_type/global_id/payment_methods.rs index f5cc2150913..5ccb774f6ea 100644 --- a/crates/common_utils/src/id_type/payment_methods.rs +++ b/crates/common_utils/src/id_type/global_id/payment_methods.rs @@ -27,9 +27,6 @@ pub enum GlobalPaymentMethodIdError { } impl GlobalPaymentMethodId { - fn get_global_id(&self) -> &GlobalId { - &self.0 - } /// Create a new GlobalPaymentMethodId from celll id information pub fn generate(cell_id: &str) -> error_stack::Result<Self, errors::ValidationError> { let cell_id = CellId::from_string(cell_id.to_string())?; @@ -37,18 +34,18 @@ impl GlobalPaymentMethodId { Ok(Self(global_id)) } - pub fn get_string_repr(&self) -> String { - todo!() + pub fn get_string_repr(&self) -> &str { + self.0.get_string_repr() } pub fn generate_from_string(value: String) -> CustomResult<Self, GlobalPaymentMethodIdError> { - let id = GlobalId::from_string(value) + let id = GlobalId::from_string(value.into()) .change_context(GlobalPaymentMethodIdError::ConstructionError)?; Ok(Self(id)) } } -impl<DB> diesel::Queryable<diesel::sql_types::Text, DB> for GlobalPaymentMethodId +impl<DB> diesel::Queryable<sql_types::Text, DB> for GlobalPaymentMethodId where DB: diesel::backend::Backend, Self: diesel::deserialize::FromSql<diesel::sql_types::Text, DB>, @@ -68,8 +65,7 @@ where &'b self, out: &mut diesel::serialize::Output<'b, '_, DB>, ) -> diesel::serialize::Result { - let id = self.get_global_id(); - id.to_sql(out) + self.0.to_sql(out) } } diff --git a/crates/common_utils/src/id_type/payment.rs b/crates/common_utils/src/id_type/payment.rs index e0269f2beff..c919076e9ce 100644 --- a/crates/common_utils/src/id_type/payment.rs +++ b/crates/common_utils/src/id_type/payment.rs @@ -1,7 +1,7 @@ use crate::{ errors::{CustomResult, ValidationError}, generate_id_with_default_len, - id_type::{global_id, AlphaNumericId, LengthId}, + id_type::{AlphaNumericId, LengthId}, }; crate::id_type!( @@ -15,23 +15,10 @@ crate::impl_debug_id_type!(PaymentId); crate::impl_default_id_type!(PaymentId, "pay"); crate::impl_try_from_cow_str_id_type!(PaymentId, "payment_id"); +// Database related implementations so that this field can be used directly in the database tables crate::impl_queryable_id_type!(PaymentId); crate::impl_to_sql_from_sql_id_type!(PaymentId); -/// A global id that can be used to identify a payment -#[derive( - Debug, - Clone, - Hash, - PartialEq, - Eq, - serde::Serialize, - serde::Deserialize, - diesel::expression::AsExpression, -)] -#[diesel(sql_type = diesel::sql_types::Text)] -pub struct PaymentGlobalId(global_id::GlobalId); - impl PaymentId { /// Get the hash key to be stored in redis pub fn get_hash_key_for_kv_store(&self) -> String { diff --git a/crates/common_utils/src/types.rs b/crates/common_utils/src/types.rs index 2206744ef0b..9906f3c9114 100644 --- a/crates/common_utils/src/types.rs +++ b/crates/common_utils/src/types.rs @@ -5,6 +5,7 @@ pub mod keymanager; pub mod authentication; use std::{ + borrow::Cow, fmt::Display, ops::{Add, Sub}, primitive::i64, @@ -28,13 +29,16 @@ use rust_decimal::{ }; use semver::Version; use serde::{de::Visitor, Deserialize, Deserializer, Serialize}; +use thiserror::Error; use time::PrimitiveDateTime; use utoipa::ToSchema; use crate::{ - consts, + consts::{self, MAX_DESCRIPTION_LENGTH, MAX_STATEMENT_DESCRIPTOR_LENGTH}, errors::{CustomResult, ParsingError, PercentageError, ValidationError}, + fp_utils::when, }; + /// Represents Percentage Value between 0 and 100 both inclusive #[derive(Clone, Default, Debug, PartialEq, Serialize)] pub struct Percentage<const PRECISION: u8> { @@ -583,6 +587,251 @@ impl StringMajorUnit { } } +#[derive( + Debug, + serde::Deserialize, + AsExpression, + serde::Serialize, + Clone, + PartialEq, + Eq, + Hash, + ToSchema, + PartialOrd, +)] +#[diesel(sql_type = sql_types::Text)] +/// This domain type can be used for any url +pub struct Url(url::Url); + +impl<DB> ToSql<sql_types::Text, DB> for Url +where + DB: Backend, + str: ToSql<sql_types::Text, DB>, +{ + fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, DB>) -> diesel::serialize::Result { + let url_string = self.0.as_str(); + url_string.to_sql(out) + } +} + +impl<DB> FromSql<sql_types::Text, DB> for Url +where + DB: Backend, + String: FromSql<sql_types::Text, DB>, +{ + fn from_sql(value: DB::RawValue<'_>) -> deserialize::Result<Self> { + let val = String::from_sql(value)?; + let url = url::Url::parse(&val)?; + Ok(Self(url)) + } +} + +#[cfg(feature = "v2")] +pub use client_secret_type::ClientSecret; +#[cfg(feature = "v2")] +mod client_secret_type { + use std::fmt; + + use masking::PeekInterface; + + use super::*; + use crate::id_type; + + /// A domain type that can be used to represent a client secret + /// Client secret is generated for a payment and is used to authenticate the client side api calls + #[derive(Debug, PartialEq, Clone, AsExpression)] + #[diesel(sql_type = sql_types::Text)] + pub struct ClientSecret { + /// The payment id of the payment + pub payment_id: id_type::GlobalPaymentId, + /// The secret string + pub secret: masking::Secret<String>, + } + + impl ClientSecret { + pub(crate) fn get_string_repr(&self) -> String { + format!( + "{}_secret_{}", + self.payment_id.get_string_repr(), + self.secret.peek() + ) + } + } + + impl<'de> Deserialize<'de> for ClientSecret { + fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> + where + D: Deserializer<'de>, + { + struct ClientSecretVisitor; + + impl<'de> Visitor<'de> for ClientSecretVisitor { + type Value = ClientSecret; + + fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + formatter.write_str("a string in the format '{payment_id}_secret_{secret}'") + } + + fn visit_str<E>(self, value: &str) -> Result<ClientSecret, E> + where + E: serde::de::Error, + { + let (payment_id, secret) = value.rsplit_once("_secret_").ok_or_else(|| { + E::invalid_value( + serde::de::Unexpected::Str(value), + &"a string with '_secret_'", + ) + })?; + + let payment_id = + id_type::GlobalPaymentId::try_from(Cow::Owned(payment_id.to_owned())) + .map_err(serde::de::Error::custom)?; + + Ok(ClientSecret { + payment_id, + secret: masking::Secret::new(secret.to_owned()), + }) + } + } + + deserializer.deserialize_str(ClientSecretVisitor) + } + } + + impl Serialize for ClientSecret { + fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> + where + S: serde::ser::Serializer, + { + serializer.serialize_str(self.get_string_repr().as_str()) + } + } + + impl ToSql<sql_types::Text, diesel::pg::Pg> for ClientSecret + where + String: ToSql<sql_types::Text, diesel::pg::Pg>, + { + fn to_sql<'b>( + &'b self, + out: &mut Output<'b, '_, diesel::pg::Pg>, + ) -> diesel::serialize::Result { + let string_repr = self.get_string_repr(); + <String as ToSql<sql_types::Text, diesel::pg::Pg>>::to_sql( + &string_repr, + &mut out.reborrow(), + ) + } + } + + impl<DB> FromSql<sql_types::Text, DB> for ClientSecret + where + DB: Backend, + String: FromSql<sql_types::Text, DB>, + { + fn from_sql(value: DB::RawValue<'_>) -> deserialize::Result<Self> { + let string_repr = String::from_sql(value)?; + Ok(serde_json::from_str(&string_repr)?) + } + } + + impl<DB> Queryable<sql_types::Text, DB> for ClientSecret + where + DB: Backend, + Self: FromSql<sql_types::Text, DB>, + { + type Row = Self; + + fn build(row: Self::Row) -> deserialize::Result<Self> { + Ok(row) + } + } + + #[cfg(test)] + mod client_secret_tests { + #![allow(clippy::expect_used)] + #![allow(clippy::unwrap_used)] + + use serde_json; + + use super::*; + use crate::id_type::GlobalPaymentId; + + #[test] + fn test_serialize_client_secret() { + let global_payment_id = "12345_pay_1a961ed9093c48b09781bf8ab17ba6bd"; + let secret = "fc34taHLw1ekPgNh92qr".to_string(); + + let expected_client_secret_string = format!("\"{global_payment_id}_secret_{secret}\""); + + let client_secret1 = ClientSecret { + payment_id: GlobalPaymentId::try_from(Cow::Borrowed(global_payment_id)).unwrap(), + secret: masking::Secret::new(secret), + }; + + let parsed_client_secret = + serde_json::to_string(&client_secret1).expect("Failed to serialize client_secret1"); + + assert_eq!(expected_client_secret_string, parsed_client_secret); + } + + #[test] + fn test_deserialize_client_secret() { + // This is a valid global id + let global_payment_id_str = "12345_pay_1a961ed9093c48b09781bf8ab17ba6bd"; + let secret = "fc34taHLw1ekPgNh92qr".to_string(); + + let valid_payment_global_id = + GlobalPaymentId::try_from(Cow::Borrowed(global_payment_id_str)) + .expect("Failed to create valid global payment id"); + + // This is an invalid global id because of the cell id being in invalid length + let invalid_global_payment_id = "123_pay_1a961ed9093c48b09781bf8ab17ba6bd"; + + // Create a client secret string which is valid + let valid_client_secret = format!(r#""{global_payment_id_str}_secret_{secret}""#); + + dbg!(&valid_client_secret); + + // Create a client secret string which is invalid + let invalid_client_secret_because_of_invalid_payment_id = + format!(r#""{invalid_global_payment_id}_secret_{secret}""#); + + // Create a client secret string which is invalid because of invalid secret + let invalid_client_secret_because_of_invalid_secret = + format!(r#""{invalid_global_payment_id}""#); + + let valid_client_secret = serde_json::from_str::<ClientSecret>(&valid_client_secret) + .expect("Failed to deserialize client_secret_str1"); + + let invalid_deser1 = serde_json::from_str::<ClientSecret>( + &invalid_client_secret_because_of_invalid_payment_id, + ); + + dbg!(&invalid_deser1); + + let invalid_deser2 = serde_json::from_str::<ClientSecret>( + &invalid_client_secret_because_of_invalid_secret, + ); + + dbg!(&invalid_deser2); + + assert_eq!(valid_client_secret.payment_id, valid_payment_global_id); + + assert_eq!(valid_client_secret.secret.peek(), &secret); + + assert_eq!( + invalid_deser1.err().unwrap().to_string(), + "Incorrect value provided for field: payment_id at line 1 column 70" + ); + + assert_eq!( + invalid_deser2.err().unwrap().to_string(), + "invalid value: string \"123_pay_1a961ed9093c48b09781bf8ab17ba6bd\", expected a string with '_secret_' at line 1 column 42" + ); + } + } +} + /// A type representing a range of time for filtering, including a mandatory start time and an optional end time. #[derive( Debug, Clone, Copy, serde::Serialize, serde::Deserialize, PartialEq, Eq, Hash, ToSchema, @@ -725,32 +974,108 @@ pub struct ChargeRefunds { crate::impl_to_sql_from_sql_json!(ChargeRefunds); -/// Domain type for description -#[derive( - Debug, Clone, PartialEq, Eq, Queryable, serde::Deserialize, serde::Serialize, AsExpression, -)] +/// A common type of domain type that can be used for fields that contain a string with restriction of length +#[derive(Debug, Clone, Serialize, Hash, PartialEq, Eq, AsExpression)] #[diesel(sql_type = sql_types::Text)] -pub struct Description(String); +pub(crate) struct LengthString<const MAX_LENGTH: u16, const MIN_LENGTH: u8>(String); + +/// Error generated from violation of constraints for MerchantReferenceId +#[derive(Debug, Error, PartialEq, Eq)] +pub(crate) enum LengthStringError { + #[error("the maximum allowed length for this field is {0}")] + /// Maximum length of string violated + MaxLengthViolated(u16), + + #[error("the minimum required length for this field is {0}")] + /// Minimum length of string violated + MinLengthViolated(u8), +} -impl Description { - /// Create a new Description Domain type - pub fn new(value: String) -> Self { - Self(value) +impl<const MAX_LENGTH: u16, const MIN_LENGTH: u8> LengthString<MAX_LENGTH, MIN_LENGTH> { + /// Generates new [MerchantReferenceId] from the given input string + pub fn from(input_string: Cow<'static, str>) -> Result<Self, LengthStringError> { + let trimmed_input_string = input_string.trim().to_string(); + let length_of_input_string = u16::try_from(trimmed_input_string.len()) + .map_err(|_| LengthStringError::MaxLengthViolated(MAX_LENGTH))?; + + when(length_of_input_string > MAX_LENGTH, || { + Err(LengthStringError::MaxLengthViolated(MAX_LENGTH)) + })?; + + when(length_of_input_string < u16::from(MIN_LENGTH), || { + Err(LengthStringError::MinLengthViolated(MIN_LENGTH)) + })?; + + Ok(Self(trimmed_input_string)) + } + + pub(crate) fn new_unchecked(input_string: String) -> Self { + Self(input_string) + } +} + +impl<'de, const MAX_LENGTH: u16, const MIN_LENGTH: u8> Deserialize<'de> + for LengthString<MAX_LENGTH, MIN_LENGTH> +{ + fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> + where + D: Deserializer<'de>, + { + let deserialized_string = String::deserialize(deserializer)?; + Self::from(deserialized_string.into()).map_err(serde::de::Error::custom) + } +} + +impl<DB> FromSql<sql_types::Text, DB> for LengthString<MAX_DESCRIPTION_LENGTH, 1> +where + DB: Backend, + String: FromSql<sql_types::Text, DB>, +{ + fn from_sql(bytes: DB::RawValue<'_>) -> deserialize::Result<Self> { + let val = String::from_sql(bytes)?; + Ok(Self(val)) + } +} + +impl<DB, const MAX_LENGTH: u16, const MIN_LENGTH: u8> ToSql<sql_types::Text, DB> + for LengthString<MAX_LENGTH, MIN_LENGTH> +where + DB: Backend, + String: ToSql<sql_types::Text, DB>, +{ + fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, DB>) -> diesel::serialize::Result { + self.0.to_sql(out) } } -impl From<Description> for String { - fn from(description: Description) -> Self { - description.0 +impl<DB> Queryable<sql_types::Text, DB> for LengthString<MAX_DESCRIPTION_LENGTH, 1> +where + DB: Backend, + Self: FromSql<sql_types::Text, DB>, +{ + type Row = Self; + fn build(row: Self::Row) -> deserialize::Result<Self> { + Ok(row) } } -impl From<String> for Description { - fn from(description: String) -> Self { - Self(description) +/// Domain type for description +#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize, serde::Serialize, AsExpression)] +#[diesel(sql_type = sql_types::Text)] +pub struct Description(LengthString<MAX_DESCRIPTION_LENGTH, 1>); + +impl Description { + /// Create a new Description Domain type without any length check from a static str + pub fn from_str_unchecked(input_str: &'static str) -> Self { + Self(LengthString::new_unchecked(input_str.to_owned())) } } +/// Domain type for Statement Descriptor +#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize, serde::Serialize, AsExpression)] +#[diesel(sql_type = sql_types::Text)] +pub struct StatementDescriptor(LengthString<MAX_STATEMENT_DESCRIPTOR_LENGTH, 1>); + impl<DB> Queryable<sql_types::Text, DB> for Description where DB: Backend, @@ -766,18 +1091,51 @@ where impl<DB> FromSql<sql_types::Text, DB> for Description where DB: Backend, - String: FromSql<sql_types::Text, DB>, + LengthString<MAX_DESCRIPTION_LENGTH, 1>: FromSql<sql_types::Text, DB>, { fn from_sql(bytes: DB::RawValue<'_>) -> deserialize::Result<Self> { - let val = String::from_sql(bytes)?; - Ok(Self::from(val)) + let val = LengthString::<MAX_DESCRIPTION_LENGTH, 1>::from_sql(bytes)?; + Ok(Self(val)) } } impl<DB> ToSql<sql_types::Text, DB> for Description where DB: Backend, - String: ToSql<sql_types::Text, DB>, + LengthString<MAX_DESCRIPTION_LENGTH, 1>: ToSql<sql_types::Text, DB>, +{ + fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, DB>) -> diesel::serialize::Result { + self.0.to_sql(out) + } +} + +impl<DB> Queryable<sql_types::Text, DB> for StatementDescriptor +where + DB: Backend, + Self: FromSql<sql_types::Text, DB>, +{ + type Row = Self; + + fn build(row: Self::Row) -> deserialize::Result<Self> { + Ok(row) + } +} + +impl<DB> FromSql<sql_types::Text, DB> for StatementDescriptor +where + DB: Backend, + LengthString<MAX_DESCRIPTION_LENGTH, 1>: FromSql<sql_types::Text, DB>, +{ + fn from_sql(bytes: DB::RawValue<'_>) -> deserialize::Result<Self> { + let val = LengthString::<MAX_DESCRIPTION_LENGTH, 1>::from_sql(bytes)?; + Ok(Self(val)) + } +} + +impl<DB> ToSql<sql_types::Text, DB> for StatementDescriptor +where + DB: Backend, + LengthString<MAX_DESCRIPTION_LENGTH, 1>: ToSql<sql_types::Text, DB>, { fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, DB>) -> diesel::serialize::Result { self.0.to_sql(out) diff --git a/crates/diesel_models/src/payment_intent.rs b/crates/diesel_models/src/payment_intent.rs index 42424c9bfff..c6ebbe671e9 100644 --- a/crates/diesel_models/src/payment_intent.rs +++ b/crates/diesel_models/src/payment_intent.rs @@ -17,13 +17,12 @@ pub struct PaymentIntent { pub merchant_id: common_utils::id_type::MerchantId, pub status: storage_enums::IntentStatus, pub amount: MinorUnit, - pub currency: Option<storage_enums::Currency>, + pub currency: storage_enums::Currency, pub amount_captured: Option<MinorUnit>, pub customer_id: Option<common_utils::id_type::CustomerId>, - pub description: Option<String>, - pub return_url: Option<String>, - pub metadata: Option<serde_json::Value>, - pub statement_descriptor_name: Option<String>, + pub description: Option<common_utils::types::Description>, + pub return_url: Option<common_utils::types::Url>, + pub metadata: Option<pii::SecretSerdeValue>, #[serde(with = "common_utils::custom_serde::iso8601")] pub created_at: PrimitiveDateTime, #[serde(with = "common_utils::custom_serde::iso8601")] @@ -31,48 +30,46 @@ pub struct PaymentIntent { #[serde(default, with = "common_utils::custom_serde::iso8601::option")] pub last_synced: Option<PrimitiveDateTime>, pub setup_future_usage: Option<storage_enums::FutureUsage>, - pub off_session: Option<bool>, - pub client_secret: Option<String>, + pub client_secret: common_utils::types::ClientSecret, pub active_attempt_id: String, #[diesel(deserialize_as = super::OptionalDieselArray<pii::SecretSerdeValue>)] pub order_details: Option<Vec<pii::SecretSerdeValue>>, - pub allowed_payment_method_types: Option<serde_json::Value>, - pub connector_metadata: Option<serde_json::Value>, - pub feature_metadata: Option<serde_json::Value>, + pub allowed_payment_method_types: Option<pii::SecretSerdeValue>, + pub connector_metadata: Option<pii::SecretSerdeValue>, + pub feature_metadata: Option<pii::SecretSerdeValue>, pub attempt_count: i16, - pub profile_id: Option<common_utils::id_type::ProfileId>, + pub profile_id: common_utils::id_type::ProfileId, pub payment_link_id: Option<String>, - pub payment_confirm_source: Option<storage_enums::PaymentSource>, - pub updated_by: String, pub surcharge_applicable: Option<bool>, pub request_incremental_authorization: Option<RequestIncrementalAuthorization>, pub authorization_count: Option<i32>, pub session_expiry: Option<PrimitiveDateTime>, pub request_external_three_ds_authentication: Option<bool>, - pub charges: Option<pii::SecretSerdeValue>, pub frm_metadata: Option<pii::SecretSerdeValue>, pub customer_details: Option<Encryption>, - pub merchant_order_reference_id: Option<String>, - pub is_payment_processor_token_flow: Option<bool>, pub shipping_cost: Option<MinorUnit>, pub organization_id: common_utils::id_type::OrganizationId, pub tax_details: Option<TaxDetails>, pub skip_external_tax_calculation: Option<bool>, - pub merchant_reference_id: String, + pub merchant_reference_id: Option<common_utils::id_type::PaymentId>, pub billing_address: Option<Encryption>, pub shipping_address: Option<Encryption>, pub capture_method: Option<storage_enums::CaptureMethod>, pub authentication_type: Option<common_enums::AuthenticationType>, - pub amount_to_capture: Option<MinorUnit>, pub prerouting_algorithm: Option<serde_json::Value>, pub surcharge_amount: Option<MinorUnit>, pub tax_on_surcharge: Option<MinorUnit>, // Denotes the action(approve or reject) taken by merchant in case of manual review. // Manual review can occur when the transaction is marked as risky by the frm_processor, payment processor or when there is underpayment/over payment incase of crypto payment - pub frm_merchant_decision: Option<String>, - // TODO: change this to global id - pub id: common_utils::id_type::PaymentId, + pub frm_merchant_decision: Option<common_enums::MerchantDecision>, + pub statement_descriptor: Option<common_utils::types::StatementDescriptor>, + pub enable_payment_link: Option<bool>, + pub apply_mit_exemption: Option<bool>, + pub customer_present: Option<bool>, + pub routing_algorithm_id: Option<common_utils::id_type::RoutingId>, + pub payment_link_config: Option<PaymentLinkConfigRequestForPayments>, + pub id: common_utils::id_type::GlobalPaymentId, } #[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "payment_v2")))] @@ -139,10 +136,59 @@ pub struct PaymentIntent { pub skip_external_tax_calculation: Option<bool>, } +#[derive(Clone, Debug, serde::Deserialize, serde::Serialize, PartialEq)] +pub struct PaymentLinkConfigRequestForPayments { + /// custom theme for the payment link + pub theme: Option<String>, + /// merchant display logo + pub logo: Option<String>, + /// Custom merchant name for payment link + pub seller_name: Option<String>, + /// Custom layout for sdk + pub sdk_layout: Option<String>, + /// Display only the sdk for payment link + pub display_sdk_only: Option<bool>, + /// Enable saved payment method option for payment link + pub enabled_saved_payment_method: Option<bool>, + /// Dynamic details related to merchant to be rendered in payment link + pub transaction_details: Option<Vec<PaymentLinkTransactionDetails>>, +} + +common_utils::impl_to_sql_from_sql_json!(PaymentLinkConfigRequestForPayments); + +#[derive(Clone, Debug, serde::Deserialize, serde::Serialize, PartialEq)] +pub struct PaymentLinkTransactionDetails { + /// Key for the transaction details + pub key: String, + /// Value for the transaction details + pub value: String, + /// UI configuration for the transaction details + pub ui_configuration: Option<TransactionDetailsUiConfiguration>, +} + +common_utils::impl_to_sql_from_sql_json!(PaymentLinkTransactionDetails); + +#[derive(Clone, Debug, serde::Deserialize, serde::Serialize, PartialEq)] +pub struct TransactionDetailsUiConfiguration { + /// Position of the key-value pair in the UI + pub position: Option<i8>, + /// Whether the key should be bold + pub is_key_bold: Option<bool>, + /// Whether the value should be bold + pub is_value_bold: Option<bool>, +} + +common_utils::impl_to_sql_from_sql_json!(TransactionDetailsUiConfiguration); + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, diesel::AsExpression)] #[diesel(sql_type = diesel::sql_types::Jsonb)] pub struct TaxDetails { + /// This is the tax related information that is calculated irrespective of any payment method. + /// This is calculated when the order is created with shipping details pub default: Option<DefaultTax>, + + /// This is the tax related information that is calculated based on the payment method + /// This is calculated when calling the /calculate_tax API pub payment_method_type: Option<PaymentMethodTypeTax>, } @@ -168,13 +214,12 @@ pub struct PaymentIntentNew { pub merchant_id: common_utils::id_type::MerchantId, pub status: storage_enums::IntentStatus, pub amount: MinorUnit, - pub currency: Option<storage_enums::Currency>, + pub currency: storage_enums::Currency, pub amount_captured: Option<MinorUnit>, pub customer_id: Option<common_utils::id_type::CustomerId>, - pub description: Option<String>, - pub return_url: Option<String>, - pub metadata: Option<serde_json::Value>, - pub statement_descriptor_name: Option<String>, + pub description: Option<common_utils::types::Description>, + pub return_url: Option<common_utils::types::Url>, + pub metadata: Option<pii::SecretSerdeValue>, #[serde(with = "common_utils::custom_serde::iso8601")] pub created_at: PrimitiveDateTime, #[serde(with = "common_utils::custom_serde::iso8601")] @@ -182,18 +227,16 @@ pub struct PaymentIntentNew { #[serde(default, with = "common_utils::custom_serde::iso8601::option")] pub last_synced: Option<PrimitiveDateTime>, pub setup_future_usage: Option<storage_enums::FutureUsage>, - pub off_session: Option<bool>, - pub client_secret: Option<String>, + pub client_secret: common_utils::types::ClientSecret, pub active_attempt_id: String, #[diesel(deserialize_as = super::OptionalDieselArray<pii::SecretSerdeValue>)] pub order_details: Option<Vec<pii::SecretSerdeValue>>, - pub allowed_payment_method_types: Option<serde_json::Value>, - pub connector_metadata: Option<serde_json::Value>, - pub feature_metadata: Option<serde_json::Value>, + pub allowed_payment_method_types: Option<pii::SecretSerdeValue>, + pub connector_metadata: Option<pii::SecretSerdeValue>, + pub feature_metadata: Option<pii::SecretSerdeValue>, pub attempt_count: i16, - pub profile_id: Option<common_utils::id_type::ProfileId>, + pub profile_id: common_utils::id_type::ProfileId, pub payment_link_id: Option<String>, - pub payment_confirm_source: Option<storage_enums::PaymentSource>, pub updated_by: String, pub surcharge_applicable: Option<bool>, pub request_incremental_authorization: Option<RequestIncrementalAuthorization>, @@ -201,29 +244,25 @@ pub struct PaymentIntentNew { #[serde(with = "common_utils::custom_serde::iso8601::option")] pub session_expiry: Option<PrimitiveDateTime>, pub request_external_three_ds_authentication: Option<bool>, - pub charges: Option<pii::SecretSerdeValue>, pub frm_metadata: Option<pii::SecretSerdeValue>, pub customer_details: Option<Encryption>, - pub merchant_order_reference_id: Option<String>, - pub is_payment_processor_token_flow: Option<bool>, pub shipping_cost: Option<MinorUnit>, pub organization_id: common_utils::id_type::OrganizationId, pub tax_details: Option<TaxDetails>, pub skip_external_tax_calculation: Option<bool>, - pub merchant_reference_id: String, + pub merchant_reference_id: Option<common_utils::id_type::PaymentId>, pub billing_address: Option<Encryption>, pub shipping_address: Option<Encryption>, pub capture_method: Option<storage_enums::CaptureMethod>, pub authentication_type: Option<common_enums::AuthenticationType>, - pub amount_to_capture: Option<MinorUnit>, pub prerouting_algorithm: Option<serde_json::Value>, pub surcharge_amount: Option<MinorUnit>, pub tax_on_surcharge: Option<MinorUnit>, - // Denotes the action(approve or reject) taken by merchant in case of manual review. - // Manual review can occur when the transaction is marked as risky by the frm_processor, payment processor or when there is underpayment/over payment incase of crypto payment - pub frm_merchant_decision: Option<String>, - // TODO: change this to global id - pub id: common_utils::id_type::PaymentId, + pub frm_merchant_decision: Option<common_enums::MerchantDecision>, + pub statement_descriptor: Option<common_utils::types::StatementDescriptor>, + pub enable_payment_link: Option<bool>, + pub apply_mit_exemption: Option<bool>, + pub id: common_utils::id_type::GlobalPaymentId, } #[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "payment_v2")))] @@ -305,7 +344,7 @@ pub enum PaymentIntentUpdate { // incremental_authorization_allowed: Option<bool>, }, MetadataUpdate { - metadata: serde_json::Value, + metadata: pii::SecretSerdeValue, updated_by: String, }, Update(Box<PaymentIntentUpdateFields>), @@ -464,9 +503,9 @@ pub struct PaymentIntentUpdateFields { pub billing_address: Option<Encryption>, pub return_url: Option<String>, pub description: Option<String>, - pub statement_descriptor_name: Option<String>, + pub statement_descriptor: Option<String>, pub order_details: Option<Vec<pii::SecretSerdeValue>>, - pub metadata: Option<serde_json::Value>, + pub metadata: Option<pii::SecretSerdeValue>, pub payment_confirm_source: Option<storage_enums::PaymentSource>, pub updated_by: String, pub session_expiry: Option<PrimitiveDateTime>, @@ -520,16 +559,14 @@ pub struct PaymentIntentUpdateInternal { pub customer_id: Option<common_utils::id_type::CustomerId>, pub return_url: Option<String>, pub setup_future_usage: Option<storage_enums::FutureUsage>, - pub off_session: Option<bool>, - pub metadata: Option<serde_json::Value>, + pub metadata: Option<pii::SecretSerdeValue>, pub modified_at: PrimitiveDateTime, pub active_attempt_id: Option<String>, pub description: Option<String>, - pub statement_descriptor_name: Option<String>, + pub statement_descriptor: Option<String>, #[diesel(deserialize_as = super::OptionalDieselArray<pii::SecretSerdeValue>)] pub order_details: Option<Vec<pii::SecretSerdeValue>>, pub attempt_count: Option<i16>, - pub payment_confirm_source: Option<storage_enums::PaymentSource>, pub updated_by: String, pub surcharge_applicable: Option<bool>, pub authorization_count: Option<i32>, @@ -539,8 +576,6 @@ pub struct PaymentIntentUpdateInternal { pub customer_details: Option<Encryption>, pub billing_address: Option<Encryption>, pub shipping_address: Option<Encryption>, - pub merchant_order_reference_id: Option<String>, - pub is_payment_processor_token_flow: Option<bool>, pub frm_merchant_decision: Option<String>, } @@ -590,71 +625,71 @@ pub struct PaymentIntentUpdateInternal { #[cfg(all(feature = "v2", feature = "payment_v2"))] impl PaymentIntentUpdate { pub fn apply_changeset(self, source: PaymentIntent) -> PaymentIntent { - let PaymentIntentUpdateInternal { - amount, - currency, - status, - amount_captured, - customer_id, - return_url, - setup_future_usage, - off_session, - metadata, - modified_at: _, - active_attempt_id, - description, - statement_descriptor_name, - order_details, - attempt_count, - frm_merchant_decision, - payment_confirm_source, - updated_by, - surcharge_applicable, - authorization_count, - session_expiry, - request_external_three_ds_authentication, - frm_metadata, - customer_details, - billing_address, - merchant_order_reference_id, - shipping_address, - is_payment_processor_token_flow, - } = self.into(); - PaymentIntent { - amount: amount.unwrap_or(source.amount), - currency: currency.or(source.currency), - status: status.unwrap_or(source.status), - amount_captured: amount_captured.or(source.amount_captured), - customer_id: customer_id.or(source.customer_id), - return_url: return_url.or(source.return_url), - setup_future_usage: setup_future_usage.or(source.setup_future_usage), - off_session: off_session.or(source.off_session), - metadata: metadata.or(source.metadata), - modified_at: common_utils::date_time::now(), - active_attempt_id: active_attempt_id.unwrap_or(source.active_attempt_id), - description: description.or(source.description), - statement_descriptor_name: statement_descriptor_name - .or(source.statement_descriptor_name), - order_details: order_details.or(source.order_details), - attempt_count: attempt_count.unwrap_or(source.attempt_count), - frm_merchant_decision: frm_merchant_decision.or(source.frm_merchant_decision), - payment_confirm_source: payment_confirm_source.or(source.payment_confirm_source), - updated_by, - surcharge_applicable: surcharge_applicable.or(source.surcharge_applicable), - authorization_count: authorization_count.or(source.authorization_count), - session_expiry: session_expiry.or(source.session_expiry), - request_external_three_ds_authentication: request_external_three_ds_authentication - .or(source.request_external_three_ds_authentication), - frm_metadata: frm_metadata.or(source.frm_metadata), - customer_details: customer_details.or(source.customer_details), - billing_address: billing_address.or(source.billing_address), - shipping_address: shipping_address.or(source.shipping_address), - merchant_order_reference_id: merchant_order_reference_id - .or(source.merchant_order_reference_id), - is_payment_processor_token_flow: is_payment_processor_token_flow - .or(source.is_payment_processor_token_flow), - ..source - } + todo!() + // let PaymentIntentUpdateInternal { + // amount, + // currency, + // status, + // amount_captured, + // customer_id, + // return_url, + // setup_future_usage, + // off_session, + // metadata, + // modified_at: _, + // active_attempt_id, + // description, + // statement_descriptor, + // order_details, + // attempt_count, + // frm_merchant_decision, + // payment_confirm_source, + // updated_by, + // surcharge_applicable, + // authorization_count, + // session_expiry, + // request_external_three_ds_authentication, + // frm_metadata, + // customer_details, + // billing_address, + // merchant_order_reference_id, + // shipping_address, + // is_payment_processor_token_flow, + // } = self.into(); + // PaymentIntent { + // amount: amount.unwrap_or(source.amount), + // currency: currency.unwrap_or(source.currency), + // status: status.unwrap_or(source.status), + // amount_captured: amount_captured.or(source.amount_captured), + // customer_id: customer_id.or(source.customer_id), + // return_url: return_url.or(source.return_url), + // setup_future_usage: setup_future_usage.or(source.setup_future_usage), + // off_session: off_session.or(source.off_session), + // metadata: metadata.or(source.metadata), + // modified_at: common_utils::date_time::now(), + // active_attempt_id: active_attempt_id.unwrap_or(source.active_attempt_id), + // description: description.or(source.description), + // statement_descriptor: statement_descriptor.or(source.statement_descriptor), + // order_details: order_details.or(source.order_details), + // attempt_count: attempt_count.unwrap_or(source.attempt_count), + // frm_merchant_decision: frm_merchant_decision.or(source.frm_merchant_decision), + // payment_confirm_source: payment_confirm_source.or(source.payment_confirm_source), + // updated_by, + // surcharge_applicable: surcharge_applicable.or(source.surcharge_applicable), + // authorization_count: authorization_count.or(source.authorization_count), + // session_expiry: session_expiry.or(source.session_expiry), + // request_external_three_ds_authentication: request_external_three_ds_authentication + // .or(source.request_external_three_ds_authentication), + // frm_metadata: frm_metadata.or(source.frm_metadata), + // customer_details: customer_details.or(source.customer_details), + // billing_address: billing_address.or(source.billing_address), + // shipping_address: shipping_address.or(source.shipping_address), + // merchant_order_reference_id: merchant_order_reference_id + // .or(source.merchant_order_reference_id), + // is_payment_processor_token_flow: is_payment_processor_token_flow + // .or(source.is_payment_processor_token_flow), + // ..source + // } } } @@ -751,508 +786,509 @@ impl PaymentIntentUpdate { #[cfg(all(feature = "v2", feature = "payment_v2"))] impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal { fn from(payment_intent_update: PaymentIntentUpdate) -> Self { - match payment_intent_update { - PaymentIntentUpdate::MetadataUpdate { - metadata, - updated_by, - } => Self { - metadata: Some(metadata), - modified_at: common_utils::date_time::now(), - updated_by, - amount: None, - currency: None, - status: None, - amount_captured: None, - customer_id: None, - return_url: None, - setup_future_usage: None, - off_session: None, - active_attempt_id: None, - description: None, - statement_descriptor_name: None, - order_details: None, - attempt_count: None, - frm_merchant_decision: None, - payment_confirm_source: None, - surcharge_applicable: None, - authorization_count: None, - session_expiry: None, - request_external_three_ds_authentication: None, - frm_metadata: None, - customer_details: None, - billing_address: None, - merchant_order_reference_id: None, - shipping_address: None, - is_payment_processor_token_flow: None, - }, - PaymentIntentUpdate::Update(value) => Self { - amount: Some(value.amount), - currency: Some(value.currency), - setup_future_usage: value.setup_future_usage, - status: Some(value.status), - customer_id: value.customer_id, - shipping_address: value.shipping_address, - billing_address: value.billing_address, - return_url: value.return_url, - description: value.description, - statement_descriptor_name: value.statement_descriptor_name, - order_details: value.order_details, - metadata: value.metadata, - payment_confirm_source: value.payment_confirm_source, - updated_by: value.updated_by, - session_expiry: value.session_expiry, - request_external_three_ds_authentication: value - .request_external_three_ds_authentication, - frm_metadata: value.frm_metadata, - customer_details: value.customer_details, - merchant_order_reference_id: value.merchant_order_reference_id, - amount_captured: None, - off_session: None, - modified_at: common_utils::date_time::now(), - active_attempt_id: None, - attempt_count: None, - frm_merchant_decision: None, - surcharge_applicable: None, - authorization_count: None, - is_payment_processor_token_flow: value.is_payment_processor_token_flow, - }, - PaymentIntentUpdate::PaymentCreateUpdate { - return_url, - status, - customer_id, - shipping_address, - billing_address, - customer_details, - updated_by, - } => Self { - return_url, - status, - customer_id, - customer_details, - modified_at: common_utils::date_time::now(), - updated_by, - amount: None, - currency: None, - amount_captured: None, - setup_future_usage: None, - off_session: None, - metadata: None, - active_attempt_id: None, - description: None, - statement_descriptor_name: None, - order_details: None, - attempt_count: None, - frm_merchant_decision: None, - payment_confirm_source: None, - surcharge_applicable: None, - authorization_count: None, - session_expiry: None, - request_external_three_ds_authentication: None, - frm_metadata: None, - billing_address, - merchant_order_reference_id: None, - shipping_address, - is_payment_processor_token_flow: None, - }, - PaymentIntentUpdate::PGStatusUpdate { status, updated_by } => Self { - status: Some(status), - modified_at: common_utils::date_time::now(), - updated_by, - amount: None, - currency: None, - amount_captured: None, - customer_id: None, - return_url: None, - setup_future_usage: None, - off_session: None, - metadata: None, - active_attempt_id: None, - description: None, - statement_descriptor_name: None, - order_details: None, - attempt_count: None, - frm_merchant_decision: None, - payment_confirm_source: None, - surcharge_applicable: None, - authorization_count: None, - session_expiry: None, - request_external_three_ds_authentication: None, - frm_metadata: None, - customer_details: None, - billing_address: None, - merchant_order_reference_id: None, - shipping_address: None, - is_payment_processor_token_flow: None, - }, - PaymentIntentUpdate::MerchantStatusUpdate { - status, - billing_address, - shipping_address, - updated_by, - } => Self { - status: Some(status), - modified_at: common_utils::date_time::now(), - updated_by, - amount: None, - currency: None, - amount_captured: None, - customer_id: None, - return_url: None, - setup_future_usage: None, - off_session: None, - metadata: None, - active_attempt_id: None, - description: None, - statement_descriptor_name: None, - order_details: None, - attempt_count: None, - frm_merchant_decision: None, - payment_confirm_source: None, - surcharge_applicable: None, - authorization_count: None, - session_expiry: None, - request_external_three_ds_authentication: None, - frm_metadata: None, - customer_details: None, - billing_address, - merchant_order_reference_id: None, - shipping_address, - is_payment_processor_token_flow: None, - }, - PaymentIntentUpdate::ResponseUpdate { - // amount, - // currency, - status, - amount_captured, - // customer_id, - return_url, - updated_by, - } => Self { - // amount, - // currency: Some(currency), - status: Some(status), - amount_captured, - // customer_id, - return_url, - modified_at: common_utils::date_time::now(), - updated_by, - amount: None, - currency: None, - customer_id: None, - setup_future_usage: None, - off_session: None, - metadata: None, - active_attempt_id: None, - description: None, - statement_descriptor_name: None, - order_details: None, - attempt_count: None, - frm_merchant_decision: None, - payment_confirm_source: None, - surcharge_applicable: None, - authorization_count: None, - session_expiry: None, - request_external_three_ds_authentication: None, - frm_metadata: None, - customer_details: None, - billing_address: None, - merchant_order_reference_id: None, - shipping_address: None, - is_payment_processor_token_flow: None, - }, - PaymentIntentUpdate::PaymentAttemptAndAttemptCountUpdate { - active_attempt_id, - attempt_count, - updated_by, - } => Self { - active_attempt_id: Some(active_attempt_id), - attempt_count: Some(attempt_count), - updated_by, - amount: None, - currency: None, - status: None, - amount_captured: None, - customer_id: None, - return_url: None, - setup_future_usage: None, - off_session: None, - metadata: None, - modified_at: common_utils::date_time::now(), - description: None, - statement_descriptor_name: None, - order_details: None, - frm_merchant_decision: None, - payment_confirm_source: None, - surcharge_applicable: None, - authorization_count: None, - session_expiry: None, - request_external_three_ds_authentication: None, - frm_metadata: None, - customer_details: None, - billing_address: None, - merchant_order_reference_id: None, - shipping_address: None, - is_payment_processor_token_flow: None, - }, - PaymentIntentUpdate::StatusAndAttemptUpdate { - status, - active_attempt_id, - attempt_count, - updated_by, - } => Self { - status: Some(status), - active_attempt_id: Some(active_attempt_id), - attempt_count: Some(attempt_count), - updated_by, - amount: None, - currency: None, - amount_captured: None, - customer_id: None, - return_url: None, - setup_future_usage: None, - off_session: None, - metadata: None, - modified_at: common_utils::date_time::now(), - description: None, - statement_descriptor_name: None, - order_details: None, - frm_merchant_decision: None, - payment_confirm_source: None, - surcharge_applicable: None, - authorization_count: None, - session_expiry: None, - request_external_three_ds_authentication: None, - frm_metadata: None, - customer_details: None, - billing_address: None, - merchant_order_reference_id: None, - shipping_address: None, - is_payment_processor_token_flow: None, - }, - PaymentIntentUpdate::ApproveUpdate { - status, - frm_merchant_decision, - updated_by, - } => Self { - status: Some(status), - frm_merchant_decision, - updated_by, - amount: None, - currency: None, - amount_captured: None, - customer_id: None, - return_url: None, - setup_future_usage: None, - off_session: None, - metadata: None, - modified_at: common_utils::date_time::now(), - active_attempt_id: None, - description: None, - statement_descriptor_name: None, - order_details: None, - attempt_count: None, - payment_confirm_source: None, - surcharge_applicable: None, - authorization_count: None, - session_expiry: None, - request_external_three_ds_authentication: None, - frm_metadata: None, - customer_details: None, - billing_address: None, - merchant_order_reference_id: None, - shipping_address: None, - is_payment_processor_token_flow: None, - }, - PaymentIntentUpdate::RejectUpdate { - status, - frm_merchant_decision, - updated_by, - } => Self { - status: Some(status), - frm_merchant_decision, - updated_by, - amount: None, - currency: None, - amount_captured: None, - customer_id: None, - return_url: None, - setup_future_usage: None, - off_session: None, - metadata: None, - modified_at: common_utils::date_time::now(), - active_attempt_id: None, - description: None, - statement_descriptor_name: None, - order_details: None, - attempt_count: None, - payment_confirm_source: None, - surcharge_applicable: None, - authorization_count: None, - session_expiry: None, - request_external_three_ds_authentication: None, - frm_metadata: None, - customer_details: None, - billing_address: None, - merchant_order_reference_id: None, - shipping_address: None, - is_payment_processor_token_flow: None, - }, - PaymentIntentUpdate::SurchargeApplicableUpdate { - surcharge_applicable, - updated_by, - } => Self { - surcharge_applicable, - updated_by, - amount: None, - currency: None, - status: None, - amount_captured: None, - customer_id: None, - return_url: None, - setup_future_usage: None, - off_session: None, - metadata: None, - modified_at: common_utils::date_time::now(), - active_attempt_id: None, - description: None, - statement_descriptor_name: None, - order_details: None, - attempt_count: None, - frm_merchant_decision: None, - payment_confirm_source: None, - authorization_count: None, - session_expiry: None, - request_external_three_ds_authentication: None, - frm_metadata: None, - customer_details: None, - billing_address: None, - merchant_order_reference_id: None, - shipping_address: None, - is_payment_processor_token_flow: None, - }, - PaymentIntentUpdate::IncrementalAuthorizationAmountUpdate { amount } => Self { - amount: Some(amount), - currency: None, - status: None, - amount_captured: None, - customer_id: None, - return_url: None, - setup_future_usage: None, - off_session: None, - metadata: None, - modified_at: common_utils::date_time::now(), - active_attempt_id: None, - description: None, - statement_descriptor_name: None, - order_details: None, - attempt_count: None, - frm_merchant_decision: None, - payment_confirm_source: None, - updated_by: String::default(), - surcharge_applicable: None, - authorization_count: None, - session_expiry: None, - request_external_three_ds_authentication: None, - frm_metadata: None, - customer_details: None, - billing_address: None, - merchant_order_reference_id: None, - shipping_address: None, - is_payment_processor_token_flow: None, - }, - PaymentIntentUpdate::AuthorizationCountUpdate { - authorization_count, - } => Self { - authorization_count: Some(authorization_count), - amount: None, - currency: None, - status: None, - amount_captured: None, - customer_id: None, - return_url: None, - setup_future_usage: None, - off_session: None, - metadata: None, - modified_at: common_utils::date_time::now(), - active_attempt_id: None, - description: None, - statement_descriptor_name: None, - order_details: None, - attempt_count: None, - frm_merchant_decision: None, - payment_confirm_source: None, - updated_by: String::default(), - surcharge_applicable: None, - session_expiry: None, - request_external_three_ds_authentication: None, - frm_metadata: None, - customer_details: None, - billing_address: None, - merchant_order_reference_id: None, - shipping_address: None, - is_payment_processor_token_flow: None, - }, - PaymentIntentUpdate::CompleteAuthorizeUpdate { shipping_address } => Self { - amount: None, - currency: None, - status: None, - amount_captured: None, - customer_id: None, - return_url: None, - setup_future_usage: None, - off_session: None, - metadata: None, - modified_at: common_utils::date_time::now(), - active_attempt_id: None, - description: None, - statement_descriptor_name: None, - order_details: None, - attempt_count: None, - frm_merchant_decision: None, - payment_confirm_source: None, - updated_by: String::default(), - surcharge_applicable: None, - authorization_count: None, - session_expiry: None, - request_external_three_ds_authentication: None, - frm_metadata: None, - customer_details: None, - billing_address: None, - merchant_order_reference_id: None, - shipping_address, - is_payment_processor_token_flow: None, - }, - PaymentIntentUpdate::ManualUpdate { status, updated_by } => Self { - status, - updated_by, - amount: None, - currency: None, - amount_captured: None, - customer_id: None, - return_url: None, - setup_future_usage: None, - off_session: None, - metadata: None, - modified_at: common_utils::date_time::now(), - active_attempt_id: None, - description: None, - statement_descriptor_name: None, - order_details: None, - attempt_count: None, - frm_merchant_decision: None, - payment_confirm_source: None, - surcharge_applicable: None, - authorization_count: None, - session_expiry: None, - request_external_three_ds_authentication: None, - frm_metadata: None, - customer_details: None, - billing_address: None, - merchant_order_reference_id: None, - shipping_address: None, - is_payment_processor_token_flow: None, - }, - } + todo!() + // match payment_intent_update { + // PaymentIntentUpdate::MetadataUpdate { + // metadata, + // updated_by, + // } => Self { + // metadata: Some(metadata), + // modified_at: common_utils::date_time::now(), + // updated_by, + // amount: None, + // currency: None, + // status: None, + // amount_captured: None, + // customer_id: None, + // return_url: None, + // setup_future_usage: None, + // off_session: None, + // active_attempt_id: None, + // description: None, + // statement_descriptor: None, + // order_details: None, + // attempt_count: None, + // frm_merchant_decision: None, + // payment_confirm_source: None, + // surcharge_applicable: None, + // authorization_count: None, + // session_expiry: None, + // request_external_three_ds_authentication: None, + // frm_metadata: None, + // customer_details: None, + // billing_address: None, + // merchant_order_reference_id: None, + // shipping_address: None, + // is_payment_processor_token_flow: None, + // }, + // PaymentIntentUpdate::Update(value) => Self { + // amount: Some(value.amount), + // currency: Some(value.currency), + // setup_future_usage: value.setup_future_usage, + // status: Some(value.status), + // customer_id: value.customer_id, + // shipping_address: value.shipping_address, + // billing_address: value.billing_address, + // return_url: value.return_url, + // description: value.description, + // statement_descriptor: value.statement_descriptor, + // order_details: value.order_details, + // metadata: value.metadata, + // payment_confirm_source: value.payment_confirm_source, + // updated_by: value.updated_by, + // session_expiry: value.session_expiry, + // request_external_three_ds_authentication: value + // .request_external_three_ds_authentication, + // frm_metadata: value.frm_metadata, + // customer_details: value.customer_details, + // merchant_order_reference_id: value.merchant_order_reference_id, + // amount_captured: None, + // off_session: None, + // modified_at: common_utils::date_time::now(), + // active_attempt_id: None, + // attempt_count: None, + // frm_merchant_decision: None, + // surcharge_applicable: None, + // authorization_count: None, + // is_payment_processor_token_flow: value.is_payment_processor_token_flow, + // }, + // PaymentIntentUpdate::PaymentCreateUpdate { + // return_url, + // status, + // customer_id, + // shipping_address, + // billing_address, + // customer_details, + // updated_by, + // } => Self { + // return_url, + // status, + // customer_id, + // customer_details, + // modified_at: common_utils::date_time::now(), + // updated_by, + // amount: None, + // currency: None, + // amount_captured: None, + // setup_future_usage: None, + // off_session: None, + // metadata: None, + // active_attempt_id: None, + // description: None, + // statement_descriptor: None, + // order_details: None, + // attempt_count: None, + // frm_merchant_decision: None, + // payment_confirm_source: None, + // surcharge_applicable: None, + // authorization_count: None, + // session_expiry: None, + // request_external_three_ds_authentication: None, + // frm_metadata: None, + // billing_address, + // merchant_order_reference_id: None, + // shipping_address, + // is_payment_processor_token_flow: None, + // }, + // PaymentIntentUpdate::PGStatusUpdate { status, updated_by } => Self { + // status: Some(status), + // modified_at: common_utils::date_time::now(), + // updated_by, + // amount: None, + // currency: None, + // amount_captured: None, + // customer_id: None, + // return_url: None, + // setup_future_usage: None, + // off_session: None, + // metadata: None, + // active_attempt_id: None, + // description: None, + // statement_descriptor: None, + // order_details: None, + // attempt_count: None, + // frm_merchant_decision: None, + // payment_confirm_source: None, + // surcharge_applicable: None, + // authorization_count: None, + // session_expiry: None, + // request_external_three_ds_authentication: None, + // frm_metadata: None, + // customer_details: None, + // billing_address: None, + // merchant_order_reference_id: None, + // shipping_address: None, + // is_payment_processor_token_flow: None, + // }, + // PaymentIntentUpdate::MerchantStatusUpdate { + // status, + // billing_address, + // shipping_address, + // updated_by, + // } => Self { + // status: Some(status), + // modified_at: common_utils::date_time::now(), + // updated_by, + // amount: None, + // currency: None, + // amount_captured: None, + // customer_id: None, + // return_url: None, + // setup_future_usage: None, + // off_session: None, + // metadata: None, + // active_attempt_id: None, + // description: None, + // statement_descriptor: None, + // order_details: None, + // attempt_count: None, + // frm_merchant_decision: None, + // payment_confirm_source: None, + // surcharge_applicable: None, + // authorization_count: None, + // session_expiry: None, + // request_external_three_ds_authentication: None, + // frm_metadata: None, + // customer_details: None, + // billing_address, + // merchant_order_reference_id: None, + // shipping_address, + // is_payment_processor_token_flow: None, + // }, + // PaymentIntentUpdate::ResponseUpdate { + // // amount, + // // currency, + // status, + // amount_captured, + // // customer_id, + // return_url, + // updated_by, + // } => Self { + // // amount, + // // currency: Some(currency), + // status: Some(status), + // amount_captured, + // // customer_id, + // return_url, + // modified_at: common_utils::date_time::now(), + // updated_by, + // amount: None, + // currency: None, + // customer_id: None, + // setup_future_usage: None, + // off_session: None, + // metadata: None, + // active_attempt_id: None, + // description: None, + // statement_descriptor: None, + // order_details: None, + // attempt_count: None, + // frm_merchant_decision: None, + // payment_confirm_source: None, + // surcharge_applicable: None, + // authorization_count: None, + // session_expiry: None, + // request_external_three_ds_authentication: None, + // frm_metadata: None, + // customer_details: None, + // billing_address: None, + // merchant_order_reference_id: None, + // shipping_address: None, + // is_payment_processor_token_flow: None, + // }, + // PaymentIntentUpdate::PaymentAttemptAndAttemptCountUpdate { + // active_attempt_id, + // attempt_count, + // updated_by, + // } => Self { + // active_attempt_id: Some(active_attempt_id), + // attempt_count: Some(attempt_count), + // updated_by, + // amount: None, + // currency: None, + // status: None, + // amount_captured: None, + // customer_id: None, + // return_url: None, + // setup_future_usage: None, + // off_session: None, + // metadata: None, + // modified_at: common_utils::date_time::now(), + // description: None, + // statement_descriptor: None, + // order_details: None, + // frm_merchant_decision: None, + // payment_confirm_source: None, + // surcharge_applicable: None, + // authorization_count: None, + // session_expiry: None, + // request_external_three_ds_authentication: None, + // frm_metadata: None, + // customer_details: None, + // billing_address: None, + // merchant_order_reference_id: None, + // shipping_address: None, + // is_payment_processor_token_flow: None, + // }, + // PaymentIntentUpdate::StatusAndAttemptUpdate { + // status, + // active_attempt_id, + // attempt_count, + // updated_by, + // } => Self { + // status: Some(status), + // active_attempt_id: Some(active_attempt_id), + // attempt_count: Some(attempt_count), + // updated_by, + // amount: None, + // currency: None, + // amount_captured: None, + // customer_id: None, + // return_url: None, + // setup_future_usage: None, + // off_session: None, + // metadata: None, + // modified_at: common_utils::date_time::now(), + // description: None, + // statement_descriptor: None, + // order_details: None, + // frm_merchant_decision: None, + // payment_confirm_source: None, + // surcharge_applicable: None, + // authorization_count: None, + // session_expiry: None, + // request_external_three_ds_authentication: None, + // frm_metadata: None, + // customer_details: None, + // billing_address: None, + // merchant_order_reference_id: None, + // shipping_address: None, + // is_payment_processor_token_flow: None, + // }, + // PaymentIntentUpdate::ApproveUpdate { + // status, + // frm_merchant_decision, + // updated_by, + // } => Self { + // status: Some(status), + // frm_merchant_decision, + // updated_by, + // amount: None, + // currency: None, + // amount_captured: None, + // customer_id: None, + // return_url: None, + // setup_future_usage: None, + // off_session: None, + // metadata: None, + // modified_at: common_utils::date_time::now(), + // active_attempt_id: None, + // description: None, + // statement_descriptor: None, + // order_details: None, + // attempt_count: None, + // payment_confirm_source: None, + // surcharge_applicable: None, + // authorization_count: None, + // session_expiry: None, + // request_external_three_ds_authentication: None, + // frm_metadata: None, + // customer_details: None, + // billing_address: None, + // merchant_order_reference_id: None, + // shipping_address: None, + // is_payment_processor_token_flow: None, + // }, + // PaymentIntentUpdate::RejectUpdate { + // status, + // frm_merchant_decision, + // updated_by, + // } => Self { + // status: Some(status), + // frm_merchant_decision, + // updated_by, + // amount: None, + // currency: None, + // amount_captured: None, + // customer_id: None, + // return_url: None, + // setup_future_usage: None, + // off_session: None, + // metadata: None, + // modified_at: common_utils::date_time::now(), + // active_attempt_id: None, + // description: None, + // statement_descriptor: None, + // order_details: None, + // attempt_count: None, + // payment_confirm_source: None, + // surcharge_applicable: None, + // authorization_count: None, + // session_expiry: None, + // request_external_three_ds_authentication: None, + // frm_metadata: None, + // customer_details: None, + // billing_address: None, + // merchant_order_reference_id: None, + // shipping_address: None, + // is_payment_processor_token_flow: None, + // }, + // PaymentIntentUpdate::SurchargeApplicableUpdate { + // surcharge_applicable, + // updated_by, + // } => Self { + // surcharge_applicable, + // updated_by, + // amount: None, + // currency: None, + // status: None, + // amount_captured: None, + // customer_id: None, + // return_url: None, + // setup_future_usage: None, + // off_session: None, + // metadata: None, + // modified_at: common_utils::date_time::now(), + // active_attempt_id: None, + // description: None, + // statement_descriptor: None, + // order_details: None, + // attempt_count: None, + // frm_merchant_decision: None, + // payment_confirm_source: None, + // authorization_count: None, + // session_expiry: None, + // request_external_three_ds_authentication: None, + // frm_metadata: None, + // customer_details: None, + // billing_address: None, + // merchant_order_reference_id: None, + // shipping_address: None, + // is_payment_processor_token_flow: None, + // }, + // PaymentIntentUpdate::IncrementalAuthorizationAmountUpdate { amount } => Self { + // amount: Some(amount), + // currency: None, + // status: None, + // amount_captured: None, + // customer_id: None, + // return_url: None, + // setup_future_usage: None, + // off_session: None, + // metadata: None, + // modified_at: common_utils::date_time::now(), + // active_attempt_id: None, + // description: None, + // statement_descriptor: None, + // order_details: None, + // attempt_count: None, + // frm_merchant_decision: None, + // payment_confirm_source: None, + // updated_by: String::default(), + // surcharge_applicable: None, + // authorization_count: None, + // session_expiry: None, + // request_external_three_ds_authentication: None, + // frm_metadata: None, + // customer_details: None, + // billing_address: None, + // merchant_order_reference_id: None, + // shipping_address: None, + // is_payment_processor_token_flow: None, + // }, + // PaymentIntentUpdate::AuthorizationCountUpdate { + // authorization_count, + // } => Self { + // authorization_count: Some(authorization_count), + // amount: None, + // currency: None, + // status: None, + // amount_captured: None, + // customer_id: None, + // return_url: None, + // setup_future_usage: None, + // off_session: None, + // metadata: None, + // modified_at: common_utils::date_time::now(), + // active_attempt_id: None, + // description: None, + // statement_descriptor: None, + // order_details: None, + // attempt_count: None, + // frm_merchant_decision: None, + // payment_confirm_source: None, + // updated_by: String::default(), + // surcharge_applicable: None, + // session_expiry: None, + // request_external_three_ds_authentication: None, + // frm_metadata: None, + // customer_details: None, + // billing_address: None, + // merchant_order_reference_id: None, + // shipping_address: None, + // is_payment_processor_token_flow: None, + // }, + // PaymentIntentUpdate::CompleteAuthorizeUpdate { shipping_address } => Self { + // amount: None, + // currency: None, + // status: None, + // amount_captured: None, + // customer_id: None, + // return_url: None, + // setup_future_usage: None, + // off_session: None, + // metadata: None, + // modified_at: common_utils::date_time::now(), + // active_attempt_id: None, + // description: None, + // statement_descriptor: None, + // order_details: None, + // attempt_count: None, + // frm_merchant_decision: None, + // payment_confirm_source: None, + // updated_by: String::default(), + // surcharge_applicable: None, + // authorization_count: None, + // session_expiry: None, + // request_external_three_ds_authentication: None, + // frm_metadata: None, + // customer_details: None, + // billing_address: None, + // merchant_order_reference_id: None, + // shipping_address, + // is_payment_processor_token_flow: None, + // }, + // PaymentIntentUpdate::ManualUpdate { status, updated_by } => Self { + // status, + // updated_by, + // amount: None, + // currency: None, + // amount_captured: None, + // customer_id: None, + // return_url: None, + // setup_future_usage: None, + // off_session: None, + // metadata: None, + // modified_at: common_utils::date_time::now(), + // active_attempt_id: None, + // description: None, + // statement_descriptor: None, + // order_details: None, + // attempt_count: None, + // frm_merchant_decision: None, + // payment_confirm_source: None, + // surcharge_applicable: None, + // authorization_count: None, + // session_expiry: None, + // request_external_three_ds_authentication: None, + // frm_metadata: None, + // customer_details: None, + // billing_address: None, + // merchant_order_reference_id: None, + // shipping_address: None, + // is_payment_processor_token_flow: None, + // }, + // } } } diff --git a/crates/diesel_models/src/query/payment_intent.rs b/crates/diesel_models/src/query/payment_intent.rs index ccf82d28048..e148c76686e 100644 --- a/crates/diesel_models/src/query/payment_intent.rs +++ b/crates/diesel_models/src/query/payment_intent.rs @@ -44,7 +44,7 @@ impl PaymentIntent { #[cfg(all(feature = "v2", feature = "payment_v2"))] pub async fn find_by_global_id( conn: &PgPooledConn, - id: &common_utils::id_type::PaymentId, + id: &common_utils::id_type::GlobalPaymentId, ) -> StorageResult<Self> { generics::generic_find_by_id::<<Self as HasTable>::Table, _, _>(conn, id.to_owned()).await } @@ -105,7 +105,7 @@ impl PaymentIntent { } #[cfg(all(feature = "v2", feature = "payment_v2"))] - pub async fn find_optional_by_merchant_id_merchant_reference_id( + pub async fn find_optional_by_merchant_reference_id_merchant_id( conn: &PgPooledConn, merchant_reference_id: &str, merchant_id: &common_utils::id_type::MerchantId, diff --git a/crates/diesel_models/src/schema_v2.rs b/crates/diesel_models/src/schema_v2.rs index ca62d2c477e..a66286e02db 100644 --- a/crates/diesel_models/src/schema_v2.rs +++ b/crates/diesel_models/src/schema_v2.rs @@ -836,7 +836,7 @@ diesel::table! { merchant_id -> Varchar, status -> IntentStatus, amount -> Int8, - currency -> Nullable<Currency>, + currency -> Currency, amount_captured -> Nullable<Int8>, #[max_length = 64] customer_id -> Nullable<Varchar>, @@ -845,15 +845,12 @@ diesel::table! { #[max_length = 255] return_url -> Nullable<Varchar>, metadata -> Nullable<Jsonb>, - #[max_length = 255] - statement_descriptor_name -> Nullable<Varchar>, created_at -> Timestamp, modified_at -> Timestamp, last_synced -> Nullable<Timestamp>, setup_future_usage -> Nullable<FutureUsage>, - off_session -> Nullable<Bool>, #[max_length = 128] - client_secret -> Nullable<Varchar>, + client_secret -> Varchar, #[max_length = 64] active_attempt_id -> Varchar, order_details -> Nullable<Array<Nullable<Jsonb>>>, @@ -862,10 +859,9 @@ diesel::table! { feature_metadata -> Nullable<Json>, attempt_count -> Int2, #[max_length = 64] - profile_id -> Nullable<Varchar>, + profile_id -> Varchar, #[max_length = 255] payment_link_id -> Nullable<Varchar>, - payment_confirm_source -> Nullable<PaymentSource>, #[max_length = 32] updated_by -> Varchar, surcharge_applicable -> Nullable<Bool>, @@ -873,29 +869,32 @@ diesel::table! { authorization_count -> Nullable<Int4>, session_expiry -> Nullable<Timestamp>, request_external_three_ds_authentication -> Nullable<Bool>, - charges -> Nullable<Jsonb>, frm_metadata -> Nullable<Jsonb>, customer_details -> Nullable<Bytea>, - #[max_length = 255] - merchant_order_reference_id -> Nullable<Varchar>, - is_payment_processor_token_flow -> Nullable<Bool>, shipping_cost -> Nullable<Int8>, #[max_length = 32] organization_id -> Varchar, tax_details -> Nullable<Jsonb>, skip_external_tax_calculation -> Nullable<Bool>, #[max_length = 64] - merchant_reference_id -> Varchar, + merchant_reference_id -> Nullable<Varchar>, billing_address -> Nullable<Bytea>, shipping_address -> Nullable<Bytea>, capture_method -> Nullable<CaptureMethod>, authentication_type -> Nullable<AuthenticationType>, - amount_to_capture -> Nullable<Int8>, prerouting_algorithm -> Nullable<Jsonb>, surcharge_amount -> Nullable<Int8>, tax_on_surcharge -> Nullable<Int8>, #[max_length = 64] frm_merchant_decision -> Nullable<Varchar>, + #[max_length = 255] + statement_descriptor -> Nullable<Varchar>, + enable_payment_link -> Nullable<Bool>, + apply_mit_exemption -> Nullable<Bool>, + customer_present -> Nullable<Bool>, + #[max_length = 64] + routing_algorithm_id -> Nullable<Varchar>, + payment_link_config -> Nullable<Jsonb>, #[max_length = 64] id -> Varchar, } diff --git a/crates/hyperswitch_domain_models/src/payments.rs b/crates/hyperswitch_domain_models/src/payments.rs index fee2155e8dc..da56a1dc304 100644 --- a/crates/hyperswitch_domain_models/src/payments.rs +++ b/crates/hyperswitch_domain_models/src/payments.rs @@ -82,70 +82,180 @@ impl PaymentIntent { } #[cfg(all(feature = "v2", feature = "payment_v2",))] - pub fn get_id(&self) -> &id_type::PaymentId { + pub fn get_id(&self) -> &id_type::GlobalPaymentId { &self.id } } +#[cfg(feature = "v2")] +#[derive(Clone, Debug, PartialEq, serde::Serialize)] +pub enum TaxCalculationOverride { + /// Skip calling the external tax provider + Skip, + /// Calculate tax by calling the external tax provider + Calculate, +} + +#[cfg(feature = "v2")] +#[derive(Clone, Debug, PartialEq, serde::Serialize)] +pub enum SurchargeCalculationOverride { + /// Skip calculating surcharge + Skip, + /// Calculate surcharge + Calculate, +} + +#[cfg(feature = "v2")] +impl From<Option<bool>> for TaxCalculationOverride { + fn from(value: Option<bool>) -> Self { + match value { + Some(true) => TaxCalculationOverride::Calculate, + _ => TaxCalculationOverride::Skip, + } + } +} + +#[cfg(feature = "v2")] +impl From<Option<bool>> for SurchargeCalculationOverride { + fn from(value: Option<bool>) -> Self { + match value { + Some(true) => SurchargeCalculationOverride::Calculate, + _ => SurchargeCalculationOverride::Skip, + } + } +} + +#[cfg(feature = "v2")] +#[derive(Clone, Debug, PartialEq, serde::Serialize)] +pub struct AmountDetails { + /// The amount of the order in the lowest denomination of currency + order_amount: MinorUnit, + /// The currency of the order + currency: common_enums::Currency, + /// The shipping cost of the order. This has to be collected from the merchant + shipping_cost: Option<MinorUnit>, + /// Tax details related to the order. This will be calculated by the external tax provider + tax_details: Option<TaxDetails>, + /// The action to whether calculate tax by calling external tax provider or not + skip_external_tax_calculation: TaxCalculationOverride, + /// The action to whether calculate surcharge or not + skip_surcharge_calculation: SurchargeCalculationOverride, + /// The surcharge amount to be added to the order, collected from the merchant + surcharge_amount: Option<MinorUnit>, + /// tax on surcharge amount + tax_on_surcharge: Option<MinorUnit>, +} + +#[cfg(feature = "v2")] +impl AmountDetails { + /// Get the action to whether calculate surcharge or not as a boolean value + fn get_surcharge_action_as_bool(&self) -> bool { + match self.skip_surcharge_calculation { + SurchargeCalculationOverride::Skip => false, + SurchargeCalculationOverride::Calculate => true, + } + } + + /// Get the action to whether calculate external tax or not as a boolean value + fn get_external_tax_action_as_bool(&self) -> bool { + match self.skip_external_tax_calculation { + TaxCalculationOverride::Skip => false, + TaxCalculationOverride::Calculate => true, + } + } +} + #[cfg(all(feature = "v2", feature = "payment_v2"))] #[derive(Clone, Debug, PartialEq, serde::Serialize)] pub struct PaymentIntent { + /// The global identifier for the payment intent. This is generated by the system. + /// The format of the global id is `{cell_id:5}_pay_{time_ordered_uuid:32}`. + pub id: id_type::GlobalPaymentId, + /// The identifier for the merchant. This is automatically derived from the api key used to create the payment. pub merchant_id: id_type::MerchantId, + /// The status of payment intent. pub status: storage_enums::IntentStatus, - pub amount: MinorUnit, - pub currency: Option<storage_enums::Currency>, + /// The amount related details of the payment + pub amount_details: AmountDetails, + /// The total amount captured for the order. This is the sum of all the captured amounts for the order. pub amount_captured: Option<MinorUnit>, + /// The identifier for the customer. This is the identifier for the customer in the merchant's system. pub customer_id: Option<id_type::CustomerId>, - pub description: Option<String>, - pub return_url: Option<String>, - pub metadata: Option<serde_json::Value>, - pub statement_descriptor_name: Option<String>, + /// The description of the order. This will be passed to connectors which support description. + pub description: Option<common_utils::types::Description>, + /// The return url for the payment. This is the url to which the user will be redirected after the payment is completed. + pub return_url: Option<common_utils::types::Url>, + /// The metadata for the payment intent. This is the metadata that will be passed to the connectors. + pub metadata: Option<pii::SecretSerdeValue>, + /// The statement descriptor for the order, this will be displayed in the user's bank statement. + pub statement_descriptor: Option<common_utils::types::StatementDescriptor>, + /// The time at which the order was created #[serde(with = "common_utils::custom_serde::iso8601")] pub created_at: PrimitiveDateTime, + /// The time at which the order was last modified #[serde(with = "common_utils::custom_serde::iso8601")] pub modified_at: PrimitiveDateTime, #[serde(with = "common_utils::custom_serde::iso8601::option")] pub last_synced: Option<PrimitiveDateTime>, pub setup_future_usage: Option<storage_enums::FutureUsage>, - pub off_session: Option<bool>, - pub client_secret: Option<String>, + /// The client secret that is generated for the payment. This is used to authenticate the payment from client facing apis. + pub client_secret: common_utils::types::ClientSecret, + /// The active attempt for the payment intent. This is the payment attempt that is currently active for the payment intent. pub active_attempt: RemoteStorageObject<PaymentAttempt>, + /// The order details for the payment. pub order_details: Option<Vec<pii::SecretSerdeValue>>, - pub allowed_payment_method_types: Option<serde_json::Value>, - pub connector_metadata: Option<serde_json::Value>, - pub feature_metadata: Option<serde_json::Value>, + /// This is the list of payment method types that are allowed for the payment intent. + /// This field allows the merchant to restrict the payment methods that can be used for the payment intent. + pub allowed_payment_method_types: Option<pii::SecretSerdeValue>, + /// This metadata contains details about + pub connector_metadata: Option<pii::SecretSerdeValue>, + pub feature_metadata: Option<pii::SecretSerdeValue>, + /// Number of attempts that have been made for the order pub attempt_count: i16, - pub profile_id: Option<id_type::ProfileId>, + /// The profile id for the payment. + pub profile_id: id_type::ProfileId, + /// The payment link id for the payment. This is generated only if `enable_payment_link` is set to true. pub payment_link_id: Option<String>, - // Denotes the action(approve or reject) taken by merchant in case of manual review. - // Manual review can occur when the transaction is marked as risky by the frm_processor, payment processor or when there is underpayment/over payment incase of crypto payment - pub frm_merchant_decision: Option<String>, - pub payment_confirm_source: Option<storage_enums::PaymentSource>, - + /// This Denotes the action(approve or reject) taken by merchant in case of manual review. + /// Manual review can occur when the transaction is marked as risky by the frm_processor, payment processor or when there is underpayment/over payment incase of crypto payment + pub frm_merchant_decision: Option<common_enums::MerchantDecision>, + /// Denotes the last instance which updated the payment pub updated_by: String, - pub surcharge_applicable: Option<bool>, + /// Denotes whether merchant requested for incremental authorization to be enabled for this payment. pub request_incremental_authorization: Option<storage_enums::RequestIncrementalAuthorization>, + /// Denotes the number of authorizations that have been made for the payment. pub authorization_count: Option<i32>, + /// Denotes the client secret expiry for the payment. This is the time at which the client secret will expire. #[serde(with = "common_utils::custom_serde::iso8601::option")] pub session_expiry: Option<PrimitiveDateTime>, - pub request_external_three_ds_authentication: Option<bool>, - pub charges: Option<pii::SecretSerdeValue>, + /// Denotes whether merchant requested for 3ds authentication to be enabled for this payment. + pub request_external_three_ds_authentication: common_enums::External3dsAuthenticationRequest, + /// Metadata related to fraud and risk management pub frm_metadata: Option<pii::SecretSerdeValue>, + /// The details of the customer in a denormalized form. Only a subset of fields are stored. pub customer_details: Option<Encryptable<Secret<serde_json::Value>>>, - pub merchant_order_reference_id: Option<String>, - pub is_payment_processor_token_flow: Option<bool>, - pub shipping_cost: Option<MinorUnit>, - pub tax_details: Option<TaxDetails>, - pub merchant_reference_id: String, + /// The reference id for the order in the merchant's system. This value can be passed by the merchant. + pub merchant_reference_id: Option<common_utils::id_type::PaymentId>, + /// The billing address for the order in a denormalized form. pub billing_address: Option<Encryptable<Secret<serde_json::Value>>>, + /// The shipping address for the order in a denormalized form. pub shipping_address: Option<Encryptable<Secret<serde_json::Value>>>, + /// Capture method for the payment pub capture_method: Option<storage_enums::CaptureMethod>, - pub id: id_type::PaymentId, + /// Authentication type that is requested by the merchant for this payment. pub authentication_type: Option<common_enums::AuthenticationType>, - pub amount_to_capture: Option<MinorUnit>, + /// This contains the pre routing results that are done when routing is done during listing the payment methods. pub prerouting_algorithm: Option<serde_json::Value>, - pub surcharge_amount: Option<MinorUnit>, - pub tax_on_surcharge: Option<MinorUnit>, + /// The organization id for the payment. This is derived from the merchant account pub organization_id: id_type::OrganizationId, - pub skip_external_tax_calculation: Option<bool>, + /// Denotes the request by the merchant whether to enable a payment link for this payment. + pub enable_payment_link: common_enums::EnablePaymentLinkRequest, + /// Denotes the request by the merchant whether to apply MIT exemption for this payment + pub apply_mit_exemption: common_enums::MitExemptionRequest, + /// Denotes whether the customer is present during the payment flow. This information may be used for 3ds authentication + pub customer_present: common_enums::PresenceOfCustomerDuringPayment, + /// Denotes the override for payment link configuration + pub payment_link_config: Option<diesel_models::PaymentLinkConfigRequestForPayments>, + /// The straight through routing algorithm id that is used for this payment. This overrides the default routing algorithm that is configured in business profile. + pub routing_algorithm_id: Option<id_type::RoutingId>, } diff --git a/crates/hyperswitch_domain_models/src/payments/payment_intent.rs b/crates/hyperswitch_domain_models/src/payments/payment_intent.rs index 619ebcce68a..eb207a19508 100644 --- a/crates/hyperswitch_domain_models/src/payments/payment_intent.rs +++ b/crates/hyperswitch_domain_models/src/payments/payment_intent.rs @@ -60,7 +60,7 @@ pub trait PaymentIntentInterface { async fn find_payment_intent_by_id( &self, state: &KeyManagerState, - id: &id_type::PaymentId, + id: &id_type::GlobalPaymentId, merchant_key_store: &MerchantKeyStore, storage_scheme: storage_enums::MerchantStorageScheme, ) -> error_stack::Result<PaymentIntent, errors::StorageError>; @@ -146,120 +146,11 @@ pub struct CustomerData { pub phone_country_code: Option<String>, } -#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "payment_v2")))] -#[derive(Clone, Debug, PartialEq)] -pub struct PaymentIntentNew { - pub payment_id: id_type::PaymentId, - pub merchant_id: id_type::MerchantId, - pub status: storage_enums::IntentStatus, - pub amount: MinorUnit, - pub currency: Option<storage_enums::Currency>, - pub amount_captured: Option<MinorUnit>, - pub customer_id: Option<id_type::CustomerId>, - pub description: Option<String>, - pub return_url: Option<String>, - pub metadata: Option<serde_json::Value>, - pub frm_metadata: Option<pii::SecretSerdeValue>, - pub connector_id: Option<String>, - pub shipping_address_id: Option<String>, - pub billing_address_id: Option<String>, - pub statement_descriptor_name: Option<String>, - pub statement_descriptor_suffix: Option<String>, - pub created_at: Option<PrimitiveDateTime>, - pub modified_at: Option<PrimitiveDateTime>, - pub last_synced: Option<PrimitiveDateTime>, - pub setup_future_usage: Option<storage_enums::FutureUsage>, - pub off_session: Option<bool>, - pub client_secret: Option<String>, - pub active_attempt: RemoteStorageObject<PaymentAttempt>, - pub business_country: Option<storage_enums::CountryAlpha2>, - pub business_label: Option<String>, - pub order_details: Option<Vec<pii::SecretSerdeValue>>, - pub allowed_payment_method_types: Option<serde_json::Value>, - pub connector_metadata: Option<serde_json::Value>, - pub feature_metadata: Option<serde_json::Value>, - pub attempt_count: i16, - pub profile_id: Option<id_type::ProfileId>, - pub merchant_decision: Option<String>, - pub payment_link_id: Option<String>, - pub payment_confirm_source: Option<storage_enums::PaymentSource>, - - pub updated_by: String, - pub surcharge_applicable: Option<bool>, - pub request_incremental_authorization: Option<storage_enums::RequestIncrementalAuthorization>, - pub incremental_authorization_allowed: Option<bool>, - pub authorization_count: Option<i32>, - pub fingerprint_id: Option<String>, - pub session_expiry: Option<PrimitiveDateTime>, - pub request_external_three_ds_authentication: Option<bool>, - pub charges: Option<pii::SecretSerdeValue>, - pub customer_details: Option<Encryptable<Secret<serde_json::Value>>>, - pub billing_details: Option<Encryptable<Secret<serde_json::Value>>>, - pub shipping_details: Option<Encryptable<Secret<serde_json::Value>>>, - pub is_payment_processor_token_flow: Option<bool>, - pub organization_id: id_type::OrganizationId, - pub skip_external_tax_calculation: Option<bool>, -} - -#[cfg(all(feature = "v2", feature = "payment_v2"))] -#[derive(Clone, Debug, PartialEq)] -pub struct PaymentIntentNew { - pub payment_id: id_type::PaymentId, - pub merchant_id: id_type::MerchantId, - pub status: storage_enums::IntentStatus, - pub amount: MinorUnit, - pub currency: Option<storage_enums::Currency>, - pub amount_captured: Option<MinorUnit>, - pub customer_id: Option<id_type::CustomerId>, - pub description: Option<String>, - pub return_url: Option<String>, - pub metadata: Option<serde_json::Value>, - pub frm_metadata: Option<pii::SecretSerdeValue>, - pub connector_id: Option<String>, - pub shipping_address_id: Option<String>, - pub billing_address_id: Option<String>, - pub statement_descriptor_name: Option<String>, - pub statement_descriptor_suffix: Option<String>, - pub created_at: Option<PrimitiveDateTime>, - pub modified_at: Option<PrimitiveDateTime>, - pub last_synced: Option<PrimitiveDateTime>, - pub setup_future_usage: Option<storage_enums::FutureUsage>, - pub off_session: Option<bool>, - pub client_secret: Option<String>, - pub active_attempt: RemoteStorageObject<PaymentAttempt>, - pub business_country: Option<storage_enums::CountryAlpha2>, - pub business_label: Option<String>, - pub order_details: Option<Vec<pii::SecretSerdeValue>>, - pub allowed_payment_method_types: Option<serde_json::Value>, - pub connector_metadata: Option<serde_json::Value>, - pub feature_metadata: Option<serde_json::Value>, - pub attempt_count: i16, - pub profile_id: Option<id_type::ProfileId>, - pub merchant_decision: Option<String>, - pub payment_link_id: Option<String>, - pub payment_confirm_source: Option<storage_enums::PaymentSource>, - - pub updated_by: String, - pub surcharge_applicable: Option<bool>, - pub request_incremental_authorization: Option<storage_enums::RequestIncrementalAuthorization>, - pub incremental_authorization_allowed: Option<bool>, - pub authorization_count: Option<i32>, - pub fingerprint_id: Option<String>, - pub session_expiry: Option<PrimitiveDateTime>, - pub request_external_three_ds_authentication: Option<bool>, - pub charges: Option<pii::SecretSerdeValue>, - pub customer_details: Option<Encryptable<Secret<serde_json::Value>>>, - pub billing_details: Option<Encryptable<Secret<serde_json::Value>>>, - pub shipping_details: Option<Encryptable<Secret<serde_json::Value>>>, - pub is_payment_processor_token_flow: Option<bool>, - pub organization_id: id_type::OrganizationId, -} - #[cfg(all(feature = "v2", feature = "payment_v2"))] #[derive(Debug, Clone, Serialize)] pub struct PaymentIntentUpdateFields { - pub amount: MinorUnit, - pub currency: storage_enums::Currency, + pub amount: Option<MinorUnit>, + pub currency: Option<storage_enums::Currency>, pub setup_future_usage: Option<storage_enums::FutureUsage>, pub status: storage_enums::IntentStatus, pub customer_id: Option<id_type::CustomerId>, @@ -267,9 +158,9 @@ pub struct PaymentIntentUpdateFields { pub billing_address: Option<Encryptable<Secret<serde_json::Value>>>, pub return_url: Option<String>, pub description: Option<String>, - pub statement_descriptor_name: Option<String>, + pub statement_descriptor: Option<String>, pub order_details: Option<Vec<pii::SecretSerdeValue>>, - pub metadata: Option<serde_json::Value>, + pub metadata: Option<pii::SecretSerdeValue>, pub payment_confirm_source: Option<storage_enums::PaymentSource>, pub updated_by: String, pub session_expiry: Option<PrimitiveDateTime>, @@ -394,6 +285,7 @@ pub enum PaymentIntentUpdate { }, } +// TODO: remove all enum variants and create new variants that should be used for v2 #[cfg(all(feature = "v2", feature = "payment_v2"))] #[derive(Debug, Clone, Serialize)] pub enum PaymentIntentUpdate { @@ -404,7 +296,7 @@ pub enum PaymentIntentUpdate { updated_by: String, }, MetadataUpdate { - metadata: serde_json::Value, + metadata: pii::SecretSerdeValue, updated_by: String, }, Update(Box<PaymentIntentUpdateFields>), @@ -478,14 +370,14 @@ pub struct PaymentIntentUpdateInternal { pub return_url: Option<String>, pub setup_future_usage: Option<storage_enums::FutureUsage>, pub off_session: Option<bool>, - pub metadata: Option<serde_json::Value>, + pub metadata: Option<pii::SecretSerdeValue>, pub modified_at: Option<PrimitiveDateTime>, pub active_attempt_id: Option<String>, pub description: Option<String>, - pub statement_descriptor_name: Option<String>, + pub statement_descriptor: Option<String>, pub order_details: Option<Vec<pii::SecretSerdeValue>>, pub attempt_count: Option<i16>, - pub frm_merchant_decision: Option<String>, + pub frm_merchant_decision: Option<common_enums::MerchantDecision>, pub payment_confirm_source: Option<storage_enums::PaymentSource>, pub updated_by: String, pub surcharge_applicable: Option<bool>, @@ -547,177 +439,178 @@ pub struct PaymentIntentUpdateInternal { #[cfg(all(feature = "v2", feature = "payment_v2"))] impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal { fn from(payment_intent_update: PaymentIntentUpdate) -> Self { - match payment_intent_update { - PaymentIntentUpdate::MetadataUpdate { - metadata, - updated_by, - } => Self { - metadata: Some(metadata), - modified_at: Some(common_utils::date_time::now()), - updated_by, - ..Default::default() - }, - PaymentIntentUpdate::Update(value) => Self { - amount: Some(value.amount), - currency: Some(value.currency), - setup_future_usage: value.setup_future_usage, - status: Some(value.status), - customer_id: value.customer_id, - return_url: value.return_url, - description: value.description, - statement_descriptor_name: value.statement_descriptor_name, - order_details: value.order_details, - metadata: value.metadata, - payment_confirm_source: value.payment_confirm_source, - updated_by: value.updated_by, - session_expiry: value.session_expiry, - request_external_three_ds_authentication: value - .request_external_three_ds_authentication, - frm_metadata: value.frm_metadata, - customer_details: value.customer_details, - billing_address: value.billing_address, - merchant_order_reference_id: value.merchant_order_reference_id, - shipping_address: value.shipping_address, - is_payment_processor_token_flow: value.is_payment_processor_token_flow, - modified_at: Some(common_utils::date_time::now()), - ..Default::default() - }, - PaymentIntentUpdate::PaymentCreateUpdate { - return_url, - status, - customer_id, - shipping_address, - billing_address, - customer_details, - updated_by, - } => Self { - return_url, - status, - customer_id, - shipping_address, - billing_address, - customer_details, - modified_at: Some(common_utils::date_time::now()), - updated_by, - ..Default::default() - }, - PaymentIntentUpdate::PGStatusUpdate { status, updated_by } => Self { - status: Some(status), - modified_at: Some(common_utils::date_time::now()), - updated_by, - ..Default::default() - }, - PaymentIntentUpdate::MerchantStatusUpdate { - status, - shipping_address, - billing_address, - updated_by, - } => Self { - status: Some(status), - shipping_address, - billing_address, - modified_at: Some(common_utils::date_time::now()), - updated_by, - ..Default::default() - }, - PaymentIntentUpdate::ResponseUpdate { - // amount, - // currency, - status, - amount_captured, - // customer_id, - return_url, - updated_by, - } => Self { - // amount, - // currency: Some(currency), - status: Some(status), - amount_captured, - // customer_id, - return_url, - modified_at: Some(common_utils::date_time::now()), - updated_by, - ..Default::default() - }, - PaymentIntentUpdate::PaymentAttemptAndAttemptCountUpdate { - active_attempt_id, - attempt_count, - updated_by, - } => Self { - active_attempt_id: Some(active_attempt_id), - attempt_count: Some(attempt_count), - updated_by, - modified_at: Some(common_utils::date_time::now()), - ..Default::default() - }, - PaymentIntentUpdate::StatusAndAttemptUpdate { - status, - active_attempt_id, - attempt_count, - updated_by, - } => Self { - status: Some(status), - active_attempt_id: Some(active_attempt_id), - attempt_count: Some(attempt_count), - updated_by, - modified_at: Some(common_utils::date_time::now()), - ..Default::default() - }, - PaymentIntentUpdate::ApproveUpdate { - status, - frm_merchant_decision, - updated_by, - } => Self { - status: Some(status), - frm_merchant_decision, - updated_by, - modified_at: Some(common_utils::date_time::now()), - ..Default::default() - }, - PaymentIntentUpdate::RejectUpdate { - status, - frm_merchant_decision, - updated_by, - } => Self { - status: Some(status), - frm_merchant_decision, - updated_by, - modified_at: Some(common_utils::date_time::now()), - ..Default::default() - }, - PaymentIntentUpdate::SurchargeApplicableUpdate { - surcharge_applicable, - updated_by, - } => Self { - surcharge_applicable: Some(surcharge_applicable), - modified_at: Some(common_utils::date_time::now()), - updated_by, - ..Default::default() - }, - PaymentIntentUpdate::IncrementalAuthorizationAmountUpdate { amount } => Self { - amount: Some(amount), - modified_at: Some(common_utils::date_time::now()), - ..Default::default() - }, - PaymentIntentUpdate::AuthorizationCountUpdate { - authorization_count, - } => Self { - authorization_count: Some(authorization_count), - modified_at: Some(common_utils::date_time::now()), - ..Default::default() - }, - PaymentIntentUpdate::CompleteAuthorizeUpdate { shipping_address } => Self { - shipping_address, - modified_at: Some(common_utils::date_time::now()), - ..Default::default() - }, - PaymentIntentUpdate::ManualUpdate { status, updated_by } => Self { - status, - modified_at: Some(common_utils::date_time::now()), - updated_by, - ..Default::default() - }, - } + todo!() + // match payment_intent_update { + // PaymentIntentUpdate::MetadataUpdate { + // metadata, + // updated_by, + // } => Self { + // metadata: Some(metadata), + // modified_at: Some(common_utils::date_time::now()), + // updated_by, + // ..Default::default() + // }, + // PaymentIntentUpdate::Update(value) => Self { + // amount: Some(value.amount), + // currency: Some(value.currency), + // setup_future_usage: value.setup_future_usage, + // status: Some(value.status), + // customer_id: value.customer_id, + // return_url: value.return_url, + // description: value.description, + // statement_descriptor: value.statement_descriptor, + // order_details: value.order_details, + // metadata: value.metadata, + // payment_confirm_source: value.payment_confirm_source, + // updated_by: value.updated_by, + // session_expiry: value.session_expiry, + // request_external_three_ds_authentication: value + // .request_external_three_ds_authentication, + // frm_metadata: value.frm_metadata, + // customer_details: value.customer_details, + // billing_address: value.billing_address, + // merchant_order_reference_id: value.merchant_order_reference_id, + // shipping_address: value.shipping_address, + // is_payment_processor_token_flow: value.is_payment_processor_token_flow, + // modified_at: Some(common_utils::date_time::now()), + // ..Default::default() + // }, + // PaymentIntentUpdate::PaymentCreateUpdate { + // return_url, + // status, + // customer_id, + // shipping_address, + // billing_address, + // customer_details, + // updated_by, + // } => Self { + // return_url, + // status, + // customer_id, + // shipping_address, + // billing_address, + // customer_details, + // modified_at: Some(common_utils::date_time::now()), + // updated_by, + // ..Default::default() + // }, + // PaymentIntentUpdate::PGStatusUpdate { status, updated_by } => Self { + // status: Some(status), + // modified_at: Some(common_utils::date_time::now()), + // updated_by, + // ..Default::default() + // }, + // PaymentIntentUpdate::MerchantStatusUpdate { + // status, + // shipping_address, + // billing_address, + // updated_by, + // } => Self { + // status: Some(status), + // shipping_address, + // billing_address, + // modified_at: Some(common_utils::date_time::now()), + // updated_by, + // ..Default::default() + // }, + // PaymentIntentUpdate::ResponseUpdate { + // // amount, + // // currency, + // status, + // amount_captured, + // // customer_id, + // return_url, + // updated_by, + // } => Self { + // // amount, + // // currency: Some(currency), + // status: Some(status), + // amount_captured, + // // customer_id, + // return_url, + // modified_at: Some(common_utils::date_time::now()), + // updated_by, + // ..Default::default() + // }, + // PaymentIntentUpdate::PaymentAttemptAndAttemptCountUpdate { + // active_attempt_id, + // attempt_count, + // updated_by, + // } => Self { + // active_attempt_id: Some(active_attempt_id), + // attempt_count: Some(attempt_count), + // updated_by, + // modified_at: Some(common_utils::date_time::now()), + // ..Default::default() + // }, + // PaymentIntentUpdate::StatusAndAttemptUpdate { + // status, + // active_attempt_id, + // attempt_count, + // updated_by, + // } => Self { + // status: Some(status), + // active_attempt_id: Some(active_attempt_id), + // attempt_count: Some(attempt_count), + // updated_by, + // modified_at: Some(common_utils::date_time::now()), + // ..Default::default() + // }, + // PaymentIntentUpdate::ApproveUpdate { + // status, + // frm_merchant_decision, + // updated_by, + // } => Self { + // status: Some(status), + // frm_merchant_decision, + // updated_by, + // modified_at: Some(common_utils::date_time::now()), + // ..Default::default() + // }, + // PaymentIntentUpdate::RejectUpdate { + // status, + // frm_merchant_decision, + // updated_by, + // } => Self { + // status: Some(status), + // frm_merchant_decision, + // updated_by, + // modified_at: Some(common_utils::date_time::now()), + // ..Default::default() + // }, + // PaymentIntentUpdate::SurchargeApplicableUpdate { + // surcharge_applicable, + // updated_by, + // } => Self { + // surcharge_applicable: Some(surcharge_applicable), + // modified_at: Some(common_utils::date_time::now()), + // updated_by, + // ..Default::default() + // }, + // PaymentIntentUpdate::IncrementalAuthorizationAmountUpdate { amount } => Self { + // amount: Some(amount), + // modified_at: Some(common_utils::date_time::now()), + // ..Default::default() + // }, + // PaymentIntentUpdate::AuthorizationCountUpdate { + // authorization_count, + // } => Self { + // authorization_count: Some(authorization_count), + // modified_at: Some(common_utils::date_time::now()), + // ..Default::default() + // }, + // PaymentIntentUpdate::CompleteAuthorizeUpdate { shipping_address } => Self { + // shipping_address, + // modified_at: Some(common_utils::date_time::now()), + // ..Default::default() + // }, + // PaymentIntentUpdate::ManualUpdate { status, updated_by } => Self { + // status, + // modified_at: Some(common_utils::date_time::now()), + // updated_by, + // ..Default::default() + // }, + // } } } @@ -856,215 +749,216 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal { status, merchant_decision, updated_by, - } => Self { - status: Some(status), - merchant_decision, - updated_by, - ..Default::default() - }, - PaymentIntentUpdate::RejectUpdate { - status, - merchant_decision, - updated_by, - } => Self { - status: Some(status), - merchant_decision, - updated_by, - ..Default::default() - }, - PaymentIntentUpdate::SurchargeApplicableUpdate { - surcharge_applicable, - updated_by, - } => Self { - surcharge_applicable: Some(surcharge_applicable), - updated_by, - ..Default::default() - }, - PaymentIntentUpdate::IncrementalAuthorizationAmountUpdate { amount } => Self { - amount: Some(amount), - ..Default::default() - }, - PaymentIntentUpdate::AuthorizationCountUpdate { - authorization_count, - } => Self { - authorization_count: Some(authorization_count), - ..Default::default() - }, - PaymentIntentUpdate::CompleteAuthorizeUpdate { - shipping_address_id, - } => Self { - shipping_address_id, - ..Default::default() - }, - PaymentIntentUpdate::ManualUpdate { status, updated_by } => Self { - status, - modified_at: Some(common_utils::date_time::now()), - updated_by, - ..Default::default() - }, - PaymentIntentUpdate::SessionResponseUpdate { - tax_details, - shipping_address_id, - updated_by, - shipping_details, - } => Self { - tax_details: Some(tax_details), - shipping_address_id, - updated_by, - shipping_details, - ..Default::default() - }, - } - } -} - -use diesel_models::{ - PaymentIntentUpdate as DieselPaymentIntentUpdate, - PaymentIntentUpdateFields as DieselPaymentIntentUpdateFields, -}; -#[cfg(all(feature = "v2", feature = "payment_v2"))] -impl From<PaymentIntentUpdate> for DieselPaymentIntentUpdate { - fn from(value: PaymentIntentUpdate) -> Self { - match value { - PaymentIntentUpdate::ResponseUpdate { - status, - amount_captured, - return_url, - updated_by, - } => Self::ResponseUpdate { - status, - amount_captured, - return_url, - updated_by, - }, - PaymentIntentUpdate::MetadataUpdate { - metadata, - updated_by, - } => Self::MetadataUpdate { - metadata, - updated_by, - }, - PaymentIntentUpdate::Update(value) => { - Self::Update(Box::new(DieselPaymentIntentUpdateFields { - amount: value.amount, - currency: value.currency, - setup_future_usage: value.setup_future_usage, - status: value.status, - customer_id: value.customer_id, - return_url: value.return_url, - description: value.description, - statement_descriptor_name: value.statement_descriptor_name, - order_details: value.order_details, - metadata: value.metadata, - payment_confirm_source: value.payment_confirm_source, - updated_by: value.updated_by, - session_expiry: value.session_expiry, - request_external_three_ds_authentication: value - .request_external_three_ds_authentication, - frm_metadata: value.frm_metadata, - customer_details: value.customer_details.map(Encryption::from), - billing_address: value.billing_address.map(Encryption::from), - shipping_address: value.shipping_address.map(Encryption::from), - merchant_order_reference_id: value.merchant_order_reference_id, - is_payment_processor_token_flow: value.is_payment_processor_token_flow, - })) - } - PaymentIntentUpdate::PaymentCreateUpdate { - return_url, - status, - customer_id, - shipping_address, - billing_address, - customer_details, - updated_by, - } => Self::PaymentCreateUpdate { - return_url, - status, - customer_id, - shipping_address: shipping_address.map(Encryption::from), - billing_address: billing_address.map(Encryption::from), - customer_details: customer_details.map(Encryption::from), - updated_by, - }, - PaymentIntentUpdate::MerchantStatusUpdate { - status, - shipping_address, - billing_address, - updated_by, - } => Self::MerchantStatusUpdate { - status, - shipping_address: shipping_address.map(Encryption::from), - billing_address: billing_address.map(Encryption::from), - updated_by, - }, - PaymentIntentUpdate::PGStatusUpdate { status, updated_by } => { - Self::PGStatusUpdate { status, updated_by } - } - PaymentIntentUpdate::PaymentAttemptAndAttemptCountUpdate { - active_attempt_id, - attempt_count, - updated_by, - } => Self::PaymentAttemptAndAttemptCountUpdate { - active_attempt_id, - attempt_count, - updated_by, - }, - PaymentIntentUpdate::StatusAndAttemptUpdate { - status, - active_attempt_id, - attempt_count, - updated_by, - } => Self::StatusAndAttemptUpdate { - status, - active_attempt_id, - attempt_count, - updated_by, - }, - PaymentIntentUpdate::ApproveUpdate { - status, - frm_merchant_decision, - updated_by, - } => Self::ApproveUpdate { - status, - frm_merchant_decision, + } => Self { + status: Some(status), + merchant_decision, updated_by, + ..Default::default() }, PaymentIntentUpdate::RejectUpdate { status, - frm_merchant_decision, + merchant_decision, updated_by, - } => Self::RejectUpdate { - status, - frm_merchant_decision, + } => Self { + status: Some(status), + merchant_decision, updated_by, + ..Default::default() }, PaymentIntentUpdate::SurchargeApplicableUpdate { surcharge_applicable, updated_by, - } => Self::SurchargeApplicableUpdate { + } => Self { surcharge_applicable: Some(surcharge_applicable), updated_by, + ..Default::default() + }, + PaymentIntentUpdate::IncrementalAuthorizationAmountUpdate { amount } => Self { + amount: Some(amount), + ..Default::default() }, - PaymentIntentUpdate::IncrementalAuthorizationAmountUpdate { amount } => { - Self::IncrementalAuthorizationAmountUpdate { amount } - } PaymentIntentUpdate::AuthorizationCountUpdate { authorization_count, - } => Self::AuthorizationCountUpdate { - authorization_count, + } => Self { + authorization_count: Some(authorization_count), + ..Default::default() + }, + PaymentIntentUpdate::CompleteAuthorizeUpdate { + shipping_address_id, + } => Self { + shipping_address_id, + ..Default::default() + }, + PaymentIntentUpdate::ManualUpdate { status, updated_by } => Self { + status, + modified_at: Some(common_utils::date_time::now()), + updated_by, + ..Default::default() + }, + PaymentIntentUpdate::SessionResponseUpdate { + tax_details, + shipping_address_id, + updated_by, + shipping_details, + } => Self { + tax_details: Some(tax_details), + shipping_address_id, + updated_by, + shipping_details, + ..Default::default() }, - PaymentIntentUpdate::CompleteAuthorizeUpdate { shipping_address } => { - Self::CompleteAuthorizeUpdate { - shipping_address: shipping_address.map(Encryption::from), - } - } - PaymentIntentUpdate::ManualUpdate { status, updated_by } => { - Self::ManualUpdate { status, updated_by } - } } } } +use diesel_models::{ + PaymentIntentUpdate as DieselPaymentIntentUpdate, + PaymentIntentUpdateFields as DieselPaymentIntentUpdateFields, +}; +#[cfg(all(feature = "v2", feature = "payment_v2"))] +impl From<PaymentIntentUpdate> for DieselPaymentIntentUpdate { + fn from(value: PaymentIntentUpdate) -> Self { + todo!() + // match value { + // PaymentIntentUpdate::ResponseUpdate { + // status, + // amount_captured, + // return_url, + // updated_by, + // } => Self::ResponseUpdate { + // status, + // amount_captured, + // return_url, + // updated_by, + // }, + // PaymentIntentUpdate::MetadataUpdate { + // metadata, + // updated_by, + // } => Self::MetadataUpdate { + // metadata, + // updated_by, + // }, + // PaymentIntentUpdate::Update(value) => { + // Self::Update(Box::new(DieselPaymentIntentUpdateFields { + // amount: value.amount, + // currency: value.currency, + // setup_future_usage: value.setup_future_usage, + // status: value.status, + // customer_id: value.customer_id, + // return_url: value.return_url, + // description: value.description, + // statement_descriptor: value.statement_descriptor, + // order_details: value.order_details, + // metadata: value.metadata, + // payment_confirm_source: value.payment_confirm_source, + // updated_by: value.updated_by, + // session_expiry: value.session_expiry, + // request_external_three_ds_authentication: value + // .request_external_three_ds_authentication, + // frm_metadata: value.frm_metadata, + // customer_details: value.customer_details.map(Encryption::from), + // billing_address: value.billing_address.map(Encryption::from), + // shipping_address: value.shipping_address.map(Encryption::from), + // merchant_order_reference_id: value.merchant_order_reference_id, + // is_payment_processor_token_flow: value.is_payment_processor_token_flow, + // })) + // } + // PaymentIntentUpdate::PaymentCreateUpdate { + // return_url, + // status, + // customer_id, + // shipping_address, + // billing_address, + // customer_details, + // updated_by, + // } => Self::PaymentCreateUpdate { + // return_url, + // status, + // customer_id, + // shipping_address: shipping_address.map(Encryption::from), + // billing_address: billing_address.map(Encryption::from), + // customer_details: customer_details.map(Encryption::from), + // updated_by, + // }, + // PaymentIntentUpdate::MerchantStatusUpdate { + // status, + // shipping_address, + // billing_address, + // updated_by, + // } => Self::MerchantStatusUpdate { + // status, + // shipping_address: shipping_address.map(Encryption::from), + // billing_address: billing_address.map(Encryption::from), + // updated_by, + // }, + // PaymentIntentUpdate::PGStatusUpdate { status, updated_by } => { + // Self::PGStatusUpdate { status, updated_by } + // } + // PaymentIntentUpdate::PaymentAttemptAndAttemptCountUpdate { + // active_attempt_id, + // attempt_count, + // updated_by, + // } => Self::PaymentAttemptAndAttemptCountUpdate { + // active_attempt_id, + // attempt_count, + // updated_by, + // }, + // PaymentIntentUpdate::StatusAndAttemptUpdate { + // status, + // active_attempt_id, + // attempt_count, + // updated_by, + // } => Self::StatusAndAttemptUpdate { + // status, + // active_attempt_id, + // attempt_count, + // updated_by, + // }, + // PaymentIntentUpdate::ApproveUpdate { + // status, + // frm_merchant_decision, + // updated_by, + // } => Self::ApproveUpdate { + // status, + // frm_merchant_decision, + // updated_by, + // }, + // PaymentIntentUpdate::RejectUpdate { + // status, + // frm_merchant_decision, + // updated_by, + // } => Self::RejectUpdate { + // status, + // frm_merchant_decision, + // updated_by, + // }, + // PaymentIntentUpdate::SurchargeApplicableUpdate { + // surcharge_applicable, + // updated_by, + // } => Self::SurchargeApplicableUpdate { + // surcharge_applicable: Some(surcharge_applicable), + // updated_by, + // }, + // PaymentIntentUpdate::IncrementalAuthorizationAmountUpdate { amount } => { + // Self::IncrementalAuthorizationAmountUpdate { amount } + // } + // PaymentIntentUpdate::AuthorizationCountUpdate { + // authorization_count, + // } => Self::AuthorizationCountUpdate { + // authorization_count, + // }, + // PaymentIntentUpdate::CompleteAuthorizeUpdate { shipping_address } => { + // Self::CompleteAuthorizeUpdate { + // shipping_address: shipping_address.map(Encryption::from), + // } + // } + // PaymentIntentUpdate::ManualUpdate { status, updated_by } => { + // Self::ManualUpdate { status, updated_by } + // } + // } + } +} + #[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "payment_v2")))] impl From<PaymentIntentUpdate> for DieselPaymentIntentUpdate { fn from(value: PaymentIntentUpdate) -> Self { @@ -1236,70 +1130,72 @@ impl From<PaymentIntentUpdate> for DieselPaymentIntentUpdate { } } +// TODO: evaluate if we will be using the same update struct for v2 as well, uncomment this and make necessary changes if necessary #[cfg(all(feature = "v2", feature = "payment_v2"))] impl From<PaymentIntentUpdateInternal> for diesel_models::PaymentIntentUpdateInternal { fn from(value: PaymentIntentUpdateInternal) -> Self { - let modified_at = common_utils::date_time::now(); - let PaymentIntentUpdateInternal { - amount, - currency, - status, - amount_captured, - customer_id, - return_url, - setup_future_usage, - off_session, - metadata, - modified_at: _, - active_attempt_id, - description, - statement_descriptor_name, - order_details, - attempt_count, - frm_merchant_decision, - payment_confirm_source, - updated_by, - surcharge_applicable, - authorization_count, - session_expiry, - request_external_three_ds_authentication, - frm_metadata, - customer_details, - billing_address, - merchant_order_reference_id, - shipping_address, - is_payment_processor_token_flow, - } = value; - Self { - amount, - currency, - status, - amount_captured, - customer_id, - return_url, - setup_future_usage, - off_session, - metadata, - modified_at, - active_attempt_id, - description, - statement_descriptor_name, - order_details, - attempt_count, - frm_merchant_decision, - payment_confirm_source, - updated_by, - surcharge_applicable, - authorization_count, - session_expiry, - request_external_three_ds_authentication, - frm_metadata, - customer_details: customer_details.map(Encryption::from), - billing_address: billing_address.map(Encryption::from), - merchant_order_reference_id, - shipping_address: shipping_address.map(Encryption::from), - is_payment_processor_token_flow, - } + todo!() + // let modified_at = common_utils::date_time::now(); + // let PaymentIntentUpdateInternal { + // amount, + // currency, + // status, + // amount_captured, + // customer_id, + // return_url, + // setup_future_usage, + // off_session, + // metadata, + // modified_at: _, + // active_attempt_id, + // description, + // statement_descriptor, + // order_details, + // attempt_count, + // frm_merchant_decision, + // payment_confirm_source, + // updated_by, + // surcharge_applicable, + // authorization_count, + // session_expiry, + // request_external_three_ds_authentication, + // frm_metadata, + // customer_details, + // billing_address, + // merchant_order_reference_id, + // shipping_address, + // is_payment_processor_token_flow, + // } = value; + // Self { + // amount, + // currency, + // status, + // amount_captured, + // customer_id, + // return_url, + // setup_future_usage, + // off_session, + // metadata, + // modified_at, + // active_attempt_id, + // description, + // statement_descriptor, + // order_details, + // attempt_count, + // frm_merchant_decision, + // payment_confirm_source, + // updated_by, + // surcharge_applicable, + // authorization_count, + // session_expiry, + // request_external_three_ds_authentication, + // frm_metadata, + // customer_details: customer_details.map(Encryption::from), + // billing_address: billing_address.map(Encryption::from), + // merchant_order_reference_id, + // shipping_address: shipping_address.map(Encryption::from), + // is_payment_processor_token_flow, + // } } } @@ -1585,64 +1481,111 @@ impl behaviour::Conversion for PaymentIntent { type NewDstType = DieselPaymentIntentNew; async fn convert(self) -> CustomResult<Self::DstType, ValidationError> { + let PaymentIntent { + merchant_id, + amount_details, + status, + amount_captured, + customer_id, + description, + return_url, + metadata, + statement_descriptor, + created_at, + modified_at, + last_synced, + setup_future_usage, + client_secret, + active_attempt, + order_details, + allowed_payment_method_types, + connector_metadata, + feature_metadata, + attempt_count, + profile_id, + payment_link_id, + frm_merchant_decision, + updated_by, + request_incremental_authorization, + authorization_count, + session_expiry, + request_external_three_ds_authentication, + frm_metadata, + customer_details, + merchant_reference_id, + billing_address, + shipping_address, + capture_method, + id, + authentication_type, + prerouting_algorithm, + organization_id, + enable_payment_link, + apply_mit_exemption, + customer_present, + routing_algorithm_id, + payment_link_config, + } = self; Ok(DieselPaymentIntent { - merchant_id: self.merchant_id, - status: self.status, - amount: self.amount, - currency: self.currency, - amount_captured: self.amount_captured, - customer_id: self.customer_id, - description: self.description, - return_url: self.return_url, - metadata: self.metadata, - statement_descriptor_name: self.statement_descriptor_name, - created_at: self.created_at, - modified_at: self.modified_at, - last_synced: self.last_synced, - setup_future_usage: self.setup_future_usage, - off_session: self.off_session, - client_secret: self.client_secret, - active_attempt_id: self.active_attempt.get_id(), - order_details: self.order_details, - allowed_payment_method_types: self.allowed_payment_method_types, - connector_metadata: self.connector_metadata, - feature_metadata: self.feature_metadata, - attempt_count: self.attempt_count, - profile_id: self.profile_id, - frm_merchant_decision: self.frm_merchant_decision, - payment_link_id: self.payment_link_id, - payment_confirm_source: self.payment_confirm_source, - updated_by: self.updated_by, - surcharge_applicable: self.surcharge_applicable, - request_incremental_authorization: self.request_incremental_authorization, - authorization_count: self.authorization_count, - session_expiry: self.session_expiry, - request_external_three_ds_authentication: self.request_external_three_ds_authentication, - charges: self.charges, - frm_metadata: self.frm_metadata, - customer_details: self.customer_details.map(Encryption::from), - billing_address: self.billing_address.map(Encryption::from), - merchant_order_reference_id: self.merchant_order_reference_id, - shipping_address: self.shipping_address.map(Encryption::from), - is_payment_processor_token_flow: self.is_payment_processor_token_flow, - capture_method: self.capture_method, - id: self.id, - authentication_type: self.authentication_type, - amount_to_capture: self.amount_to_capture, - prerouting_algorithm: self.prerouting_algorithm, - merchant_reference_id: self.merchant_reference_id, - surcharge_amount: self.surcharge_amount, - tax_on_surcharge: self.tax_on_surcharge, - organization_id: self.organization_id, - shipping_cost: self.shipping_cost, - tax_details: self.tax_details, - skip_external_tax_calculation: self.skip_external_tax_calculation, + skip_external_tax_calculation: Some(amount_details.get_external_tax_action_as_bool()), + surcharge_applicable: Some(amount_details.get_surcharge_action_as_bool()), + merchant_id, + status, + amount: amount_details.order_amount, + currency: amount_details.currency, + amount_captured, + customer_id, + description, + return_url, + metadata, + statement_descriptor, + created_at, + modified_at, + last_synced, + setup_future_usage, + client_secret, + active_attempt_id: active_attempt.get_id(), + order_details, + allowed_payment_method_types, + connector_metadata, + feature_metadata, + attempt_count, + profile_id, + frm_merchant_decision, + payment_link_id, + updated_by, + + request_incremental_authorization, + authorization_count, + session_expiry, + request_external_three_ds_authentication: Some( + request_external_three_ds_authentication.as_bool(), + ), + frm_metadata, + customer_details: customer_details.map(Encryption::from), + billing_address: billing_address.map(Encryption::from), + shipping_address: shipping_address.map(Encryption::from), + capture_method, + id, + authentication_type, + prerouting_algorithm, + merchant_reference_id, + surcharge_amount: amount_details.surcharge_amount, + tax_on_surcharge: amount_details.tax_on_surcharge, + organization_id, + shipping_cost: amount_details.shipping_cost, + tax_details: amount_details.tax_details, + enable_payment_link: Some(enable_payment_link.as_bool()), + apply_mit_exemption: Some(apply_mit_exemption.as_bool()), + customer_present: Some(customer_present.as_bool()), + payment_link_config, + routing_algorithm_id, }) } async fn convert_back( state: &KeyManagerState, storage_model: Self::DstType, - key: &Secret<Vec<u8>>, + key: &masking::Secret<Vec<u8>>, key_manager_identifier: keymanager::Identifier, ) -> CustomResult<Self, ValidationError> where @@ -1660,22 +1603,36 @@ impl behaviour::Conversion for PaymentIntent { .await .and_then(|val| val.try_into_optionaloperation()) }; + + let amount_details = super::AmountDetails { + order_amount: storage_model.amount, + currency: storage_model.currency, + surcharge_amount: storage_model.surcharge_amount, + tax_on_surcharge: storage_model.tax_on_surcharge, + shipping_cost: storage_model.shipping_cost, + tax_details: storage_model.tax_details, + skip_external_tax_calculation: super::TaxCalculationOverride::from( + storage_model.skip_external_tax_calculation, + ), + skip_surcharge_calculation: super::SurchargeCalculationOverride::from( + storage_model.surcharge_applicable, + ), + }; + Ok::<Self, error_stack::Report<common_utils::errors::CryptoError>>(Self { merchant_id: storage_model.merchant_id, status: storage_model.status, - amount: storage_model.amount, - currency: storage_model.currency, + amount_details, amount_captured: storage_model.amount_captured, customer_id: storage_model.customer_id, description: storage_model.description, return_url: storage_model.return_url, metadata: storage_model.metadata, - statement_descriptor_name: storage_model.statement_descriptor_name, + statement_descriptor: storage_model.statement_descriptor, created_at: storage_model.created_at, modified_at: storage_model.modified_at, last_synced: storage_model.last_synced, setup_future_usage: storage_model.setup_future_usage, - off_session: storage_model.off_session, client_secret: storage_model.client_secret, active_attempt: RemoteStorageObject::ForeignID(storage_model.active_attempt_id), order_details: storage_model.order_details, @@ -1686,15 +1643,14 @@ impl behaviour::Conversion for PaymentIntent { profile_id: storage_model.profile_id, frm_merchant_decision: storage_model.frm_merchant_decision, payment_link_id: storage_model.payment_link_id, - payment_confirm_source: storage_model.payment_confirm_source, updated_by: storage_model.updated_by, - surcharge_applicable: storage_model.surcharge_applicable, request_incremental_authorization: storage_model.request_incremental_authorization, authorization_count: storage_model.authorization_count, session_expiry: storage_model.session_expiry, - request_external_three_ds_authentication: storage_model - .request_external_three_ds_authentication, - charges: storage_model.charges, + request_external_three_ds_authentication: + common_enums::External3dsAuthenticationRequest::from( + storage_model.request_external_three_ds_authentication, + ), frm_metadata: storage_model.frm_metadata, customer_details: storage_model .customer_details @@ -1704,24 +1660,27 @@ impl behaviour::Conversion for PaymentIntent { .billing_address .async_lift(inner_decrypt) .await?, - merchant_order_reference_id: storage_model.merchant_order_reference_id, shipping_address: storage_model .shipping_address .async_lift(inner_decrypt) .await?, - is_payment_processor_token_flow: storage_model.is_payment_processor_token_flow, capture_method: storage_model.capture_method, id: storage_model.id, merchant_reference_id: storage_model.merchant_reference_id, organization_id: storage_model.organization_id, authentication_type: storage_model.authentication_type, - amount_to_capture: storage_model.amount_to_capture, prerouting_algorithm: storage_model.prerouting_algorithm, - surcharge_amount: storage_model.surcharge_amount, - tax_on_surcharge: storage_model.tax_on_surcharge, - shipping_cost: storage_model.shipping_cost, - tax_details: storage_model.tax_details, - skip_external_tax_calculation: storage_model.skip_external_tax_calculation, + enable_payment_link: common_enums::EnablePaymentLinkRequest::from( + storage_model.enable_payment_link, + ), + apply_mit_exemption: common_enums::MitExemptionRequest::from( + storage_model.apply_mit_exemption, + ), + customer_present: common_enums::PresenceOfCustomerDuringPayment::from( + storage_model.customer_present, + ), + payment_link_config: storage_model.payment_link_config, + routing_algorithm_id: storage_model.routing_algorithm_id, }) } .await @@ -1731,22 +1690,25 @@ impl behaviour::Conversion for PaymentIntent { } async fn construct_new(self) -> CustomResult<Self::NewDstType, ValidationError> { + let amount_details = self.amount_details; + Ok(DieselPaymentIntentNew { + surcharge_applicable: Some(amount_details.get_surcharge_action_as_bool()), + skip_external_tax_calculation: Some(amount_details.get_external_tax_action_as_bool()), merchant_id: self.merchant_id, status: self.status, - amount: self.amount, - currency: self.currency, + amount: amount_details.order_amount, + currency: amount_details.currency, amount_captured: self.amount_captured, customer_id: self.customer_id, description: self.description, return_url: self.return_url, metadata: self.metadata, - statement_descriptor_name: self.statement_descriptor_name, + statement_descriptor: self.statement_descriptor, created_at: self.created_at, modified_at: self.modified_at, last_synced: self.last_synced, setup_future_usage: self.setup_future_usage, - off_session: self.off_session, client_secret: self.client_secret, active_attempt_id: self.active_attempt.get_id(), order_details: self.order_details, @@ -1757,32 +1719,30 @@ impl behaviour::Conversion for PaymentIntent { profile_id: self.profile_id, frm_merchant_decision: self.frm_merchant_decision, payment_link_id: self.payment_link_id, - payment_confirm_source: self.payment_confirm_source, updated_by: self.updated_by, - surcharge_applicable: self.surcharge_applicable, + request_incremental_authorization: self.request_incremental_authorization, authorization_count: self.authorization_count, session_expiry: self.session_expiry, - request_external_three_ds_authentication: self.request_external_three_ds_authentication, - charges: self.charges, + request_external_three_ds_authentication: Some( + self.request_external_three_ds_authentication.as_bool(), + ), frm_metadata: self.frm_metadata, customer_details: self.customer_details.map(Encryption::from), billing_address: self.billing_address.map(Encryption::from), - merchant_order_reference_id: self.merchant_order_reference_id, shipping_address: self.shipping_address.map(Encryption::from), - is_payment_processor_token_flow: self.is_payment_processor_token_flow, capture_method: self.capture_method, id: self.id, merchant_reference_id: self.merchant_reference_id, authentication_type: self.authentication_type, - amount_to_capture: self.amount_to_capture, prerouting_algorithm: self.prerouting_algorithm, - surcharge_amount: self.surcharge_amount, - tax_on_surcharge: self.tax_on_surcharge, + surcharge_amount: amount_details.surcharge_amount, + tax_on_surcharge: amount_details.tax_on_surcharge, organization_id: self.organization_id, - shipping_cost: self.shipping_cost, - tax_details: self.tax_details, - skip_external_tax_calculation: self.skip_external_tax_calculation, + shipping_cost: amount_details.shipping_cost, + tax_details: amount_details.tax_details, + enable_payment_link: Some(self.enable_payment_link.as_bool()), + apply_mit_exemption: Some(self.apply_mit_exemption.as_bool()), }) } } diff --git a/crates/router/src/core/customers.rs b/crates/router/src/core/customers.rs index a325f41404d..fc7d717d5f1 100644 --- a/crates/router/src/core/customers.rs +++ b/crates/router/src/core/customers.rs @@ -656,7 +656,7 @@ impl CustomerDeleteBridge for customers::GlobalId { name: Some(redacted_encrypted_value.clone()), email: Box::new(Some(redacted_encrypted_email)), phone: Box::new(Some(redacted_encrypted_value.clone())), - description: Some(Description::new(REDACTED.to_string())), + description: Some(Description::from_str_unchecked(REDACTED)), phone_country_code: Some(REDACTED.to_string()), metadata: None, connector_customer: None, @@ -898,7 +898,7 @@ impl CustomerDeleteBridge for customers::CustomerId { .switch()?, ), phone: Box::new(Some(redacted_encrypted_value.clone())), - description: Some(Description::new(REDACTED.to_string())), + description: Some(Description::from_str_unchecked(REDACTED)), phone_country_code: Some(REDACTED.to_string()), metadata: None, connector_customer: None, diff --git a/crates/router/src/core/fraud_check.rs b/crates/router/src/core/fraud_check.rs index 7e184b318da..c696c5072bf 100644 --- a/crates/router/src/core/fraud_check.rs +++ b/crates/router/src/core/fraud_check.rs @@ -47,6 +47,32 @@ pub mod flows; pub mod operation; pub mod types; +#[cfg(feature = "v2")] +#[instrument(skip_all)] +pub async fn call_frm_service<D: Clone, F, Req, OperationData>( + state: &SessionState, + payment_data: &OperationData, + frm_data: &mut FrmData, + merchant_account: &domain::MerchantAccount, + key_store: &domain::MerchantKeyStore, + customer: &Option<domain::Customer>, +) -> RouterResult<oss_types::RouterData<F, Req, frm_types::FraudCheckResponseData>> +where + F: Send + Clone, + + OperationData: payments::OperationSessionGetters<D> + Send + Sync + Clone, + + // To create connector flow specific interface data + FrmData: ConstructFlowSpecificData<F, Req, frm_types::FraudCheckResponseData>, + oss_types::RouterData<F, Req, frm_types::FraudCheckResponseData>: FeatureFrm<F, Req> + Send, + + // To construct connector flow specific api + dyn Connector: services::api::ConnectorIntegration<F, Req, frm_types::FraudCheckResponseData>, +{ + todo!() +} + +#[cfg(feature = "v1")] #[instrument(skip_all)] pub async fn call_frm_service<D: Clone, F, Req, OperationData>( state: &SessionState, @@ -350,6 +376,30 @@ where } } +#[cfg(feature = "v2")] +#[allow(clippy::too_many_arguments)] +pub async fn make_frm_data_and_fraud_check_operation<'a, F, D>( + _db: &dyn StorageInterface, + state: &SessionState, + merchant_account: &domain::MerchantAccount, + payment_data: D, + frm_routing_algorithm: FrmRoutingAlgorithm, + profile_id: common_utils::id_type::ProfileId, + frm_configs: FrmConfigsObject, + _customer: &Option<domain::Customer>, +) -> RouterResult<FrmInfo<F, D>> +where + F: Send + Clone, + D: payments::OperationSessionGetters<F> + + payments::OperationSessionSetters<F> + + Send + + Sync + + Clone, +{ + todo!() +} + +#[cfg(feature = "v1")] #[allow(clippy::too_many_arguments)] pub async fn make_frm_data_and_fraud_check_operation<'a, F, D>( _db: &dyn StorageInterface, diff --git a/crates/router/src/core/fraud_check/flows/fulfillment_flow.rs b/crates/router/src/core/fraud_check/flows/fulfillment_flow.rs index f3eab2dd8d1..87ede498ab4 100644 --- a/crates/router/src/core/fraud_check/flows/fulfillment_flow.rs +++ b/crates/router/src/core/fraud_check/flows/fulfillment_flow.rs @@ -16,6 +16,20 @@ use crate::{ utils, SessionState, }; +#[cfg(feature = "v2")] +pub async fn construct_fulfillment_router_data<'a>( + _state: &'a SessionState, + _payment_intent: &'a storage::PaymentIntent, + _payment_attempt: &storage::PaymentAttempt, + _merchant_account: &domain::MerchantAccount, + _key_store: &domain::MerchantKeyStore, + _connector: String, + _fulfillment_request: FrmFulfillmentRequest, +) -> RouterResult<FrmFulfillmentRouterData> { + todo!() +} + +#[cfg(feature = "v1")] #[instrument(skip_all)] pub async fn construct_fulfillment_router_data<'a>( state: &'a SessionState, diff --git a/crates/router/src/core/fraud_check/operation/fraud_check_post.rs b/crates/router/src/core/fraud_check/operation/fraud_check_post.rs index 1a8bc1b5540..65079f633df 100644 --- a/crates/router/src/core/fraud_check/operation/fraud_check_post.rs +++ b/crates/router/src/core/fraud_check/operation/fraud_check_post.rs @@ -85,6 +85,17 @@ where #[async_trait] impl GetTracker<PaymentToFrmData> for FraudCheckPost { + #[cfg(feature = "v2")] + async fn get_trackers<'a>( + &'a self, + state: &'a SessionState, + payment_data: PaymentToFrmData, + frm_connector_details: ConnectorDetailsCore, + ) -> RouterResult<Option<FrmData>> { + todo!() + } + + #[cfg(feature = "v1")] #[instrument(skip_all)] async fn get_trackers<'a>( &'a self, diff --git a/crates/router/src/core/fraud_check/operation/fraud_check_pre.rs b/crates/router/src/core/fraud_check/operation/fraud_check_pre.rs index 666028e5dfd..59a703d2b3c 100644 --- a/crates/router/src/core/fraud_check/operation/fraud_check_pre.rs +++ b/crates/router/src/core/fraud_check/operation/fraud_check_pre.rs @@ -71,6 +71,18 @@ where #[async_trait] impl GetTracker<PaymentToFrmData> for FraudCheckPre { + #[cfg(feature = "v2")] + #[instrument(skip_all)] + async fn get_trackers<'a>( + &'a self, + state: &'a SessionState, + payment_data: PaymentToFrmData, + frm_connector_details: ConnectorDetailsCore, + ) -> RouterResult<Option<FrmData>> { + todo!() + } + + #[cfg(feature = "v1")] #[instrument(skip_all)] async fn get_trackers<'a>( &'a self, diff --git a/crates/router/src/core/payment_methods.rs b/crates/router/src/core/payment_methods.rs index 8e3d2799fd4..e51771a2807 100644 --- a/crates/router/src/core/payment_methods.rs +++ b/crates/router/src/core/payment_methods.rs @@ -1317,10 +1317,12 @@ async fn get_pm_list_context( hyperswitch_token_data: is_payment_associated.then_some( storage::PaymentTokenData::permanent_card( Some(pm.get_id().clone()), - pm.locker_id.clone().or(Some(pm.get_id().get_string_repr())), pm.locker_id .clone() - .unwrap_or(pm.get_id().get_string_repr()), + .or(Some(pm.get_id().get_string_repr().to_owned())), + pm.locker_id + .clone() + .unwrap_or(pm.get_id().get_string_repr().to_owned()), ), ), }) @@ -1628,7 +1630,7 @@ async fn generate_saved_pm_response( let pma = api::CustomerPaymentMethod { payment_token: parent_payment_method_token.clone(), - payment_method_id: pm.get_id().get_string_repr(), + payment_method_id: pm.get_id().get_string_repr().to_owned(), customer_id: pm.customer_id.to_owned(), payment_method, payment_method_type: pm.payment_method_type, @@ -1642,7 +1644,7 @@ async fn generate_saved_pm_response( && !(off_session_payment_flag && pm.connector_mandate_details.is_some()), last_used_at: Some(pm.last_used_at), is_default: customer.default_payment_method_id.is_some() - && customer.default_payment_method_id.as_ref() == Some(&pm.get_id().get_string_repr()), + && customer.default_payment_method_id.as_deref() == Some(pm.get_id().get_string_repr()), billing: payment_method_billing, }; @@ -1685,19 +1687,13 @@ impl pm_types::SavedPMLPaymentsInfo { Some(common_enums::FutureUsage::OffSession) ); - let profile_id = payment_intent - .profile_id - .as_ref() - .get_required_value("profile_id") - .change_context(errors::ApiErrorResponse::InternalServerError) - .attach_printable("profile_id is not set in payment_intent")? - .clone(); + let profile_id = &payment_intent.profile_id; let business_profile = core_utils::validate_and_get_business_profile( db, key_manager_state, key_store, - Some(profile_id).as_ref(), + Some(profile_id), merchant_account.get_id(), ) .await?; diff --git a/crates/router/src/core/payment_methods/cards.rs b/crates/router/src/core/payment_methods/cards.rs index efc9621d26d..6e3d89195d2 100644 --- a/crates/router/src/core/payment_methods/cards.rs +++ b/crates/router/src/core/payment_methods/cards.rs @@ -3341,6 +3341,7 @@ pub async fn list_payment_methods( billing_address_for_calculating_required_fields, customer.as_ref(), ))?; + let req_val = serde_json::to_value(req).ok(); logger::debug!(filtered_payment_methods=?response); diff --git a/crates/router/src/core/payment_methods/transformers.rs b/crates/router/src/core/payment_methods/transformers.rs index d0f63a2dc04..6583d109d57 100644 --- a/crates/router/src/core/payment_methods/transformers.rs +++ b/crates/router/src/core/payment_methods/transformers.rs @@ -546,7 +546,7 @@ pub fn generate_payment_method_response( let resp = api::PaymentMethodResponse { merchant_id: pm.merchant_id.to_owned(), customer_id: pm.customer_id.to_owned(), - payment_method_id: pm.id.get_string_repr(), + payment_method_id: pm.id.get_string_repr().to_owned(), payment_method: pm.payment_method, payment_method_type: pm.payment_method_type, metadata: pm.metadata.clone(), diff --git a/crates/router/src/core/payments.rs b/crates/router/src/core/payments.rs index 3a55bf77771..744b93032bf 100644 --- a/crates/router/src/core/payments.rs +++ b/crates/router/src/core/payments.rs @@ -608,6 +608,7 @@ where let cloned_payment_data = payment_data.clone(); let cloned_customer = customer.clone(); + #[cfg(feature = "v1")] operation .to_domain()? .store_extended_card_info_temporarily( @@ -704,6 +705,19 @@ where todo!() } +#[cfg(feature = "v2")] +#[instrument(skip_all)] +async fn populate_surcharge_details<F>( + state: &SessionState, + payment_data: &mut PaymentData<F>, +) -> RouterResult<()> +where + F: Send + Clone, +{ + todo!() +} + +#[cfg(feature = "v1")] #[instrument(skip_all)] async fn populate_surcharge_details<F>( state: &SessionState, @@ -1597,6 +1611,7 @@ where ) .await?; + #[cfg(feature = "v1")] let merchant_recipient_data = if let Some(true) = payment_data .get_payment_intent() .is_payment_processor_token_flow @@ -1614,6 +1629,10 @@ where .await? }; + // TODO: handle how we read `is_processor_token_flow` in v2 and then call `get_merchant_recipient_data` + #[cfg(feature = "v2")] + let merchant_recipient_data = None; + let mut router_data = payment_data .construct_router_data( state, @@ -2357,6 +2376,7 @@ where F: Clone, D: OperationSessionGetters<F> + Send + Sync + Clone, { + #[cfg(feature = "v1")] let profile_id = payment_data .get_payment_intent() .profile_id @@ -2366,6 +2386,9 @@ where .attach_printable("profile_id is not set in payment_intent")? .clone(); + #[cfg(feature = "v2")] + let profile_id = payment_data.get_payment_intent().profile_id.clone(); + let merchant_connector_account = helpers::get_merchant_connector_account( state, merchant_account.get_id(), @@ -2735,6 +2758,24 @@ where Ok(payment_data_and_tokenization_action) } +#[cfg(feature = "v2")] +pub async fn tokenize_in_router_when_confirm_false_or_external_authentication<F, Req, D>( + state: &SessionState, + operation: &BoxedOperation<'_, F, Req, D>, + payment_data: &mut D, + validate_result: &operations::ValidateResult, + merchant_key_store: &domain::MerchantKeyStore, + customer: &Option<domain::Customer>, + business_profile: &domain::Profile, +) -> RouterResult<D> +where + F: Send + Clone, + D: OperationSessionGetters<F> + OperationSessionSetters<F> + Send + Sync + Clone, +{ + todo!() +} + +#[cfg(feature = "v1")] pub async fn tokenize_in_router_when_confirm_false_or_external_authentication<F, Req, D>( state: &SessionState, operation: &BoxedOperation<'_, F, Req, D>, @@ -3806,7 +3847,7 @@ where .await } -#[cfg(all(feature = "v2", feature = "payment_methods_v2"))] +#[cfg(feature = "v2")] pub async fn decide_multiplex_connector_for_normal_or_recurring_payment<F: Clone, D>( state: &SessionState, payment_data: &mut D, @@ -3821,10 +3862,7 @@ where todo!() } -#[cfg(all( - any(feature = "v2", feature = "v1"), - not(feature = "payment_methods_v2") -))] +#[cfg(feature = "v1")] #[allow(clippy::too_many_arguments)] pub async fn decide_multiplex_connector_for_normal_or_recurring_payment<F: Clone, D>( state: &SessionState, @@ -4956,6 +4994,7 @@ pub trait OperationSessionGetters<F> { fn get_authorizations(&self) -> Vec<diesel_models::authorization::Authorization>; fn get_attempts(&self) -> Option<Vec<storage::PaymentAttempt>>; fn get_recurring_details(&self) -> Option<&RecurringDetails>; + // TODO: this should be a mandatory field, should we throw an error instead of returning an Option? fn get_payment_intent_profile_id(&self) -> Option<&id_type::ProfileId>; fn get_currency(&self) -> storage_enums::Currency; fn get_amount(&self) -> api::Amount; @@ -5085,10 +5124,16 @@ impl<F: Clone> OperationSessionGetters<F> for PaymentData<F> { self.recurring_details.as_ref() } + #[cfg(feature = "v1")] fn get_payment_intent_profile_id(&self) -> Option<&id_type::ProfileId> { self.payment_intent.profile_id.as_ref() } + #[cfg(feature = "v2")] + fn get_payment_intent_profile_id(&self) -> Option<&id_type::ProfileId> { + Some(&self.payment_intent.profile_id) + } + fn get_currency(&self) -> storage_enums::Currency { self.currency } diff --git a/crates/router/src/core/payments/helpers.rs b/crates/router/src/core/payments/helpers.rs index ac6c236f536..eb512399233 100644 --- a/crates/router/src/core/payments/helpers.rs +++ b/crates/router/src/core/payments/helpers.rs @@ -1142,6 +1142,7 @@ pub fn validate_customer_id_mandatory_cases( } } +#[cfg(feature = "v1")] pub fn create_startpay_url( base_url: &str, payment_attempt: &PaymentAttempt, @@ -2287,6 +2288,20 @@ pub async fn store_in_vault_and_generate_ppmt( Ok(parent_payment_method_token) } +#[cfg(feature = "v2")] +pub async fn store_payment_method_data_in_vault( + state: &SessionState, + payment_attempt: &PaymentAttempt, + payment_intent: &PaymentIntent, + payment_method: enums::PaymentMethod, + payment_method_data: &domain::PaymentMethodData, + merchant_key_store: &domain::MerchantKeyStore, + business_profile: Option<&domain::Profile>, +) -> RouterResult<Option<String>> { + todo!() +} + +#[cfg(feature = "v1")] pub async fn store_payment_method_data_in_vault( state: &SessionState, payment_attempt: &PaymentAttempt, @@ -2997,6 +3012,7 @@ pub fn generate_mandate( } } +#[cfg(feature = "v1")] // A function to manually authenticate the client secret with intent fulfillment time pub fn authenticate_client_secret( request_client_secret: Option<&String>, @@ -3026,6 +3042,34 @@ pub fn authenticate_client_secret( } } +#[cfg(feature = "v2")] +// A function to manually authenticate the client secret with intent fulfillment time +pub fn authenticate_client_secret( + request_client_secret: Option<&common_utils::types::ClientSecret>, + payment_intent: &PaymentIntent, +) -> Result<(), errors::ApiErrorResponse> { + match (request_client_secret, &payment_intent.client_secret) { + (Some(req_cs), pi_cs) => { + if req_cs != pi_cs { + Err(errors::ApiErrorResponse::ClientSecretInvalid) + } else { + let current_timestamp = common_utils::date_time::now(); + + let session_expiry = payment_intent.session_expiry.unwrap_or( + payment_intent + .created_at + .saturating_add(time::Duration::seconds(consts::DEFAULT_SESSION_EXPIRY)), + ); + + fp_utils::when(current_timestamp > session_expiry, || { + Err(errors::ApiErrorResponse::ClientSecretExpired) + }) + } + } + _ => Ok(()), + } +} + pub(crate) fn validate_payment_status_against_allowed_statuses( intent_status: &storage_enums::IntentStatus, allowed_statuses: &[storage_enums::IntentStatus], @@ -3079,6 +3123,18 @@ pub(crate) fn validate_pm_or_token_given( ) } +#[cfg(feature = "v2")] +// A function to perform database lookup and then verify the client secret +pub async fn verify_payment_intent_time_and_client_secret( + state: &SessionState, + merchant_account: &domain::MerchantAccount, + key_store: &domain::MerchantKeyStore, + client_secret: Option<String>, +) -> error_stack::Result<Option<PaymentIntent>, errors::ApiErrorResponse> { + todo!() +} + +#[cfg(feature = "v1")] // A function to perform database lookup and then verify the client secret pub async fn verify_payment_intent_time_and_client_secret( state: &SessionState, @@ -3965,9 +4021,8 @@ impl AttemptType { storage_scheme, ) .await - .to_duplicate_response(errors::ApiErrorResponse::DuplicatePayment { - payment_id: fetched_payment_intent.get_id().to_owned(), - })?; + .to_duplicate_response(errors::ApiErrorResponse::InternalServerError) + .attach_printable("Failed to insert payment attempt")?; let updated_payment_intent = db .update_payment_intent( @@ -5341,6 +5396,7 @@ pub enum PaymentExternalAuthenticationFlow { }, } +#[cfg(feature = "v1")] pub async fn get_payment_external_authentication_flow_during_confirm<F: Clone>( state: &SessionState, key_store: &domain::MerchantKeyStore, diff --git a/crates/router/src/core/payments/operations/payment_response.rs b/crates/router/src/core/payments/operations/payment_response.rs index 09292224cae..e0324438b48 100644 --- a/crates/router/src/core/payments/operations/payment_response.rs +++ b/crates/router/src/core/payments/operations/payment_response.rs @@ -42,6 +42,7 @@ use crate::{ utils, }; +#[cfg(feature = "v1")] #[derive(Debug, Clone, Copy, router_derive::PaymentOperation)] #[operation( operations = "post_update_tracker", @@ -49,6 +50,11 @@ use crate::{ )] pub struct PaymentResponse; +#[cfg(feature = "v2")] +#[derive(Debug, Clone, Copy)] +pub struct PaymentResponse; + +#[cfg(feature = "v1")] #[async_trait] impl<F: Send + Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsAuthorizeData> for PaymentResponse @@ -304,6 +310,7 @@ impl<F: Send + Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsAuthor } } +#[cfg(feature = "v1")] #[async_trait] impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsIncrementalAuthorizationData> for PaymentResponse @@ -460,6 +467,7 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsIncrementalAu } } +#[cfg(feature = "v1")] #[async_trait] impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsSyncData> for PaymentResponse { async fn update_tracker<'b>( @@ -513,6 +521,7 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsSyncData> for } } +#[cfg(feature = "v1")] #[async_trait] impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsSessionData> for PaymentResponse @@ -545,6 +554,7 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsSessionData> } } +#[cfg(feature = "v1")] #[async_trait] impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::SdkPaymentsSessionUpdateData> for PaymentResponse @@ -618,6 +628,7 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::SdkPaymentsSessionUpd } } +#[cfg(feature = "v1")] #[async_trait] impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsCaptureData> for PaymentResponse @@ -650,6 +661,7 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsCaptureData> } } +#[cfg(feature = "v1")] #[async_trait] impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsCancelData> for PaymentResponse { async fn update_tracker<'b>( @@ -680,6 +692,7 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsCancelData> f } } +#[cfg(feature = "v1")] #[async_trait] impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsApproveData> for PaymentResponse @@ -712,6 +725,7 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsApproveData> } } +#[cfg(feature = "v1")] #[async_trait] impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsRejectData> for PaymentResponse { async fn update_tracker<'b>( @@ -742,6 +756,7 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsRejectData> f } } +#[cfg(feature = "v1")] #[async_trait] impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::SetupMandateRequestData> for PaymentResponse @@ -847,6 +862,7 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::SetupMandateRequestDa } } +#[cfg(feature = "v1")] #[async_trait] impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::CompleteAuthorizeData> for PaymentResponse diff --git a/crates/router/src/core/payments/retry.rs b/crates/router/src/core/payments/retry.rs index 64a85e3358d..ad643164f11 100644 --- a/crates/router/src/core/payments/retry.rs +++ b/crates/router/src/core/payments/retry.rs @@ -501,9 +501,8 @@ where let payment_attempt = db .insert_payment_attempt(new_payment_attempt, storage_scheme) .await - .to_duplicate_response(errors::ApiErrorResponse::DuplicatePayment { - payment_id: payment_data.get_payment_intent().get_id().to_owned(), - })?; + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("Error inserting payment attempt")?; #[cfg(all(feature = "v2", feature = "payment_v2"))] let payment_attempt = db @@ -514,9 +513,8 @@ where storage_scheme, ) .await - .to_duplicate_response(errors::ApiErrorResponse::DuplicatePayment { - payment_id: payment_data.get_payment_intent().get_id().to_owned(), - })?; + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("Error inserting payment attempt")?; // update payment_attempt, connector_response and payment_intent in payment_data payment_data.set_payment_attempt(payment_attempt); diff --git a/crates/router/src/core/payments/routing.rs b/crates/router/src/core/payments/routing.rs index a3123e91a14..1909fa25fb5 100644 --- a/crates/router/src/core/payments/routing.rs +++ b/crates/router/src/core/payments/routing.rs @@ -819,6 +819,8 @@ pub async fn perform_session_flow_routing( { let mut pm_type_map: FxHashMap<api_enums::PaymentMethodType, FxHashMap<String, api::GetToken>> = FxHashMap::default(); + + #[cfg(feature = "v1")] let profile_id = session_input .payment_intent .profile_id @@ -826,6 +828,9 @@ pub async fn perform_session_flow_routing( .get_required_value("profile_id") .change_context(errors::RoutingError::ProfileIdMissing)?; + #[cfg(feature = "v2")] + let profile_id = session_input.payment_intent.profile_id.clone(); + let business_profile = session_input .state .store @@ -885,28 +890,7 @@ pub async fn perform_session_flow_routing( }; #[cfg(feature = "v2")] - let payment_input = dsl_inputs::PaymentInput { - amount: session_input.payment_intent.amount, - currency: session_input - .payment_intent - .currency - .get_required_value("Currency") - .change_context(errors::RoutingError::DslMissingRequiredField { - field_name: "currency".to_string(), - })?, - authentication_type: session_input.payment_attempt.authentication_type, - card_bin: None, - capture_method: session_input - .payment_attempt - .capture_method - .and_then(|cm| cm.foreign_into()), - business_country: None, - business_label: None, - billing_country: session_input - .country - .map(storage_enums::Country::from_alpha2), - setup_future_usage: session_input.payment_intent.setup_future_usage, - }; + let payment_input = todo!(); let metadata = session_input .payment_intent @@ -1155,9 +1139,9 @@ async fn perform_session_routing_for_pm_type( #[cfg(feature = "v2")] pub fn make_dsl_input_for_surcharge( - payment_attempt: &oss_storage::PaymentAttempt, - payment_intent: &oss_storage::PaymentIntent, - billing_address: Option<Address>, + _payment_attempt: &oss_storage::PaymentAttempt, + _payment_intent: &oss_storage::PaymentIntent, + _billing_address: Option<Address>, ) -> RoutingResult<dsl_inputs::BackendInput> { todo!() } diff --git a/crates/router/src/core/payments/transformers.rs b/crates/router/src/core/payments/transformers.rs index 93fa3ed44b8..22c047edfcb 100644 --- a/crates/router/src/core/payments/transformers.rs +++ b/crates/router/src/core/payments/transformers.rs @@ -438,6 +438,7 @@ where } } +#[cfg(feature = "v1")] impl<F, Op, D> ToResponse<F, D, Op> for api::PaymentsSessionResponse where F: Clone, @@ -472,6 +473,7 @@ where } } +#[cfg(feature = "v1")] impl<F, Op, D> ToResponse<F, D, Op> for api::PaymentsDynamicTaxCalculationResponse where F: Clone, @@ -1899,6 +1901,16 @@ impl ConnectorTransactionId for Nexinets { } } +#[cfg(feature = "v2")] +impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsCaptureData { + type Error = error_stack::Report<errors::ApiErrorResponse>; + + fn try_from(additional_data: PaymentAdditionalData<'_, F>) -> Result<Self, Self::Error> { + todo!() + } +} + +#[cfg(feature = "v1")] impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsCaptureData { type Error = error_stack::Report<errors::ApiErrorResponse>; @@ -1952,6 +1964,16 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsCaptureD } } +#[cfg(feature = "v2")] +impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsCancelData { + type Error = error_stack::Report<errors::ApiErrorResponse>; + + fn try_from(additional_data: PaymentAdditionalData<'_, F>) -> Result<Self, Self::Error> { + todo!() + } +} + +#[cfg(feature = "v1")] impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsCancelData { type Error = error_stack::Report<errors::ApiErrorResponse>; @@ -2002,6 +2024,16 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsApproveD } } +#[cfg(feature = "v2")] +impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::SdkPaymentsSessionUpdateData { + type Error = error_stack::Report<errors::ApiErrorResponse>; + + fn try_from(additional_data: PaymentAdditionalData<'_, F>) -> Result<Self, Self::Error> { + todo!() + } +} + +#[cfg(feature = "v1")] impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::SdkPaymentsSessionUpdateData { type Error = error_stack::Report<errors::ApiErrorResponse>; diff --git a/crates/router/src/core/pm_auth.rs b/crates/router/src/core/pm_auth.rs index 2a93f8c215d..d6d4df67000 100644 --- a/crates/router/src/core/pm_auth.rs +++ b/crates/router/src/core/pm_auth.rs @@ -796,6 +796,18 @@ async fn get_selected_config_from_redis( Ok(selected_config) } +#[cfg(feature = "v2")] +pub async fn retrieve_payment_method_from_auth_service( + state: &SessionState, + key_store: &domain::MerchantKeyStore, + auth_token: &payment_methods::BankAccountTokenData, + payment_intent: &PaymentIntent, + _customer: &Option<domain::Customer>, +) -> RouterResult<Option<(domain::PaymentMethodData, enums::PaymentMethod)>> { + todo!() +} + +#[cfg(feature = "v1")] pub async fn retrieve_payment_method_from_auth_service( state: &SessionState, key_store: &domain::MerchantKeyStore, @@ -839,13 +851,6 @@ pub async fn retrieve_payment_method_from_auth_service( "error while fetching merchant_connector_account from merchant_id and connector name", )?; - #[cfg(feature = "v2")] - let mca = { - let _ = merchant_account; - let _ = connector; - todo!() - }; - let auth_type = pm_auth_helpers::get_connector_auth_type(mca)?; let BankAccountAccessCreds::AccessToken(access_token) = diff --git a/crates/router/src/core/utils.rs b/crates/router/src/core/utils.rs index 75630da14ce..53d97b43d9c 100644 --- a/crates/router/src/core/utils.rs +++ b/crates/router/src/core/utils.rs @@ -220,6 +220,25 @@ pub async fn construct_payout_router_data<'a, F>( Ok(router_data) } +#[cfg(feature = "v2")] +#[instrument(skip_all)] +#[allow(clippy::too_many_arguments)] +pub async fn construct_refund_router_data<'a, F>( + _state: &'a SessionState, + _connector_id: &str, + _merchant_account: &domain::MerchantAccount, + _key_store: &domain::MerchantKeyStore, + _money: (MinorUnit, enums::Currency), + _payment_intent: &'a storage::PaymentIntent, + _payment_attempt: &storage::PaymentAttempt, + _refund: &'a storage::Refund, + _creds_identifier: Option<String>, + _charges: Option<types::ChargeRefunds>, +) -> RouterResult<types::RefundsRouterData<F>> { + todo!() +} + +#[cfg(feature = "v1")] #[instrument(skip_all)] #[allow(clippy::too_many_arguments)] pub async fn construct_refund_router_data<'a, F>( @@ -588,6 +607,7 @@ pub fn validate_dispute_stage_and_dispute_status( ) } +#[cfg(feature = "v1")] #[instrument(skip_all)] pub async fn construct_accept_dispute_router_data<'a>( state: &'a SessionState, @@ -681,6 +701,7 @@ pub async fn construct_accept_dispute_router_data<'a>( Ok(router_data) } +#[cfg(feature = "v1")] #[instrument(skip_all)] pub async fn construct_submit_evidence_router_data<'a>( state: &'a SessionState, @@ -773,6 +794,7 @@ pub async fn construct_submit_evidence_router_data<'a>( Ok(router_data) } +#[cfg(feature = "v1")] #[instrument(skip_all)] #[allow(clippy::too_many_arguments)] pub async fn construct_upload_file_router_data<'a>( @@ -871,6 +893,18 @@ pub async fn construct_upload_file_router_data<'a>( Ok(router_data) } +#[cfg(feature = "v2")] +pub async fn construct_payments_dynamic_tax_calculation_router_data<'a, F: Clone>( + state: &'a SessionState, + merchant_account: &domain::MerchantAccount, + _key_store: &domain::MerchantKeyStore, + payment_data: &mut PaymentData<F>, + merchant_connector_account: &MerchantConnectorAccount, +) -> RouterResult<types::PaymentsTaxCalculationRouterData> { + todo!() +} + +#[cfg(feature = "v1")] pub async fn construct_payments_dynamic_tax_calculation_router_data<'a, F: Clone>( state: &'a SessionState, merchant_account: &domain::MerchantAccount, @@ -978,6 +1012,7 @@ pub async fn construct_payments_dynamic_tax_calculation_router_data<'a, F: Clone Ok(router_data) } +#[cfg(feature = "v1")] #[instrument(skip_all)] pub async fn construct_defend_dispute_router_data<'a>( state: &'a SessionState, @@ -1459,9 +1494,16 @@ impl GetProfileId for MerchantConnectorAccount { } impl GetProfileId for storage::PaymentIntent { + #[cfg(feature = "v1")] fn get_profile_id(&self) -> Option<&common_utils::id_type::ProfileId> { self.profile_id.as_ref() } + + // TODO: handle this in a better way for v2 + #[cfg(feature = "v2")] + fn get_profile_id(&self) -> Option<&common_utils::id_type::ProfileId> { + Some(&self.profile_id) + } } impl<A> GetProfileId for (storage::PaymentIntent, A) { diff --git a/crates/router/src/core/verification/utils.rs b/crates/router/src/core/verification/utils.rs index 787220651f1..8193109c250 100644 --- a/crates/router/src/core/verification/utils.rs +++ b/crates/router/src/core/verification/utils.rs @@ -130,13 +130,23 @@ pub fn log_applepay_verification_response_if_error( .map_err(|error| logger::error!(applepay_domain_verification_error= ?error)) }); } + +#[cfg(feature = "v2")] +pub async fn check_if_profile_id_is_present_in_payment_intent( + payment_id: PaymentId, + state: &SessionState, + auth_data: &AuthenticationData, +) -> CustomResult<(), errors::ApiErrorResponse> { + todo!() +} + +#[cfg(feature = "v1")] pub async fn check_if_profile_id_is_present_in_payment_intent( payment_id: PaymentId, state: &SessionState, auth_data: &AuthenticationData, ) -> CustomResult<(), errors::ApiErrorResponse> { let db = &*state.store; - #[cfg(feature = "v1")] let payment_intent = db .find_payment_intent_by_payment_id_merchant_id( &state.into(), @@ -148,15 +158,5 @@ pub async fn check_if_profile_id_is_present_in_payment_intent( .await .change_context(errors::ApiErrorResponse::Unauthorized)?; - #[cfg(feature = "v2")] - let payment_intent = db - .find_payment_intent_by_id( - &state.into(), - &payment_id, - &auth_data.key_store, - auth_data.merchant_account.storage_scheme, - ) - .await - .change_context(errors::ApiErrorResponse::Unauthorized)?; utils::validate_profile_id_from_auth_layer(auth_data.profile_id.clone(), &payment_intent) } diff --git a/crates/router/src/db/kafka_store.rs b/crates/router/src/db/kafka_store.rs index ff7e8145c33..21e00a7f549 100644 --- a/crates/router/src/db/kafka_store.rs +++ b/crates/router/src/db/kafka_store.rs @@ -1718,7 +1718,7 @@ impl PaymentIntentInterface for KafkaStore { async fn find_payment_intent_by_id( &self, state: &KeyManagerState, - payment_id: &id_type::PaymentId, + payment_id: &id_type::GlobalPaymentId, key_store: &domain::MerchantKeyStore, storage_scheme: MerchantStorageScheme, ) -> CustomResult<storage::PaymentIntent, errors::DataStorageError> { diff --git a/crates/router/src/services/kafka/payment_intent.rs b/crates/router/src/services/kafka/payment_intent.rs index cb5ec9cf2e3..82e33de8c60 100644 --- a/crates/router/src/services/kafka/payment_intent.rs +++ b/crates/router/src/services/kafka/payment_intent.rs @@ -51,13 +51,13 @@ pub struct KafkaPaymentIntent<'a> { pub merchant_id: &'a id_type::MerchantId, pub status: storage_enums::IntentStatus, pub amount: MinorUnit, - pub currency: Option<storage_enums::Currency>, + pub currency: storage_enums::Currency, pub amount_captured: Option<MinorUnit>, pub customer_id: Option<&'a id_type::CustomerId>, pub description: Option<&'a String>, pub return_url: Option<&'a String>, pub metadata: Option<String>, - pub statement_descriptor_name: Option<&'a String>, + pub statement_descriptor: Option<&'a String>, #[serde(with = "time::serde::timestamp")] pub created_at: OffsetDateTime, #[serde(with = "time::serde::timestamp")] @@ -69,7 +69,7 @@ pub struct KafkaPaymentIntent<'a> { pub client_secret: Option<&'a String>, pub active_attempt_id: String, pub attempt_count: i16, - pub profile_id: Option<&'a id_type::ProfileId>, + pub profile_id: &'a id_type::ProfileId, pub payment_confirm_source: Option<storage_enums::PaymentSource>, pub billing_details: Option<Encryptable<Secret<Value>>>, pub shipping_details: Option<Encryptable<Secret<Value>>>, @@ -128,42 +128,43 @@ impl<'a> KafkaPaymentIntent<'a> { #[cfg(feature = "v2")] impl<'a> KafkaPaymentIntent<'a> { pub fn from_storage(intent: &'a PaymentIntent) -> Self { - Self { - id: &intent.id, - merchant_id: &intent.merchant_id, - status: intent.status, - amount: intent.amount, - currency: intent.currency, - amount_captured: intent.amount_captured, - customer_id: intent.customer_id.as_ref(), - description: intent.description.as_ref(), - return_url: intent.return_url.as_ref(), - metadata: intent.metadata.as_ref().map(|x| x.to_string()), - statement_descriptor_name: intent.statement_descriptor_name.as_ref(), - created_at: intent.created_at.assume_utc(), - modified_at: intent.modified_at.assume_utc(), - last_synced: intent.last_synced.map(|i| i.assume_utc()), - setup_future_usage: intent.setup_future_usage, - off_session: intent.off_session, - client_secret: intent.client_secret.as_ref(), - active_attempt_id: intent.active_attempt.get_id(), - attempt_count: intent.attempt_count, - profile_id: intent.profile_id.as_ref(), - payment_confirm_source: intent.payment_confirm_source, - // TODO: use typed information here to avoid PII logging - billing_details: None, - shipping_details: None, - customer_email: intent - .customer_details - .as_ref() - .and_then(|value| value.get_inner().peek().as_object()) - .and_then(|obj| obj.get("email")) - .and_then(|email| email.as_str()) - .map(|email| HashedString::from(Secret::new(email.to_string()))), - feature_metadata: intent.feature_metadata.as_ref(), - merchant_order_reference_id: intent.merchant_order_reference_id.as_ref(), - organization_id: &intent.organization_id, - } + // Self { + // id: &intent.id, + // merchant_id: &intent.merchant_id, + // status: intent.status, + // amount: intent.amount, + // currency: intent.currency, + // amount_captured: intent.amount_captured, + // customer_id: intent.customer_id.as_ref(), + // description: intent.description.as_ref(), + // return_url: intent.return_url.as_ref(), + // metadata: intent.metadata.as_ref().map(|x| x.to_string()), + // statement_descriptor: intent.statement_descriptor.as_ref(), + // created_at: intent.created_at.assume_utc(), + // modified_at: intent.modified_at.assume_utc(), + // last_synced: intent.last_synced.map(|i| i.assume_utc()), + // setup_future_usage: intent.setup_future_usage, + // off_session: intent.off_session, + // client_secret: intent.client_secret.as_ref(), + // active_attempt_id: intent.active_attempt.get_id(), + // attempt_count: intent.attempt_count, + // profile_id: &intent.profile_id, + // payment_confirm_source: intent.payment_confirm_source, + // // TODO: use typed information here to avoid PII logging + // billing_details: None, + // shipping_details: None, + // customer_email: intent + // .customer_details + // .as_ref() + // .and_then(|value| value.get_inner().peek().as_object()) + // .and_then(|obj| obj.get("email")) + // .and_then(|email| email.as_str()) + // .map(|email| HashedString::from(Secret::new(email.to_string()))), + // feature_metadata: intent.feature_metadata.as_ref(), + // merchant_order_reference_id: intent.merchant_order_reference_id.as_ref(), + // organization_id: &intent.organization_id, + // } + todo!() } } diff --git a/crates/router/src/services/kafka/payment_intent_event.rs b/crates/router/src/services/kafka/payment_intent_event.rs index 321ce558103..5657846ca4c 100644 --- a/crates/router/src/services/kafka/payment_intent_event.rs +++ b/crates/router/src/services/kafka/payment_intent_event.rs @@ -53,13 +53,13 @@ pub struct KafkaPaymentIntentEvent<'a> { pub merchant_id: &'a id_type::MerchantId, pub status: storage_enums::IntentStatus, pub amount: MinorUnit, - pub currency: Option<storage_enums::Currency>, + pub currency: storage_enums::Currency, pub amount_captured: Option<MinorUnit>, pub customer_id: Option<&'a id_type::CustomerId>, pub description: Option<&'a String>, pub return_url: Option<&'a String>, pub metadata: Option<String>, - pub statement_descriptor_name: Option<&'a String>, + pub statement_descriptor: Option<&'a String>, #[serde(with = "time::serde::timestamp::milliseconds")] pub created_at: OffsetDateTime, #[serde(with = "time::serde::timestamp::milliseconds")] @@ -71,7 +71,7 @@ pub struct KafkaPaymentIntentEvent<'a> { pub client_secret: Option<&'a String>, pub active_attempt_id: String, pub attempt_count: i16, - pub profile_id: Option<&'a id_type::ProfileId>, + pub profile_id: &'a id_type::ProfileId, pub payment_confirm_source: Option<storage_enums::PaymentSource>, pub billing_details: Option<Encryptable<Secret<Value>>>, pub shipping_details: Option<Encryptable<Secret<Value>>>, @@ -142,42 +142,43 @@ impl<'a> KafkaPaymentIntentEvent<'a> { #[cfg(feature = "v2")] impl<'a> KafkaPaymentIntentEvent<'a> { pub fn from_storage(intent: &'a PaymentIntent) -> Self { - Self { - id: &intent.id, - merchant_id: &intent.merchant_id, - status: intent.status, - amount: intent.amount, - currency: intent.currency, - amount_captured: intent.amount_captured, - customer_id: intent.customer_id.as_ref(), - description: intent.description.as_ref(), - return_url: intent.return_url.as_ref(), - metadata: intent.metadata.as_ref().map(|x| x.to_string()), - statement_descriptor_name: intent.statement_descriptor_name.as_ref(), - created_at: intent.created_at.assume_utc(), - modified_at: intent.modified_at.assume_utc(), - last_synced: intent.last_synced.map(|i| i.assume_utc()), - setup_future_usage: intent.setup_future_usage, - off_session: intent.off_session, - client_secret: intent.client_secret.as_ref(), - active_attempt_id: intent.active_attempt.get_id(), - attempt_count: intent.attempt_count, - profile_id: intent.profile_id.as_ref(), - payment_confirm_source: intent.payment_confirm_source, - // TODO: use typed information here to avoid PII logging - billing_details: None, - shipping_details: None, - customer_email: intent - .customer_details - .as_ref() - .and_then(|value| value.get_inner().peek().as_object()) - .and_then(|obj| obj.get("email")) - .and_then(|email| email.as_str()) - .map(|email| HashedString::from(Secret::new(email.to_string()))), - feature_metadata: intent.feature_metadata.as_ref(), - merchant_order_reference_id: intent.merchant_order_reference_id.as_ref(), - organization_id: &intent.organization_id, - } + // Self { + // id: &intent.id, + // merchant_id: &intent.merchant_id, + // status: intent.status, + // amount: intent.amount, + // currency: intent.currency, + // amount_captured: intent.amount_captured, + // customer_id: intent.customer_id.as_ref(), + // description: intent.description.as_ref(), + // return_url: intent.return_url.as_ref(), + // metadata: intent.metadata.as_ref().map(|x| x.to_string()), + // statement_descriptor: intent.statement_descriptor.as_ref(), + // created_at: intent.created_at.assume_utc(), + // modified_at: intent.modified_at.assume_utc(), + // last_synced: intent.last_synced.map(|i| i.assume_utc()), + // setup_future_usage: intent.setup_future_usage, + // off_session: intent.off_session, + // client_secret: intent.client_secret.as_ref(), + // active_attempt_id: intent.active_attempt.get_id(), + // attempt_count: intent.attempt_count, + // profile_id: &intent.profile_id, + // payment_confirm_source: intent.payment_confirm_source, + // // TODO: use typed information here to avoid PII logging + // billing_details: None, + // shipping_details: None, + // customer_email: intent + // .customer_details + // .as_ref() + // .and_then(|value| value.get_inner().peek().as_object()) + // .and_then(|obj| obj.get("email")) + // .and_then(|email| email.as_str()) + // .map(|email| HashedString::from(Secret::new(email.to_string()))), + // feature_metadata: intent.feature_metadata.as_ref(), + // merchant_order_reference_id: intent.merchant_order_reference_id.as_ref(), + // organization_id: &intent.organization_id, + // } + todo!() } } diff --git a/crates/router/src/types/storage.rs b/crates/router/src/types/storage.rs index 96656423897..13a5291062c 100644 --- a/crates/router/src/types/storage.rs +++ b/crates/router/src/types/storage.rs @@ -48,7 +48,7 @@ pub use diesel_models::{ }; pub use hyperswitch_domain_models::payments::{ payment_attempt::{PaymentAttempt, PaymentAttemptNew, PaymentAttemptUpdate}, - payment_intent::{PaymentIntentNew, PaymentIntentUpdate, PaymentIntentUpdateFields}, + payment_intent::{PaymentIntentUpdate, PaymentIntentUpdateFields}, PaymentIntent, }; #[cfg(feature = "payouts")] diff --git a/crates/router/src/utils.rs b/crates/router/src/utils.rs index edeb3f12fa7..e6f549f4fc4 100644 --- a/crates/router/src/utils.rs +++ b/crates/router/src/utils.rs @@ -370,6 +370,7 @@ pub async fn find_mca_from_authentication_id_type( } } +#[cfg(feature = "v1")] pub async fn get_mca_from_payment_intent( state: &SessionState, merchant_account: &domain::MerchantAccount, diff --git a/crates/storage_impl/src/lib.rs b/crates/storage_impl/src/lib.rs index cadb78944ee..974de5be802 100644 --- a/crates/storage_impl/src/lib.rs +++ b/crates/storage_impl/src/lib.rs @@ -332,12 +332,9 @@ impl UniqueConstraints for diesel_models::Address { #[cfg(all(feature = "v2", feature = "payment_v2"))] impl UniqueConstraints for diesel_models::PaymentIntent { fn unique_constraints(&self) -> Vec<String> { - vec![format!( - "pi_{}_{}", - self.merchant_id.get_string_repr(), - self.merchant_reference_id - )] + vec![self.id.get_string_repr().to_owned()] } + fn table_name(&self) -> &str { "PaymentIntent" } @@ -345,6 +342,7 @@ impl UniqueConstraints for diesel_models::PaymentIntent { #[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "payment_v2")))] impl UniqueConstraints for diesel_models::PaymentIntent { + #[cfg(feature = "v1")] fn unique_constraints(&self) -> Vec<String> { vec![format!( "pi_{}_{}", @@ -352,6 +350,12 @@ impl UniqueConstraints for diesel_models::PaymentIntent { self.payment_id.get_string_repr() )] } + + #[cfg(feature = "v2")] + fn unique_constraints(&self) -> Vec<String> { + vec![format!("pi_{}", self.id.get_string_repr())] + } + fn table_name(&self) -> &str { "PaymentIntent" } @@ -437,7 +441,7 @@ impl UniqueConstraints for diesel_models::PaymentMethod { #[cfg(all(feature = "v2", feature = "payment_methods_v2"))] impl UniqueConstraints for diesel_models::PaymentMethod { fn unique_constraints(&self) -> Vec<String> { - vec![self.id.get_string_repr()] + vec![self.id.get_string_repr().to_owned()] } fn table_name(&self) -> &str { "PaymentMethod" diff --git a/crates/storage_impl/src/mock_db/payment_intent.rs b/crates/storage_impl/src/mock_db/payment_intent.rs index e0328871e33..0f1161f644b 100644 --- a/crates/storage_impl/src/mock_db/payment_intent.rs +++ b/crates/storage_impl/src/mock_db/payment_intent.rs @@ -167,7 +167,7 @@ impl PaymentIntentInterface for MockDb { async fn find_payment_intent_by_id( &self, _state: &KeyManagerState, - id: &common_utils::id_type::PaymentId, + id: &common_utils::id_type::GlobalPaymentId, _merchant_key_store: &MerchantKeyStore, _storage_scheme: storage_enums::MerchantStorageScheme, ) -> error_stack::Result<PaymentIntent, StorageError> { diff --git a/crates/storage_impl/src/payments/payment_intent.rs b/crates/storage_impl/src/payments/payment_intent.rs index 97fa5873cae..971c5edfcdb 100644 --- a/crates/storage_impl/src/payments/payment_intent.rs +++ b/crates/storage_impl/src/payments/payment_intent.rs @@ -65,6 +65,7 @@ use crate::{ #[async_trait::async_trait] impl<T: DatabaseStore> PaymentIntentInterface for KVRouterStore<T> { + #[cfg(feature = "v1")] async fn insert_payment_intent( &self, state: &KeyManagerState, @@ -142,6 +143,33 @@ impl<T: DatabaseStore> PaymentIntentInterface for KVRouterStore<T> { } } + #[cfg(feature = "v2")] + async fn insert_payment_intent( + &self, + state: &KeyManagerState, + payment_intent: PaymentIntent, + merchant_key_store: &MerchantKeyStore, + storage_scheme: MerchantStorageScheme, + ) -> error_stack::Result<PaymentIntent, StorageError> { + match storage_scheme { + MerchantStorageScheme::PostgresOnly => { + self.router_store + .insert_payment_intent( + state, + payment_intent, + merchant_key_store, + storage_scheme, + ) + .await + } + + MerchantStorageScheme::RedisKv => { + todo!("Implement payment intent insert for kv") + } + } + } + + #[cfg(feature = "v1")] #[instrument(skip_all)] async fn update_payment_intent( &self, @@ -229,6 +257,34 @@ impl<T: DatabaseStore> PaymentIntentInterface for KVRouterStore<T> { } } + #[cfg(feature = "v2")] + #[instrument(skip_all)] + async fn update_payment_intent( + &self, + state: &KeyManagerState, + this: PaymentIntent, + payment_intent_update: PaymentIntentUpdate, + merchant_key_store: &MerchantKeyStore, + storage_scheme: MerchantStorageScheme, + ) -> error_stack::Result<PaymentIntent, StorageError> { + match storage_scheme { + MerchantStorageScheme::PostgresOnly => { + self.router_store + .update_payment_intent( + state, + this, + payment_intent_update, + merchant_key_store, + storage_scheme, + ) + .await + } + MerchantStorageScheme::RedisKv => { + todo!() + } + } + } + #[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "payment_v2")))] #[instrument(skip_all)] async fn find_payment_intent_by_payment_id_merchant_id( @@ -294,11 +350,14 @@ impl<T: DatabaseStore> PaymentIntentInterface for KVRouterStore<T> { async fn find_payment_intent_by_id( &self, state: &KeyManagerState, - id: &common_utils::id_type::PaymentId, + id: &common_utils::id_type::GlobalPaymentId, merchant_key_store: &MerchantKeyStore, _storage_scheme: MerchantStorageScheme, ) -> error_stack::Result<PaymentIntent, StorageError> { - let conn = pg_connection_read(self).await?; + let conn: bb8::PooledConnection< + '_, + async_bb8_diesel::ConnectionManager<diesel::PgConnection>, + > = pg_connection_read(self).await?; let diesel_payment_intent = DieselPaymentIntent::find_by_global_id(&conn, id) .await .map_err(|er| { @@ -555,7 +614,7 @@ impl<T: DatabaseStore> PaymentIntentInterface for crate::RouterStore<T> { async fn find_payment_intent_by_id( &self, state: &KeyManagerState, - id: &common_utils::id_type::PaymentId, + id: &common_utils::id_type::GlobalPaymentId, merchant_key_store: &MerchantKeyStore, _storage_scheme: MerchantStorageScheme, ) -> error_stack::Result<PaymentIntent, StorageError> { diff --git a/v2_migrations/2024-08-28-081721_add_v2_columns/down.sql b/v2_migrations/2024-08-28-081721_add_v2_columns/down.sql index 427dbcb4d5f..de4886b866f 100644 --- a/v2_migrations/2024-08-28-081721_add_v2_columns/down.sql +++ b/v2_migrations/2024-08-28-081721_add_v2_columns/down.sql @@ -24,4 +24,10 @@ ALTER TABLE payment_intent DROP COLUMN merchant_reference_id, DROP COLUMN prerouting_algorithm, DROP COLUMN surcharge_amount, DROP COLUMN tax_on_surcharge, - DROP COLUMN frm_merchant_decision; + DROP COLUMN frm_merchant_decision, + DROP COLUMN statement_descriptor, + DROP COLUMN enable_payment_link, + DROP COLUMN apply_mit_exemption, + DROP COLUMN customer_present, + DROP COLUMN routing_algorithm_id, + DROP COLUMN payment_link_config; diff --git a/v2_migrations/2024-08-28-081721_add_v2_columns/up.sql b/v2_migrations/2024-08-28-081721_add_v2_columns/up.sql index 719a8afa30e..b89985ae815 100644 --- a/v2_migrations/2024-08-28-081721_add_v2_columns/up.sql +++ b/v2_migrations/2024-08-28-081721_add_v2_columns/up.sql @@ -5,6 +5,7 @@ ADD COLUMN IF NOT EXISTS merchant_reference_id VARCHAR(64), ADD COLUMN IF NOT EXISTS default_billing_address BYTEA DEFAULT NULL, ADD COLUMN IF NOT EXISTS default_shipping_address BYTEA DEFAULT NULL, ADD COLUMN IF NOT EXISTS status "DeleteStatus" NOT NULL DEFAULT 'active'; + CREATE TYPE "OrderFulfillmentTimeOrigin" AS ENUM ('create', 'confirm'); ALTER TABLE business_profile @@ -16,14 +17,19 @@ ADD COLUMN routing_algorithm_id VARCHAR(64) DEFAULT NULL, ADD COLUMN default_fallback_routing JSONB DEFAULT NULL; ALTER TABLE payment_intent -ADD COLUMN merchant_reference_id VARCHAR(64) NOT NULL, +ADD COLUMN merchant_reference_id VARCHAR(64), ADD COLUMN billing_address BYTEA DEFAULT NULL, ADD COLUMN shipping_address BYTEA DEFAULT NULL, ADD COLUMN capture_method "CaptureMethod", ADD COLUMN authentication_type "AuthenticationType", ADD COLUMN amount_to_capture bigint, - ADD COLUMN prerouting_algorithm JSONB, -- straight_through_algorithm from payment_attempt + ADD COLUMN prerouting_algorithm JSONB, ADD COLUMN surcharge_amount bigint, - ADD COLUMN tax_on_surcharge bigint, -- tax_amount from payment_attempt - ADD COLUMN frm_merchant_decision VARCHAR(64); - + ADD COLUMN tax_on_surcharge bigint, + ADD COLUMN frm_merchant_decision VARCHAR(64), + ADD COLUMN statement_descriptor VARCHAR(255), + ADD COLUMN enable_payment_link BOOLEAN, + ADD COLUMN apply_mit_exemption BOOLEAN, + ADD COLUMN customer_present BOOLEAN, + ADD COLUMN routing_algorithm_id VARCHAR(64), + ADD COLUMN payment_link_config JSONB; diff --git a/v2_migrations/2024-08-28-081838_update_v2_primary_key_constraints/down.sql b/v2_migrations/2024-08-28-081838_update_v2_primary_key_constraints/down.sql index 6acb08597f5..50f0e89da8c 100644 --- a/v2_migrations/2024-08-28-081838_update_v2_primary_key_constraints/down.sql +++ b/v2_migrations/2024-08-28-081838_update_v2_primary_key_constraints/down.sql @@ -1,4 +1,5 @@ -- Backfill for organization table +------------------------ Organization ----------------------- UPDATE ORGANIZATION SET org_id = id WHERE org_id IS NULL; @@ -16,6 +17,7 @@ SET org_name = organization_name WHERE org_name IS NULL AND organization_name IS NOT NULL; +------------------------ Merchant Account ----------------------- -- The new primary key for v2 merchant account will be `id` ALTER TABLE merchant_account DROP CONSTRAINT merchant_account_pkey; @@ -33,6 +35,7 @@ WHERE merchant_id IS NULL; ALTER TABLE merchant_account ADD PRIMARY KEY (merchant_id); +------------------------ Business Profile ----------------------- UPDATE business_profile SET profile_id = id WHERE profile_id IS NULL; @@ -42,6 +45,7 @@ ALTER TABLE business_profile DROP COLUMN id; ALTER TABLE business_profile ADD PRIMARY KEY (profile_id); +------------------------ Merchant Connector Account ----------------------- ALTER TABLE merchant_connector_account DROP CONSTRAINT merchant_connector_account_pkey; UPDATE merchant_connector_account @@ -54,6 +58,9 @@ ADD PRIMARY KEY (merchant_connector_id); ALTER TABLE merchant_connector_account ALTER COLUMN profile_id DROP NOT NULL; +DROP INDEX IF EXISTS merchant_connector_account_profile_id_index; + +------------------------ Customers ----------------------- -- Run this query only when V1 is deprecated ALTER TABLE customers DROP CONSTRAINT customers_pkey; @@ -65,6 +72,7 @@ WHERE customer_id IS NULL; ALTER TABLE customers ADD PRIMARY KEY (merchant_id, customer_id); +------------------------ Payment Intent ----------------------- ALTER TABLE payment_intent DROP CONSTRAINT payment_intent_pkey; UPDATE payment_intent @@ -73,3 +81,12 @@ WHERE payment_id IS NULL; ALTER TABLE payment_intent ADD PRIMARY KEY (payment_id, merchant_id); + +ALTER TABLE payment_intent +ALTER COLUMN profile_id DROP NOT NULL; + +ALTER TABLE payment_intent +ALTER COLUMN currency DROP NOT NULL; + +ALTER TABLE payment_intent +ALTER COLUMN client_secret DROP NOT NULL; diff --git a/v2_migrations/2024-08-28-081838_update_v2_primary_key_constraints/up.sql b/v2_migrations/2024-08-28-081838_update_v2_primary_key_constraints/up.sql index 440391529ab..8d89e4bc92f 100644 --- a/v2_migrations/2024-08-28-081838_update_v2_primary_key_constraints/up.sql +++ b/v2_migrations/2024-08-28-081838_update_v2_primary_key_constraints/up.sql @@ -69,6 +69,8 @@ ALTER TABLE merchant_connector_account ALTER COLUMN profile_id SET NOT NULL; +CREATE INDEX IF NOT EXISTS merchant_connector_account_profile_id_index ON merchant_connector_account (profile_id); + ------------------------ Customers ----------------------- -- Run this query only when V1 is deprecated ALTER TABLE customers DROP CONSTRAINT IF EXISTS customers_pkey; @@ -88,3 +90,12 @@ ALTER TABLE payment_intent DROP CONSTRAINT payment_intent_pkey; ALTER TABLE payment_intent ADD PRIMARY KEY (id); + +-- This migration is to make fields mandatory in payment_intent table +ALTER TABLE payment_intent +ALTER COLUMN profile_id +SET NOT NULL, + ALTER COLUMN currency +SET NOT NULL, + ALTER COLUMN client_secret +SET NOT NULL; diff --git a/v2_migrations/2024-08-28-081847_drop_v1_columns/down.sql b/v2_migrations/2024-08-28-081847_drop_v1_columns/down.sql index 83b369beac7..004c46a67d4 100644 --- a/v2_migrations/2024-08-28-081847_drop_v1_columns/down.sql +++ b/v2_migrations/2024-08-28-081847_drop_v1_columns/down.sql @@ -59,4 +59,11 @@ ADD COLUMN IF NOT EXISTS payment_id VARCHAR(64) NOT NULL, ADD COLUMN business_label VARCHAR(64), ADD COLUMN incremental_authorization_allowed BOOLEAN, ADD COLUMN fingerprint_id VARCHAR(64), - ADD COLUMN merchant_decision VARCHAR(64); + ADD COLUMN merchant_decision VARCHAR(64), + ADD COLUMN statement_descriptor_name VARCHAR(255), + ADD COLUMN amount_to_capture BIGINT, + ADD COLUMN off_session BOOLEAN, + ADD COLUMN payment_confirm_source "PaymentSource", + ADD COLUMN merchant_order_reference_id VARCHAR(255), + ADD COLUMN is_payment_processor_token_flow BOOLEAN, + ADD COLUMN charges jsonb; diff --git a/v2_migrations/2024-08-28-081847_drop_v1_columns/up.sql b/v2_migrations/2024-08-28-081847_drop_v1_columns/up.sql index 0879d667f99..0d2fcdd61d9 100644 --- a/v2_migrations/2024-08-28-081847_drop_v1_columns/up.sql +++ b/v2_migrations/2024-08-28-081847_drop_v1_columns/up.sql @@ -57,4 +57,11 @@ ALTER TABLE payment_intent DROP COLUMN payment_id, DROP COLUMN business_label, DROP COLUMN incremental_authorization_allowed, DROP COLUMN fingerprint_id, - DROP COLUMN merchant_decision; + DROP COLUMN merchant_decision, + DROP COLUMN statement_descriptor_name, + DROP COLUMN amount_to_capture, + DROP COLUMN off_session, + DROP COLUMN payment_confirm_source, + DROP COLUMN merchant_order_reference_id, + DROP COLUMN is_payment_processor_token_flow, + DROP COLUMN charges; diff --git a/v2_migrations/2024-09-13-075054_create-index-profile-id-mca/down.sql b/v2_migrations/2024-09-13-075054_create-index-profile-id-mca/down.sql deleted file mode 100644 index 32225e3496b..00000000000 --- a/v2_migrations/2024-09-13-075054_create-index-profile-id-mca/down.sql +++ /dev/null @@ -1,2 +0,0 @@ --- This file should undo anything in `up.sql` -DROP INDEX IF EXISTS merchant_connector_account_profile_id_index; \ No newline at end of file diff --git a/v2_migrations/2024-09-13-075054_create-index-profile-id-mca/up.sql b/v2_migrations/2024-09-13-075054_create-index-profile-id-mca/up.sql deleted file mode 100644 index f4ca993fef4..00000000000 --- a/v2_migrations/2024-09-13-075054_create-index-profile-id-mca/up.sql +++ /dev/null @@ -1,2 +0,0 @@ --- Your SQL goes here -CREATE INDEX IF NOT EXISTS merchant_connector_account_profile_id_index ON merchant_connector_account (profile_id);
refactor
payment intent fields refactoring (#5880)
76098952105c101c88410c6aa78c2c56298f0aaa
2023-07-14 12:56:44
Prasunna Soppa
feat(connector): [Tsys] Add template code for Tsys connector (#1704)
false
diff --git a/config/config.example.toml b/config/config.example.toml index 06ff14b9818..11dd3f43f16 100644 --- a/config/config.example.toml +++ b/config/config.example.toml @@ -191,6 +191,7 @@ stripe.base_url_file_upload = "https://files.stripe.com/" worldline.base_url = "https://eu.sandbox.api-ingenico.com/" worldpay.base_url = "https://try.access.worldpay.com/" trustpay.base_url = "https://test-tpgw.trustpay.eu/" +tsys.base_url = "https://stagegw.transnox.com/" trustpay.base_url_bank_redirects = "https://aapi.trustpay.eu/" zen.base_url = "https://api.zen-test.com/" diff --git a/config/development.toml b/config/development.toml index 05450f51454..44d235a8d83 100644 --- a/config/development.toml +++ b/config/development.toml @@ -90,6 +90,7 @@ cards = [ "shift4", "stripe", "trustpay", + "tsys", "worldline", "worldpay", "zen", @@ -151,6 +152,7 @@ stripe.base_url_file_upload = "https://files.stripe.com/" worldline.base_url = "https://eu.sandbox.api-ingenico.com/" worldpay.base_url = "https://try.access.worldpay.com/" trustpay.base_url = "https://test-tpgw.trustpay.eu/" +tsys.base_url = "https://stagegw.transnox.com/" trustpay.base_url_bank_redirects = "https://aapi.trustpay.eu/" zen.base_url = "https://api.zen-test.com/" zen.secondary_base_url = "https://secure.zen.com/" diff --git a/config/docker_compose.toml b/config/docker_compose.toml index 8a6edfce6ca..583e534d003 100644 --- a/config/docker_compose.toml +++ b/config/docker_compose.toml @@ -112,6 +112,7 @@ stripe.base_url_file_upload = "https://files.stripe.com/" worldline.base_url = "https://eu.sandbox.api-ingenico.com/" worldpay.base_url = "https://try.access.worldpay.com/" trustpay.base_url = "https://test-tpgw.trustpay.eu/" +tsys.base_url = "https://stagegw.transnox.com/" trustpay.base_url_bank_redirects = "https://aapi.trustpay.eu/" zen.base_url = "https://api.zen-test.com/" @@ -155,6 +156,7 @@ cards = [ "shift4", "stripe", "trustpay", + "tsys", "worldline", "worldpay", "zen", diff --git a/connector-template/mod.rs b/connector-template/mod.rs index 2a30bbe7a76..653c28962b9 100644 --- a/connector-template/mod.rs +++ b/connector-template/mod.rs @@ -2,6 +2,7 @@ mod transformers; use std::fmt::Debug; use error_stack::{ResultExt, IntoReport}; +use masking::ExposeInterface; use crate::{ configs::settings, @@ -80,7 +81,7 @@ impl ConnectorCommon for {{project-name | downcase | pascal_case}} { fn get_auth_header(&self, auth_type:&types::ConnectorAuthType)-> CustomResult<Vec<(String,request::Maskable<String>)>,errors::ConnectorError> { let auth = {{project-name | downcase}}::{{project-name | downcase | pascal_case}}AuthType::try_from(auth_type) .change_context(errors::ConnectorError::FailedToObtainAuthType)?; - Ok(vec![(headers::AUTHORIZATION.to_string(), auth.api_key.into_masked())]) + Ok(vec![(headers::AUTHORIZATION.to_string(), auth.api_key.expose().into_masked())]) } fn build_error_response( diff --git a/connector-template/transformers.rs b/connector-template/transformers.rs index af285b61831..d76b63a1f31 100644 --- a/connector-template/transformers.rs +++ b/connector-template/transformers.rs @@ -45,7 +45,7 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for {{project-name | downcase //TODO: Fill the struct with respective fields // Auth Struct pub struct {{project-name | downcase | pascal_case}}AuthType { - pub(super) api_key: String + pub(super) api_key: Secret<String> } impl TryFrom<&types::ConnectorAuthType> for {{project-name | downcase | pascal_case}}AuthType { @@ -53,7 +53,7 @@ impl TryFrom<&types::ConnectorAuthType> for {{project-name | downcase | pascal_c fn try_from(auth_type: &types::ConnectorAuthType) -> Result<Self, Self::Error> { match auth_type { types::ConnectorAuthType::HeaderKey { api_key } => Ok(Self { - api_key: api_key.to_string(), + api_key: Secret::new(api_key.to_string()), }), _ => Err(errors::ConnectorError::FailedToObtainAuthType.into()), } @@ -97,7 +97,7 @@ impl<F,T> TryFrom<types::ResponseRouterData<F, {{project-name | downcase | pasca redirection_data: None, mandate_reference: None, connector_metadata: None, - network_txn_id: None + network_txn_id: None, connector_response_reference_id: None, }), ..item.data diff --git a/crates/api_models/src/enums.rs b/crates/api_models/src/enums.rs index 5e48e398797..f0f51b8f5ce 100644 --- a/crates/api_models/src/enums.rs +++ b/crates/api_models/src/enums.rs @@ -108,6 +108,7 @@ pub enum Connector { Shift4, Stripe, Trustpay, + // Tsys, Worldline, Worldpay, Zen, @@ -215,6 +216,7 @@ pub enum RoutableConnectors { Shift4, Stripe, Trustpay, + // Tsys, Worldline, Worldpay, Zen, diff --git a/crates/router/src/configs/settings.rs b/crates/router/src/configs/settings.rs index f629ab4283c..58abd15581a 100644 --- a/crates/router/src/configs/settings.rs +++ b/crates/router/src/configs/settings.rs @@ -451,6 +451,7 @@ pub struct Connectors { pub shift4: ConnectorParams, pub stripe: ConnectorParamsWithFileUploadUrl, pub trustpay: ConnectorParamsWithMoreUrls, + pub tsys: ConnectorParams, pub worldline: ConnectorParams, pub worldpay: ConnectorParams, pub zen: ConnectorParams, diff --git a/crates/router/src/connector.rs b/crates/router/src/connector.rs index a9a387c482b..fd4ba7d4176 100644 --- a/crates/router/src/connector.rs +++ b/crates/router/src/connector.rs @@ -37,6 +37,7 @@ pub mod rapyd; pub mod shift4; pub mod stripe; pub mod trustpay; +pub mod tsys; pub mod utils; pub mod worldline; pub mod worldpay; @@ -53,5 +54,5 @@ pub use self::{ multisafepay::Multisafepay, nexinets::Nexinets, nmi::Nmi, noon::Noon, nuvei::Nuvei, opayo::Opayo, opennode::Opennode, payeezy::Payeezy, payme::Payme, paypal::Paypal, payu::Payu, powertranz::Powertranz, rapyd::Rapyd, shift4::Shift4, stripe::Stripe, trustpay::Trustpay, - worldline::Worldline, worldpay::Worldpay, zen::Zen, + tsys::Tsys, worldline::Worldline, worldpay::Worldpay, zen::Zen, }; diff --git a/crates/router/src/connector/tsys.rs b/crates/router/src/connector/tsys.rs new file mode 100644 index 00000000000..c9dfd814113 --- /dev/null +++ b/crates/router/src/connector/tsys.rs @@ -0,0 +1,507 @@ +mod transformers; + +use std::fmt::Debug; + +use error_stack::{IntoReport, ResultExt}; +use masking::ExposeInterface; +use transformers as tsys; + +use crate::{ + configs::settings, + core::errors::{self, CustomResult}, + headers, + services::{ + self, + request::{self, Mask}, + ConnectorIntegration, + }, + types::{ + self, + api::{self, ConnectorCommon, ConnectorCommonExt}, + ErrorResponse, Response, + }, + utils::{self, BytesExt}, +}; + +#[derive(Debug, Clone)] +pub struct Tsys; + +impl api::Payment for Tsys {} +impl api::PaymentSession for Tsys {} +impl api::ConnectorAccessToken for Tsys {} +impl api::PreVerify for Tsys {} +impl api::PaymentAuthorize for Tsys {} +impl api::PaymentSync for Tsys {} +impl api::PaymentCapture for Tsys {} +impl api::PaymentVoid for Tsys {} +impl api::Refund for Tsys {} +impl api::RefundExecute for Tsys {} +impl api::RefundSync for Tsys {} +impl api::PaymentToken for Tsys {} + +impl + ConnectorIntegration< + api::PaymentMethodToken, + types::PaymentMethodTokenizationData, + types::PaymentsResponseData, + > for Tsys +{ +} + +impl<Flow, Request, Response> ConnectorCommonExt<Flow, Request, Response> for Tsys +where + Self: ConnectorIntegration<Flow, Request, Response>, +{ + fn build_headers( + &self, + req: &types::RouterData<Flow, Request, Response>, + _connectors: &settings::Connectors, + ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> { + let mut header = vec![( + headers::CONTENT_TYPE.to_string(), + types::PaymentsAuthorizeType::get_content_type(self) + .to_string() + .into(), + )]; + let mut api_key = self.get_auth_header(&req.connector_auth_type)?; + header.append(&mut api_key); + Ok(header) + } +} + +impl ConnectorCommon for Tsys { + fn id(&self) -> &'static str { + "tsys" + } + + fn common_get_content_type(&self) -> &'static str { + "application/json" + } + + fn base_url<'a>(&self, connectors: &'a settings::Connectors) -> &'a str { + connectors.tsys.base_url.as_ref() + } + + fn get_auth_header( + &self, + auth_type: &types::ConnectorAuthType, + ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> { + let auth = tsys::TsysAuthType::try_from(auth_type) + .change_context(errors::ConnectorError::FailedToObtainAuthType)?; + Ok(vec![( + headers::AUTHORIZATION.to_string(), + auth.api_key.expose().into_masked(), + )]) + } + + fn build_error_response( + &self, + res: Response, + ) -> CustomResult<ErrorResponse, errors::ConnectorError> { + let response: tsys::TsysErrorResponse = res + .response + .parse_struct("TsysErrorResponse") + .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; + + Ok(ErrorResponse { + status_code: res.status_code, + code: response.code, + message: response.message, + reason: response.reason, + }) + } +} + +impl ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData> + for Tsys +{ +} + +impl ConnectorIntegration<api::AccessTokenAuth, types::AccessTokenRequestData, types::AccessToken> + for Tsys +{ +} + +impl ConnectorIntegration<api::Verify, types::VerifyRequestData, types::PaymentsResponseData> + for Tsys +{ +} + +impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::PaymentsResponseData> + for Tsys +{ + fn get_headers( + &self, + req: &types::PaymentsAuthorizeRouterData, + connectors: &settings::Connectors, + ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> { + self.build_headers(req, connectors) + } + + fn get_content_type(&self) -> &'static str { + self.common_get_content_type() + } + + fn get_url( + &self, + _req: &types::PaymentsAuthorizeRouterData, + _connectors: &settings::Connectors, + ) -> CustomResult<String, errors::ConnectorError> { + Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into()) + } + + fn get_request_body( + &self, + req: &types::PaymentsAuthorizeRouterData, + ) -> CustomResult<Option<types::RequestBody>, errors::ConnectorError> { + let req_obj = tsys::TsysPaymentsRequest::try_from(req)?; + let tsys_req = types::RequestBody::log_and_get_request_body( + &req_obj, + utils::Encode::<tsys::TsysPaymentsRequest>::encode_to_string_of_json, + ) + .change_context(errors::ConnectorError::RequestEncodingFailed)?; + Ok(Some(tsys_req)) + } + + fn build_request( + &self, + req: &types::PaymentsAuthorizeRouterData, + connectors: &settings::Connectors, + ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + Ok(Some( + services::RequestBuilder::new() + .method(services::Method::Post) + .url(&types::PaymentsAuthorizeType::get_url( + self, req, connectors, + )?) + .attach_default_headers() + .headers(types::PaymentsAuthorizeType::get_headers( + self, req, connectors, + )?) + .body(types::PaymentsAuthorizeType::get_request_body(self, req)?) + .build(), + )) + } + + fn handle_response( + &self, + data: &types::PaymentsAuthorizeRouterData, + res: Response, + ) -> CustomResult<types::PaymentsAuthorizeRouterData, errors::ConnectorError> { + let response: tsys::TsysPaymentsResponse = res + .response + .parse_struct("Tsys PaymentsAuthorizeResponse") + .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; + types::RouterData::try_from(types::ResponseRouterData { + response, + data: data.clone(), + http_code: res.status_code, + }) + } + + fn get_error_response( + &self, + res: Response, + ) -> CustomResult<ErrorResponse, errors::ConnectorError> { + self.build_error_response(res) + } +} + +impl ConnectorIntegration<api::PSync, types::PaymentsSyncData, types::PaymentsResponseData> + for Tsys +{ + fn get_headers( + &self, + req: &types::PaymentsSyncRouterData, + connectors: &settings::Connectors, + ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> { + self.build_headers(req, connectors) + } + + fn get_content_type(&self) -> &'static str { + self.common_get_content_type() + } + + fn get_url( + &self, + _req: &types::PaymentsSyncRouterData, + _connectors: &settings::Connectors, + ) -> CustomResult<String, errors::ConnectorError> { + Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into()) + } + + fn build_request( + &self, + req: &types::PaymentsSyncRouterData, + connectors: &settings::Connectors, + ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + Ok(Some( + services::RequestBuilder::new() + .method(services::Method::Get) + .url(&types::PaymentsSyncType::get_url(self, req, connectors)?) + .attach_default_headers() + .headers(types::PaymentsSyncType::get_headers(self, req, connectors)?) + .build(), + )) + } + + fn handle_response( + &self, + data: &types::PaymentsSyncRouterData, + res: Response, + ) -> CustomResult<types::PaymentsSyncRouterData, errors::ConnectorError> { + let response: tsys::TsysPaymentsResponse = res + .response + .parse_struct("tsys PaymentsSyncResponse") + .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; + types::RouterData::try_from(types::ResponseRouterData { + response, + data: data.clone(), + http_code: res.status_code, + }) + } + + fn get_error_response( + &self, + res: Response, + ) -> CustomResult<ErrorResponse, errors::ConnectorError> { + self.build_error_response(res) + } +} + +impl ConnectorIntegration<api::Capture, types::PaymentsCaptureData, types::PaymentsResponseData> + for Tsys +{ + fn get_headers( + &self, + req: &types::PaymentsCaptureRouterData, + connectors: &settings::Connectors, + ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> { + self.build_headers(req, connectors) + } + + fn get_content_type(&self) -> &'static str { + self.common_get_content_type() + } + + fn get_url( + &self, + _req: &types::PaymentsCaptureRouterData, + _connectors: &settings::Connectors, + ) -> CustomResult<String, errors::ConnectorError> { + Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into()) + } + + fn get_request_body( + &self, + _req: &types::PaymentsCaptureRouterData, + ) -> CustomResult<Option<types::RequestBody>, errors::ConnectorError> { + Err(errors::ConnectorError::NotImplemented("get_request_body method".to_string()).into()) + } + + fn build_request( + &self, + req: &types::PaymentsCaptureRouterData, + connectors: &settings::Connectors, + ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + Ok(Some( + services::RequestBuilder::new() + .method(services::Method::Post) + .url(&types::PaymentsCaptureType::get_url(self, req, connectors)?) + .attach_default_headers() + .headers(types::PaymentsCaptureType::get_headers( + self, req, connectors, + )?) + .body(types::PaymentsCaptureType::get_request_body(self, req)?) + .build(), + )) + } + + fn handle_response( + &self, + data: &types::PaymentsCaptureRouterData, + res: Response, + ) -> CustomResult<types::PaymentsCaptureRouterData, errors::ConnectorError> { + let response: tsys::TsysPaymentsResponse = res + .response + .parse_struct("Tsys PaymentsCaptureResponse") + .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; + types::RouterData::try_from(types::ResponseRouterData { + response, + data: data.clone(), + http_code: res.status_code, + }) + } + + fn get_error_response( + &self, + res: Response, + ) -> CustomResult<ErrorResponse, errors::ConnectorError> { + self.build_error_response(res) + } +} + +impl ConnectorIntegration<api::Void, types::PaymentsCancelData, types::PaymentsResponseData> + for Tsys +{ +} + +impl ConnectorIntegration<api::Execute, types::RefundsData, types::RefundsResponseData> for Tsys { + fn get_headers( + &self, + req: &types::RefundsRouterData<api::Execute>, + connectors: &settings::Connectors, + ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> { + self.build_headers(req, connectors) + } + + fn get_content_type(&self) -> &'static str { + self.common_get_content_type() + } + + fn get_url( + &self, + _req: &types::RefundsRouterData<api::Execute>, + _connectors: &settings::Connectors, + ) -> CustomResult<String, errors::ConnectorError> { + Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into()) + } + + fn get_request_body( + &self, + req: &types::RefundsRouterData<api::Execute>, + ) -> CustomResult<Option<types::RequestBody>, errors::ConnectorError> { + let req_obj = tsys::TsysRefundRequest::try_from(req)?; + let tsys_req = types::RequestBody::log_and_get_request_body( + &req_obj, + utils::Encode::<tsys::TsysRefundRequest>::encode_to_string_of_json, + ) + .change_context(errors::ConnectorError::RequestEncodingFailed)?; + Ok(Some(tsys_req)) + } + + fn build_request( + &self, + req: &types::RefundsRouterData<api::Execute>, + connectors: &settings::Connectors, + ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + let request = services::RequestBuilder::new() + .method(services::Method::Post) + .url(&types::RefundExecuteType::get_url(self, req, connectors)?) + .attach_default_headers() + .headers(types::RefundExecuteType::get_headers( + self, req, connectors, + )?) + .body(types::RefundExecuteType::get_request_body(self, req)?) + .build(); + Ok(Some(request)) + } + + fn handle_response( + &self, + data: &types::RefundsRouterData<api::Execute>, + res: Response, + ) -> CustomResult<types::RefundsRouterData<api::Execute>, errors::ConnectorError> { + let response: tsys::RefundResponse = res + .response + .parse_struct("tsys RefundResponse") + .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; + types::RouterData::try_from(types::ResponseRouterData { + response, + data: data.clone(), + http_code: res.status_code, + }) + } + + fn get_error_response( + &self, + res: Response, + ) -> CustomResult<ErrorResponse, errors::ConnectorError> { + self.build_error_response(res) + } +} + +impl ConnectorIntegration<api::RSync, types::RefundsData, types::RefundsResponseData> for Tsys { + fn get_headers( + &self, + req: &types::RefundSyncRouterData, + connectors: &settings::Connectors, + ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> { + self.build_headers(req, connectors) + } + + fn get_content_type(&self) -> &'static str { + self.common_get_content_type() + } + + fn get_url( + &self, + _req: &types::RefundSyncRouterData, + _connectors: &settings::Connectors, + ) -> CustomResult<String, errors::ConnectorError> { + Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into()) + } + + fn build_request( + &self, + req: &types::RefundSyncRouterData, + connectors: &settings::Connectors, + ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + Ok(Some( + services::RequestBuilder::new() + .method(services::Method::Get) + .url(&types::RefundSyncType::get_url(self, req, connectors)?) + .attach_default_headers() + .headers(types::RefundSyncType::get_headers(self, req, connectors)?) + .body(types::RefundSyncType::get_request_body(self, req)?) + .build(), + )) + } + + fn handle_response( + &self, + data: &types::RefundSyncRouterData, + res: Response, + ) -> CustomResult<types::RefundSyncRouterData, errors::ConnectorError> { + let response: tsys::RefundResponse = + res.response + .parse_struct("tsys RefundSyncResponse") + .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; + types::RouterData::try_from(types::ResponseRouterData { + response, + data: data.clone(), + http_code: res.status_code, + }) + } + + fn get_error_response( + &self, + res: Response, + ) -> CustomResult<ErrorResponse, errors::ConnectorError> { + self.build_error_response(res) + } +} + +#[async_trait::async_trait] +impl api::IncomingWebhook for Tsys { + fn get_webhook_object_reference_id( + &self, + _request: &api::IncomingWebhookRequestDetails<'_>, + ) -> CustomResult<api::webhooks::ObjectReferenceId, errors::ConnectorError> { + Err(errors::ConnectorError::WebhooksNotImplemented).into_report() + } + + fn get_webhook_event_type( + &self, + _request: &api::IncomingWebhookRequestDetails<'_>, + ) -> CustomResult<api::IncomingWebhookEvent, errors::ConnectorError> { + Err(errors::ConnectorError::WebhooksNotImplemented).into_report() + } + + fn get_webhook_resource_object( + &self, + _request: &api::IncomingWebhookRequestDetails<'_>, + ) -> CustomResult<serde_json::Value, errors::ConnectorError> { + Err(errors::ConnectorError::WebhooksNotImplemented).into_report() + } +} diff --git a/crates/router/src/connector/tsys/transformers.rs b/crates/router/src/connector/tsys/transformers.rs new file mode 100644 index 00000000000..4cb37515497 --- /dev/null +++ b/crates/router/src/connector/tsys/transformers.rs @@ -0,0 +1,197 @@ +use masking::Secret; +use serde::{Deserialize, Serialize}; + +use crate::{ + connector::utils::PaymentsAuthorizeRequestData, + core::errors, + types::{self, api, storage::enums}, +}; + +#[derive(Default, Debug, Serialize, Eq, PartialEq)] +pub struct TsysPaymentsRequest { + amount: i64, + card: TsysCard, +} + +#[derive(Default, Debug, Serialize, Eq, PartialEq)] +pub struct TsysCard { + name: Secret<String>, + number: cards::CardNumber, + expiry_month: Secret<String>, + expiry_year: Secret<String>, + cvc: Secret<String>, + complete: bool, +} + +impl TryFrom<&types::PaymentsAuthorizeRouterData> for TsysPaymentsRequest { + type Error = error_stack::Report<errors::ConnectorError>; + fn try_from(item: &types::PaymentsAuthorizeRouterData) -> Result<Self, Self::Error> { + match item.request.payment_method_data.clone() { + api::PaymentMethodData::Card(req_card) => { + let card = TsysCard { + name: req_card.card_holder_name, + number: req_card.card_number, + expiry_month: req_card.card_exp_month, + expiry_year: req_card.card_exp_year, + cvc: req_card.card_cvc, + complete: item.request.is_auto_capture()?, + }; + Ok(Self { + amount: item.request.amount, + card, + }) + } + _ => Err(errors::ConnectorError::NotImplemented("Payment methods".to_string()).into()), + } + } +} + +// Auth Struct +pub struct TsysAuthType { + pub(super) api_key: Secret<String>, +} + +impl TryFrom<&types::ConnectorAuthType> for TsysAuthType { + type Error = error_stack::Report<errors::ConnectorError>; + fn try_from(auth_type: &types::ConnectorAuthType) -> Result<Self, Self::Error> { + match auth_type { + types::ConnectorAuthType::HeaderKey { api_key } => Ok(Self { + api_key: Secret::new(api_key.to_string()), + }), + _ => Err(errors::ConnectorError::FailedToObtainAuthType.into()), + } + } +} +// PaymentsResponse +#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq)] +#[serde(rename_all = "lowercase")] +pub enum TsysPaymentStatus { + Succeeded, + Failed, + #[default] + Processing, +} + +impl From<TsysPaymentStatus> for enums::AttemptStatus { + fn from(item: TsysPaymentStatus) -> Self { + match item { + TsysPaymentStatus::Succeeded => Self::Charged, + TsysPaymentStatus::Failed => Self::Failure, + TsysPaymentStatus::Processing => Self::Authorizing, + } + } +} + +#[derive(Default, Debug, Clone, Serialize, Deserialize, PartialEq)] +pub struct TsysPaymentsResponse { + status: TsysPaymentStatus, + id: String, +} + +impl<F, T> + TryFrom<types::ResponseRouterData<F, TsysPaymentsResponse, T, types::PaymentsResponseData>> + for types::RouterData<F, T, types::PaymentsResponseData> +{ + type Error = error_stack::Report<errors::ConnectorError>; + fn try_from( + item: types::ResponseRouterData<F, TsysPaymentsResponse, T, types::PaymentsResponseData>, + ) -> Result<Self, Self::Error> { + Ok(Self { + status: enums::AttemptStatus::from(item.response.status), + response: Ok(types::PaymentsResponseData::TransactionResponse { + resource_id: types::ResponseId::ConnectorTransactionId(item.response.id), + redirection_data: None, + mandate_reference: None, + connector_metadata: None, + network_txn_id: None, + connector_response_reference_id: None, + }), + ..item.data + }) + } +} + +// REFUND : +// Type definition for RefundRequest +#[derive(Default, Debug, Serialize)] +pub struct TsysRefundRequest { + pub amount: i64, +} + +impl<F> TryFrom<&types::RefundsRouterData<F>> for TsysRefundRequest { + type Error = error_stack::Report<errors::ConnectorError>; + fn try_from(item: &types::RefundsRouterData<F>) -> Result<Self, Self::Error> { + Ok(Self { + amount: item.request.refund_amount, + }) + } +} + +// Type definition for Refund Response +#[allow(dead_code)] +#[derive(Debug, Serialize, Default, Deserialize, Clone)] +pub enum RefundStatus { + Succeeded, + Failed, + #[default] + Processing, +} + +impl From<RefundStatus> for enums::RefundStatus { + fn from(item: RefundStatus) -> Self { + match item { + RefundStatus::Succeeded => Self::Success, + RefundStatus::Failed => Self::Failure, + RefundStatus::Processing => Self::Pending, + //TODO: Review mapping + } + } +} + +#[derive(Default, Debug, Clone, Serialize, Deserialize)] +pub struct RefundResponse { + id: String, + status: RefundStatus, +} + +impl TryFrom<types::RefundsResponseRouterData<api::Execute, RefundResponse>> + for types::RefundsRouterData<api::Execute> +{ + type Error = error_stack::Report<errors::ConnectorError>; + fn try_from( + item: types::RefundsResponseRouterData<api::Execute, RefundResponse>, + ) -> Result<Self, Self::Error> { + Ok(Self { + response: Ok(types::RefundsResponseData { + connector_refund_id: item.response.id.to_string(), + refund_status: enums::RefundStatus::from(item.response.status), + }), + ..item.data + }) + } +} + +impl TryFrom<types::RefundsResponseRouterData<api::RSync, RefundResponse>> + for types::RefundsRouterData<api::RSync> +{ + type Error = error_stack::Report<errors::ConnectorError>; + fn try_from( + item: types::RefundsResponseRouterData<api::RSync, RefundResponse>, + ) -> Result<Self, Self::Error> { + Ok(Self { + response: Ok(types::RefundsResponseData { + connector_refund_id: item.response.id.to_string(), + refund_status: enums::RefundStatus::from(item.response.status), + }), + ..item.data + }) + } +} + +#[derive(Default, Debug, Serialize, Deserialize, PartialEq)] +pub struct TsysErrorResponse { + pub status_code: u16, + pub code: String, + pub message: String, + pub reason: Option<String>, +} diff --git a/crates/router/src/core/payments/flows.rs b/crates/router/src/core/payments/flows.rs index 5971a8e52d6..cc04b0d5ac8 100644 --- a/crates/router/src/core/payments/flows.rs +++ b/crates/router/src/core/payments/flows.rs @@ -166,6 +166,7 @@ default_imp_for_complete_authorize!( connector::Rapyd, connector::Stripe, connector::Trustpay, + connector::Tsys, connector::Worldline, connector::Worldpay, connector::Zen @@ -234,6 +235,7 @@ default_imp_for_create_customer!( connector::Rapyd, connector::Shift4, connector::Trustpay, + connector::Tsys, connector::Worldline, connector::Worldpay, connector::Zen @@ -295,6 +297,7 @@ default_imp_for_connector_redirect_response!( connector::Powertranz, connector::Rapyd, connector::Shift4, + connector::Tsys, connector::Worldline, connector::Worldpay ); @@ -346,6 +349,7 @@ default_imp_for_connector_request_id!( connector::Shift4, connector::Stripe, connector::Trustpay, + connector::Tsys, connector::Worldline, connector::Worldpay, connector::Zen @@ -417,6 +421,7 @@ default_imp_for_accept_dispute!( connector::Shift4, connector::Stripe, connector::Trustpay, + connector::Tsys, connector::Opennode, connector::Worldline, connector::Worldpay, @@ -507,6 +512,7 @@ default_imp_for_file_upload!( connector::Rapyd, connector::Shift4, connector::Trustpay, + connector::Tsys, connector::Opennode, connector::Worldline, connector::Worldpay, @@ -575,6 +581,7 @@ default_imp_for_submit_evidence!( connector::Rapyd, connector::Shift4, connector::Trustpay, + connector::Tsys, connector::Opennode, connector::Worldline, connector::Worldpay, @@ -644,6 +651,7 @@ default_imp_for_defend_dispute!( connector::Stripe, connector::Shift4, connector::Trustpay, + connector::Tsys, connector::Opennode, connector::Worldline, connector::Worldpay, @@ -713,6 +721,7 @@ default_imp_for_pre_processing_steps!( connector::Powertranz, connector::Rapyd, connector::Shift4, + connector::Tsys, connector::Worldline, connector::Worldpay, connector::Zen diff --git a/crates/router/tests/connectors/main.rs b/crates/router/tests/connectors/main.rs index b49ea68800e..4e28aa32b18 100644 --- a/crates/router/tests/connectors/main.rs +++ b/crates/router/tests/connectors/main.rs @@ -58,6 +58,7 @@ mod stripe; mod stripe_ui; mod trustpay; mod trustpay_3ds_ui; +mod tsys; mod utils; mod worldline; mod worldline_ui; diff --git a/crates/router/tests/connectors/sample_auth.toml b/crates/router/tests/connectors/sample_auth.toml index 1bf520051d4..0cd08f628dd 100644 --- a/crates/router/tests/connectors/sample_auth.toml +++ b/crates/router/tests/connectors/sample_auth.toml @@ -149,4 +149,7 @@ key1 = "Credential code" [powertranz] api_key="PowerTranz-PowerTranzPassword" -key1 = "PowerTranz-PowerTranzId" \ No newline at end of file +key1 = "PowerTranz-PowerTranzId" + +[tsys] +api_key="API Key" \ No newline at end of file diff --git a/crates/router/tests/connectors/tsys.rs b/crates/router/tests/connectors/tsys.rs new file mode 100644 index 00000000000..1e950b8b870 --- /dev/null +++ b/crates/router/tests/connectors/tsys.rs @@ -0,0 +1,418 @@ +use masking::Secret; +use router::types::{self, api, storage::enums}; +use test_utils::connector_auth; + +use crate::utils::{self, ConnectorActions}; + +#[derive(Clone, Copy)] +struct TsysTest; +impl ConnectorActions for TsysTest {} +impl utils::Connector for TsysTest { + fn get_data(&self) -> types::api::ConnectorData { + use router::connector::Tsys; + types::api::ConnectorData { + connector: Box::new(&Tsys), + connector_name: types::Connector::DummyConnector1, + get_token: types::api::GetToken::Connector, + } + } + + fn get_auth_token(&self) -> types::ConnectorAuthType { + types::ConnectorAuthType::from( + connector_auth::ConnectorAuthentication::new() + .dummyconnector + .expect("Missing connector authentication configuration"), + ) + } + + fn get_name(&self) -> String { + "tsys".to_string() + } +} + +static CONNECTOR: TsysTest = TsysTest {}; + +fn get_default_payment_info() -> Option<utils::PaymentInfo> { + None +} + +fn payment_method_details() -> Option<types::PaymentsAuthorizeData> { + None +} + +// Cards Positive Tests +// Creates a payment using the manual capture flow (Non 3DS). +#[actix_web::test] +async fn should_only_authorize_payment() { + let response = CONNECTOR + .authorize_payment(payment_method_details(), get_default_payment_info()) + .await + .expect("Authorize payment response"); + assert_eq!(response.status, enums::AttemptStatus::Authorized); +} + +// Captures a payment using the manual capture flow (Non 3DS). +#[actix_web::test] +async fn should_capture_authorized_payment() { + let response = CONNECTOR + .authorize_and_capture_payment(payment_method_details(), None, get_default_payment_info()) + .await + .expect("Capture payment response"); + assert_eq!(response.status, enums::AttemptStatus::Charged); +} + +// Partially captures a payment using the manual capture flow (Non 3DS). +#[actix_web::test] +async fn should_partially_capture_authorized_payment() { + let response = CONNECTOR + .authorize_and_capture_payment( + payment_method_details(), + Some(types::PaymentsCaptureData { + amount_to_capture: 50, + ..utils::PaymentCaptureType::default().0 + }), + get_default_payment_info(), + ) + .await + .expect("Capture payment response"); + assert_eq!(response.status, enums::AttemptStatus::Charged); +} + +// Synchronizes a payment using the manual capture flow (Non 3DS). +#[actix_web::test] +async fn should_sync_authorized_payment() { + let authorize_response = CONNECTOR + .authorize_payment(payment_method_details(), get_default_payment_info()) + .await + .expect("Authorize payment response"); + let txn_id = utils::get_connector_transaction_id(authorize_response.response); + let response = CONNECTOR + .psync_retry_till_status_matches( + enums::AttemptStatus::Authorized, + Some(types::PaymentsSyncData { + connector_transaction_id: router::types::ResponseId::ConnectorTransactionId( + txn_id.unwrap(), + ), + ..Default::default() + }), + get_default_payment_info(), + ) + .await + .expect("PSync response"); + assert_eq!(response.status, enums::AttemptStatus::Authorized,); +} + +// Voids a payment using the manual capture flow (Non 3DS). +#[actix_web::test] +async fn should_void_authorized_payment() { + let response = CONNECTOR + .authorize_and_void_payment( + payment_method_details(), + Some(types::PaymentsCancelData { + connector_transaction_id: String::from(""), + cancellation_reason: Some("requested_by_customer".to_string()), + ..Default::default() + }), + get_default_payment_info(), + ) + .await + .expect("Void payment response"); + assert_eq!(response.status, enums::AttemptStatus::Voided); +} + +// Refunds a payment using the manual capture flow (Non 3DS). +#[actix_web::test] +async fn should_refund_manually_captured_payment() { + let response = CONNECTOR + .capture_payment_and_refund( + payment_method_details(), + None, + None, + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!( + response.response.unwrap().refund_status, + enums::RefundStatus::Success, + ); +} + +// Partially refunds a payment using the manual capture flow (Non 3DS). +#[actix_web::test] +async fn should_partially_refund_manually_captured_payment() { + let response = CONNECTOR + .capture_payment_and_refund( + payment_method_details(), + None, + Some(types::RefundsData { + refund_amount: 50, + ..utils::PaymentRefundType::default().0 + }), + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!( + response.response.unwrap().refund_status, + enums::RefundStatus::Success, + ); +} + +// Synchronizes a refund using the manual capture flow (Non 3DS). +#[actix_web::test] +async fn should_sync_manually_captured_refund() { + let refund_response = CONNECTOR + .capture_payment_and_refund( + payment_method_details(), + None, + None, + get_default_payment_info(), + ) + .await + .unwrap(); + let response = CONNECTOR + .rsync_retry_till_status_matches( + enums::RefundStatus::Success, + refund_response.response.unwrap().connector_refund_id, + None, + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!( + response.response.unwrap().refund_status, + enums::RefundStatus::Success, + ); +} + +// Creates a payment using the automatic capture flow (Non 3DS). +#[actix_web::test] +async fn should_make_payment() { + let authorize_response = CONNECTOR + .make_payment(payment_method_details(), get_default_payment_info()) + .await + .unwrap(); + assert_eq!(authorize_response.status, enums::AttemptStatus::Charged); +} + +// Synchronizes a payment using the automatic capture flow (Non 3DS). +#[actix_web::test] +async fn should_sync_auto_captured_payment() { + let authorize_response = CONNECTOR + .make_payment(payment_method_details(), get_default_payment_info()) + .await + .unwrap(); + assert_eq!(authorize_response.status, enums::AttemptStatus::Charged); + let txn_id = utils::get_connector_transaction_id(authorize_response.response); + assert_ne!(txn_id, None, "Empty connector transaction id"); + let response = CONNECTOR + .psync_retry_till_status_matches( + enums::AttemptStatus::Charged, + Some(types::PaymentsSyncData { + connector_transaction_id: router::types::ResponseId::ConnectorTransactionId( + txn_id.unwrap(), + ), + capture_method: Some(enums::CaptureMethod::Automatic), + ..Default::default() + }), + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!(response.status, enums::AttemptStatus::Charged,); +} + +// Refunds a payment using the automatic capture flow (Non 3DS). +#[actix_web::test] +async fn should_refund_auto_captured_payment() { + let response = CONNECTOR + .make_payment_and_refund(payment_method_details(), None, get_default_payment_info()) + .await + .unwrap(); + assert_eq!( + response.response.unwrap().refund_status, + enums::RefundStatus::Success, + ); +} + +// Partially refunds a payment using the automatic capture flow (Non 3DS). +#[actix_web::test] +async fn should_partially_refund_succeeded_payment() { + let refund_response = CONNECTOR + .make_payment_and_refund( + payment_method_details(), + Some(types::RefundsData { + refund_amount: 50, + ..utils::PaymentRefundType::default().0 + }), + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!( + refund_response.response.unwrap().refund_status, + enums::RefundStatus::Success, + ); +} + +// Creates multiple refunds against a payment using the automatic capture flow (Non 3DS). +#[actix_web::test] +async fn should_refund_succeeded_payment_multiple_times() { + CONNECTOR + .make_payment_and_multiple_refund( + payment_method_details(), + Some(types::RefundsData { + refund_amount: 50, + ..utils::PaymentRefundType::default().0 + }), + get_default_payment_info(), + ) + .await; +} + +// Synchronizes a refund using the automatic capture flow (Non 3DS). +#[actix_web::test] +async fn should_sync_refund() { + let refund_response = CONNECTOR + .make_payment_and_refund(payment_method_details(), None, get_default_payment_info()) + .await + .unwrap(); + let response = CONNECTOR + .rsync_retry_till_status_matches( + enums::RefundStatus::Success, + refund_response.response.unwrap().connector_refund_id, + None, + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!( + response.response.unwrap().refund_status, + enums::RefundStatus::Success, + ); +} + +// Cards Negative scenerios +// Creates a payment with incorrect CVC. +#[actix_web::test] +async fn should_fail_payment_for_incorrect_cvc() { + let response = CONNECTOR + .make_payment( + Some(types::PaymentsAuthorizeData { + payment_method_data: types::api::PaymentMethodData::Card(api::Card { + card_cvc: Secret::new("12345".to_string()), + ..utils::CCardType::default().0 + }), + ..utils::PaymentAuthorizeType::default().0 + }), + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!( + response.response.unwrap_err().message, + "Your card's security code is invalid.".to_string(), + ); +} + +// Creates a payment with incorrect expiry month. +#[actix_web::test] +async fn should_fail_payment_for_invalid_exp_month() { + let response = CONNECTOR + .make_payment( + Some(types::PaymentsAuthorizeData { + payment_method_data: types::api::PaymentMethodData::Card(api::Card { + card_exp_month: Secret::new("20".to_string()), + ..utils::CCardType::default().0 + }), + ..utils::PaymentAuthorizeType::default().0 + }), + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!( + response.response.unwrap_err().message, + "Your card's expiration month is invalid.".to_string(), + ); +} + +// Creates a payment with incorrect expiry year. +#[actix_web::test] +async fn should_fail_payment_for_incorrect_expiry_year() { + let response = CONNECTOR + .make_payment( + Some(types::PaymentsAuthorizeData { + payment_method_data: types::api::PaymentMethodData::Card(api::Card { + card_exp_year: Secret::new("2000".to_string()), + ..utils::CCardType::default().0 + }), + ..utils::PaymentAuthorizeType::default().0 + }), + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!( + response.response.unwrap_err().message, + "Your card's expiration year is invalid.".to_string(), + ); +} + +// Voids a payment using automatic capture flow (Non 3DS). +#[actix_web::test] +async fn should_fail_void_payment_for_auto_capture() { + let authorize_response = CONNECTOR + .make_payment(payment_method_details(), get_default_payment_info()) + .await + .unwrap(); + assert_eq!(authorize_response.status, enums::AttemptStatus::Charged); + let txn_id = utils::get_connector_transaction_id(authorize_response.response); + assert_ne!(txn_id, None, "Empty connector transaction id"); + let void_response = CONNECTOR + .void_payment(txn_id.unwrap(), None, get_default_payment_info()) + .await + .unwrap(); + assert_eq!( + void_response.response.unwrap_err().message, + "You cannot cancel this PaymentIntent because it has a status of succeeded." + ); +} + +// Captures a payment using invalid connector payment id. +#[actix_web::test] +async fn should_fail_capture_for_invalid_payment() { + let capture_response = CONNECTOR + .capture_payment("123456789".to_string(), None, get_default_payment_info()) + .await + .unwrap(); + assert_eq!( + capture_response.response.unwrap_err().message, + String::from("No such payment_intent: '123456789'") + ); +} + +// Refunds a payment with refund amount higher than payment amount. +#[actix_web::test] +async fn should_fail_for_refund_amount_higher_than_payment_amount() { + let response = CONNECTOR + .make_payment_and_refund( + payment_method_details(), + Some(types::RefundsData { + refund_amount: 150, + ..utils::PaymentRefundType::default().0 + }), + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!( + response.response.unwrap_err().message, + "Refund amount (₹1.50) is greater than charge amount (₹1.00)", + ); +} + +// Connector dependent test cases goes here + +// [#478]: add unit tests for non 3DS, wallets & webhooks in connector tests diff --git a/loadtest/config/development.toml b/loadtest/config/development.toml index edbe431d040..20daa5b813a 100644 --- a/loadtest/config/development.toml +++ b/loadtest/config/development.toml @@ -99,6 +99,7 @@ stripe.base_url_file_upload = "https://files.stripe.com/" worldline.base_url = "https://eu.sandbox.api-ingenico.com/" worldpay.base_url = "https://try.access.worldpay.com/" trustpay.base_url = "https://test-tpgw.trustpay.eu/" +tsys.base_url = "https://stagegw.transnox.com/" trustpay.base_url_bank_redirects = "https://aapi.trustpay.eu/" zen.base_url = "https://api.zen-test.com/" @@ -141,6 +142,7 @@ cards = [ "shift4", "stripe", "trustpay", + "tsys", "worldline", "worldpay", "zen", diff --git a/scripts/add_connector.sh b/scripts/add_connector.sh index 79b12113177..cc038472197 100755 --- a/scripts/add_connector.sh +++ b/scripts/add_connector.sh @@ -4,7 +4,7 @@ function find_prev_connector() { git checkout $self cp $self $self.tmp # add new connector to existing list and sort it - connectors=(aci adyen airwallex applepay authorizedotnet bambora bitpay bluesnap braintree cashtocode checkout coinbase cryptopay cybersource dlocal dummyconnector fiserv forte globalpay globepay iatapay klarna mollie multisafepay nexinets noon nuvei opayo opennode payeezy payme paypal payu powertranz rapyd shift4 stripe trustpay worldline worldpay "$1") + connectors=(aci adyen airwallex applepay authorizedotnet bambora bitpay bluesnap braintree cashtocode checkout coinbase cryptopay cybersource dlocal dummyconnector fiserv forte globalpay globepay iatapay klarna mollie multisafepay nexinets noon nuvei opayo opennode payeezy payme paypal payu powertranz rapyd shift4 stripe trustpay tsys worldline worldpay "$1") IFS=$'\n' sorted=($(sort <<<"${connectors[*]}")); unset IFS res=`echo ${sorted[@]}` sed -i'' -e "s/^ connectors=.*/ connectors=($res \"\$1\")/" $self.tmp
feat
[Tsys] Add template code for Tsys connector (#1704)
36c32c377ae788c96b578303eae5d029e3044b7c
2024-01-09 20:06:28
Chethan Rao
refactor: pass customer object to `make_pm_data` (#3246)
false
diff --git a/crates/common_utils/src/pii.rs b/crates/common_utils/src/pii.rs index 1889a5f3aee..066962af1d4 100644 --- a/crates/common_utils/src/pii.rs +++ b/crates/common_utils/src/pii.rs @@ -244,12 +244,6 @@ impl TryFrom<String> for Email { } } -impl From<Secret<String, EmailStrategy>> for Email { - fn from(value: Secret<String, EmailStrategy>) -> Self { - Self(value) - } -} - impl ops::Deref for Email { type Target = Secret<String, EmailStrategy>; diff --git a/crates/router/src/core/admin.rs b/crates/router/src/core/admin.rs index 53810593206..2577bb83a3a 100644 --- a/crates/router/src/core/admin.rs +++ b/crates/router/src/core/admin.rs @@ -13,6 +13,7 @@ use common_utils::{ use error_stack::{report, FutureExt, IntoReport, ResultExt}; use futures::future::try_join_all; use masking::{PeekInterface, Secret}; +use pm_auth::connector::plaid::transformers::PlaidAuthType; use uuid::Uuid; use crate::{ @@ -1830,8 +1831,10 @@ pub(crate) fn validate_auth_and_metadata_type( riskified::transformers::RiskifiedAuthType::try_from(val)?; Ok(()) } - api_enums::Connector::Plaid => Err(report!(errors::ConnectorError::InvalidConnectorName) - .attach_printable(format!("invalid connector name: {connector_name}"))), + api_enums::Connector::Plaid => { + PlaidAuthType::foreign_try_from(val)?; + Ok(()) + } } } diff --git a/crates/router/src/core/payment_methods.rs b/crates/router/src/core/payment_methods.rs index 14a39f1d955..c1617fa77c9 100644 --- a/crates/router/src/core/payment_methods.rs +++ b/crates/router/src/core/payment_methods.rs @@ -43,6 +43,7 @@ pub trait PaymentMethodRetrieve { token: &storage::PaymentTokenData, payment_intent: &PaymentIntent, card_token_data: Option<&CardToken>, + customer: &Option<domain::Customer>, ) -> RouterResult<Option<(payments::PaymentMethodData, enums::PaymentMethod)>>; } @@ -126,6 +127,7 @@ impl PaymentMethodRetrieve for Oss { token_data: &storage::PaymentTokenData, payment_intent: &PaymentIntent, card_token_data: Option<&CardToken>, + customer: &Option<domain::Customer>, ) -> RouterResult<Option<(payments::PaymentMethodData, enums::PaymentMethod)>> { match token_data { storage::PaymentTokenData::TemporaryGeneric(generic_token) => { @@ -178,6 +180,7 @@ impl PaymentMethodRetrieve for Oss { merchant_key_store, auth_token, payment_intent, + customer, ) .await } diff --git a/crates/router/src/core/payments.rs b/crates/router/src/core/payments.rs index 04e947d36e4..67328e35612 100644 --- a/crates/router/src/core/payments.rs +++ b/crates/router/src/core/payments.rs @@ -166,6 +166,7 @@ where &mut payment_data, &validate_result, &key_store, + &customer, ) .await?; @@ -1041,6 +1042,7 @@ where validate_result, &merchant_connector_account, key_store, + customer, ) .await?; @@ -1754,6 +1756,7 @@ pub async fn get_connector_tokenization_action_when_confirm_true<F, Req, Ctx>( validate_result: &operations::ValidateResult<'_>, merchant_connector_account: &helpers::MerchantConnectorAccountType, merchant_key_store: &domain::MerchantKeyStore, + customer: &Option<domain::Customer>, ) -> RouterResult<(PaymentData<F>, TokenizationAction)> where F: Send + Clone, @@ -1821,6 +1824,7 @@ where payment_data, validate_result.storage_scheme, merchant_key_store, + customer, ) .await?; payment_data.payment_method_data = payment_method_data; @@ -1836,6 +1840,7 @@ where payment_data, validate_result.storage_scheme, merchant_key_store, + customer, ) .await?; @@ -1873,6 +1878,7 @@ pub async fn tokenize_in_router_when_confirm_false<F, Req, Ctx>( payment_data: &mut PaymentData<F>, validate_result: &operations::ValidateResult<'_>, merchant_key_store: &domain::MerchantKeyStore, + customer: &Option<domain::Customer>, ) -> RouterResult<PaymentData<F>> where F: Send + Clone, @@ -1887,6 +1893,7 @@ where payment_data, validate_result.storage_scheme, merchant_key_store, + customer, ) .await?; payment_data.payment_method_data = payment_method_data; diff --git a/crates/router/src/core/payments/helpers.rs b/crates/router/src/core/payments/helpers.rs index 97a9cbb9eaf..d864cacc52f 100644 --- a/crates/router/src/core/payments/helpers.rs +++ b/crates/router/src/core/payments/helpers.rs @@ -1532,6 +1532,7 @@ pub async fn make_pm_data<'a, F: Clone, R, Ctx: PaymentMethodRetrieve>( state: &'a AppState, payment_data: &mut PaymentData<F>, merchant_key_store: &domain::MerchantKeyStore, + customer: &Option<domain::Customer>, ) -> RouterResult<( BoxedOperation<'a, F, R, Ctx>, Option<api::PaymentMethodData>, @@ -1621,6 +1622,7 @@ pub async fn make_pm_data<'a, F: Clone, R, Ctx: PaymentMethodRetrieve>( &hyperswitch_token, &payment_data.payment_intent, card_token_data.as_ref(), + customer, ) .await .attach_printable("in 'make_pm_data'")?; diff --git a/crates/router/src/core/payments/operations.rs b/crates/router/src/core/payments/operations.rs index cf0c0ab294a..716b76120d8 100644 --- a/crates/router/src/core/payments/operations.rs +++ b/crates/router/src/core/payments/operations.rs @@ -131,6 +131,7 @@ pub trait Domain<F: Clone, R, Ctx: PaymentMethodRetrieve>: Send + Sync { payment_data: &mut PaymentData<F>, storage_scheme: enums::MerchantStorageScheme, merchant_key_store: &domain::MerchantKeyStore, + customer: &Option<domain::Customer>, ) -> RouterResult<( BoxedOperation<'a, F, R, Ctx>, Option<api::PaymentMethodData>, @@ -251,11 +252,19 @@ where payment_data: &mut PaymentData<F>, _storage_scheme: enums::MerchantStorageScheme, merchant_key_store: &domain::MerchantKeyStore, + customer: &Option<domain::Customer>, ) -> RouterResult<( BoxedOperation<'a, F, api::PaymentsRetrieveRequest, Ctx>, Option<api::PaymentMethodData>, )> { - helpers::make_pm_data(Box::new(self), state, payment_data, merchant_key_store).await + helpers::make_pm_data( + Box::new(self), + state, + payment_data, + merchant_key_store, + customer, + ) + .await } } @@ -301,6 +310,7 @@ where _payment_data: &mut PaymentData<F>, _storage_scheme: enums::MerchantStorageScheme, _merchant_key_store: &domain::MerchantKeyStore, + _customer: &Option<domain::Customer>, ) -> RouterResult<( BoxedOperation<'a, F, api::PaymentsCaptureRequest, Ctx>, Option<api::PaymentMethodData>, @@ -363,6 +373,7 @@ where _payment_data: &mut PaymentData<F>, _storage_scheme: enums::MerchantStorageScheme, _merchant_key_store: &domain::MerchantKeyStore, + _customer: &Option<domain::Customer>, ) -> RouterResult<( BoxedOperation<'a, F, api::PaymentsCancelRequest, Ctx>, Option<api::PaymentMethodData>, @@ -415,6 +426,7 @@ where _payment_data: &mut PaymentData<F>, _storage_scheme: enums::MerchantStorageScheme, _merchant_key_store: &domain::MerchantKeyStore, + _customer: &Option<domain::Customer>, ) -> RouterResult<( BoxedOperation<'a, F, api::PaymentsRejectRequest, Ctx>, Option<api::PaymentMethodData>, diff --git a/crates/router/src/core/payments/operations/payment_approve.rs b/crates/router/src/core/payments/operations/payment_approve.rs index 1a6945b09c8..cddbc89acff 100644 --- a/crates/router/src/core/payments/operations/payment_approve.rs +++ b/crates/router/src/core/payments/operations/payment_approve.rs @@ -315,12 +315,19 @@ impl<F: Clone + Send, Ctx: PaymentMethodRetrieve> Domain<F, api::PaymentsRequest payment_data: &mut PaymentData<F>, _storage_scheme: storage_enums::MerchantStorageScheme, merchant_key_store: &domain::MerchantKeyStore, + customer: &Option<domain::Customer>, ) -> RouterResult<( BoxedOperation<'a, F, api::PaymentsRequest, Ctx>, Option<api::PaymentMethodData>, )> { - let (op, payment_method_data) = - helpers::make_pm_data(Box::new(self), state, payment_data, merchant_key_store).await?; + let (op, payment_method_data) = helpers::make_pm_data( + Box::new(self), + state, + payment_data, + merchant_key_store, + customer, + ) + .await?; utils::when(payment_method_data.is_none(), || { Err(errors::ApiErrorResponse::PaymentMethodNotFound) diff --git a/crates/router/src/core/payments/operations/payment_complete_authorize.rs b/crates/router/src/core/payments/operations/payment_complete_authorize.rs index abb08d14d92..adc137403e5 100644 --- a/crates/router/src/core/payments/operations/payment_complete_authorize.rs +++ b/crates/router/src/core/payments/operations/payment_complete_authorize.rs @@ -311,12 +311,19 @@ impl<F: Clone + Send, Ctx: PaymentMethodRetrieve> Domain<F, api::PaymentsRequest payment_data: &mut PaymentData<F>, _storage_scheme: storage_enums::MerchantStorageScheme, merchant_key_store: &domain::MerchantKeyStore, + customer: &Option<domain::Customer>, ) -> RouterResult<( BoxedOperation<'a, F, api::PaymentsRequest, Ctx>, Option<api::PaymentMethodData>, )> { - let (op, payment_method_data) = - helpers::make_pm_data(Box::new(self), state, payment_data, merchant_key_store).await?; + let (op, payment_method_data) = helpers::make_pm_data( + Box::new(self), + state, + payment_data, + merchant_key_store, + customer, + ) + .await?; Ok((op, payment_method_data)) } diff --git a/crates/router/src/core/payments/operations/payment_confirm.rs b/crates/router/src/core/payments/operations/payment_confirm.rs index 6a50abc5432..0970a952c8e 100644 --- a/crates/router/src/core/payments/operations/payment_confirm.rs +++ b/crates/router/src/core/payments/operations/payment_confirm.rs @@ -527,12 +527,13 @@ impl<F: Clone + Send, Ctx: PaymentMethodRetrieve> Domain<F, api::PaymentsRequest payment_data: &mut PaymentData<F>, _storage_scheme: storage_enums::MerchantStorageScheme, key_store: &domain::MerchantKeyStore, + customer: &Option<domain::Customer>, ) -> RouterResult<( BoxedOperation<'a, F, api::PaymentsRequest, Ctx>, Option<api::PaymentMethodData>, )> { let (op, payment_method_data) = - helpers::make_pm_data(Box::new(self), state, payment_data, key_store).await?; + helpers::make_pm_data(Box::new(self), state, payment_data, key_store, customer).await?; utils::when(payment_method_data.is_none(), || { Err(errors::ApiErrorResponse::PaymentMethodNotFound) diff --git a/crates/router/src/core/payments/operations/payment_create.rs b/crates/router/src/core/payments/operations/payment_create.rs index 6f4f10e0ab3..94436026dc4 100644 --- a/crates/router/src/core/payments/operations/payment_create.rs +++ b/crates/router/src/core/payments/operations/payment_create.rs @@ -424,11 +424,19 @@ impl<F: Clone + Send, Ctx: PaymentMethodRetrieve> Domain<F, api::PaymentsRequest payment_data: &mut PaymentData<F>, _storage_scheme: enums::MerchantStorageScheme, merchant_key_store: &domain::MerchantKeyStore, + customer: &Option<domain::Customer>, ) -> RouterResult<( BoxedOperation<'a, F, api::PaymentsRequest, Ctx>, Option<api::PaymentMethodData>, )> { - helpers::make_pm_data(Box::new(self), state, payment_data, merchant_key_store).await + helpers::make_pm_data( + Box::new(self), + state, + payment_data, + merchant_key_store, + customer, + ) + .await } #[instrument(skip_all)] diff --git a/crates/router/src/core/payments/operations/payment_session.rs b/crates/router/src/core/payments/operations/payment_session.rs index 49fad8f078d..9a58dd5af76 100644 --- a/crates/router/src/core/payments/operations/payment_session.rs +++ b/crates/router/src/core/payments/operations/payment_session.rs @@ -312,6 +312,7 @@ where _payment_data: &mut PaymentData<F>, _storage_scheme: storage_enums::MerchantStorageScheme, _merchant_key_store: &domain::MerchantKeyStore, + _customer: &Option<domain::Customer>, ) -> RouterResult<( BoxedOperation<'b, F, api::PaymentsSessionRequest, Ctx>, Option<api::PaymentMethodData>, diff --git a/crates/router/src/core/payments/operations/payment_start.rs b/crates/router/src/core/payments/operations/payment_start.rs index ea05cdcb745..557c5c0bd8c 100644 --- a/crates/router/src/core/payments/operations/payment_start.rs +++ b/crates/router/src/core/payments/operations/payment_start.rs @@ -278,6 +278,7 @@ where payment_data: &mut PaymentData<F>, _storage_scheme: storage_enums::MerchantStorageScheme, merchant_key_store: &domain::MerchantKeyStore, + customer: &Option<domain::Customer>, ) -> RouterResult<( BoxedOperation<'a, F, api::PaymentsStartRequest, Ctx>, Option<api::PaymentMethodData>, @@ -289,7 +290,14 @@ where .map(|connector_name| connector_name == *"bluesnap".to_string()) .unwrap_or(false) { - helpers::make_pm_data(Box::new(self), state, payment_data, merchant_key_store).await + helpers::make_pm_data( + Box::new(self), + state, + payment_data, + merchant_key_store, + customer, + ) + .await } else { Ok((Box::new(self), None)) } diff --git a/crates/router/src/core/payments/operations/payment_status.rs b/crates/router/src/core/payments/operations/payment_status.rs index e5db177c83b..c6d9a30f0c9 100644 --- a/crates/router/src/core/payments/operations/payment_status.rs +++ b/crates/router/src/core/payments/operations/payment_status.rs @@ -96,11 +96,19 @@ impl<F: Clone + Send, Ctx: PaymentMethodRetrieve> Domain<F, api::PaymentsRequest payment_data: &mut PaymentData<F>, _storage_scheme: enums::MerchantStorageScheme, merchant_key_store: &domain::MerchantKeyStore, + customer: &Option<domain::Customer>, ) -> RouterResult<( BoxedOperation<'a, F, api::PaymentsRequest, Ctx>, Option<api::PaymentMethodData>, )> { - helpers::make_pm_data(Box::new(self), state, payment_data, merchant_key_store).await + helpers::make_pm_data( + Box::new(self), + state, + payment_data, + merchant_key_store, + customer, + ) + .await } #[instrument(skip_all)] diff --git a/crates/router/src/core/payments/operations/payment_update.rs b/crates/router/src/core/payments/operations/payment_update.rs index 5019a662338..5ed0c45d4e2 100644 --- a/crates/router/src/core/payments/operations/payment_update.rs +++ b/crates/router/src/core/payments/operations/payment_update.rs @@ -428,11 +428,19 @@ impl<F: Clone + Send, Ctx: PaymentMethodRetrieve> Domain<F, api::PaymentsRequest payment_data: &mut PaymentData<F>, _storage_scheme: storage_enums::MerchantStorageScheme, merchant_key_store: &domain::MerchantKeyStore, + customer: &Option<domain::Customer>, ) -> RouterResult<( BoxedOperation<'a, F, api::PaymentsRequest, Ctx>, Option<api::PaymentMethodData>, )> { - helpers::make_pm_data(Box::new(self), state, payment_data, merchant_key_store).await + helpers::make_pm_data( + Box::new(self), + state, + payment_data, + merchant_key_store, + customer, + ) + .await } #[instrument(skip_all)] diff --git a/crates/router/src/core/payments/operations/payments_incremental_authorization.rs b/crates/router/src/core/payments/operations/payments_incremental_authorization.rs index f707fe3a1da..51fdff77c3b 100644 --- a/crates/router/src/core/payments/operations/payments_incremental_authorization.rs +++ b/crates/router/src/core/payments/operations/payments_incremental_authorization.rs @@ -309,6 +309,7 @@ impl<F: Clone + Send, Ctx: PaymentMethodRetrieve> _payment_data: &mut payments::PaymentData<F>, _storage_scheme: enums::MerchantStorageScheme, _merchant_key_store: &domain::MerchantKeyStore, + _customer: &Option<domain::Customer>, ) -> RouterResult<( BoxedOperation<'a, F, PaymentsIncrementalAuthorizationRequest, Ctx>, Option<api::PaymentMethodData>, diff --git a/crates/router/src/core/pm_auth.rs b/crates/router/src/core/pm_auth.rs index 821f049d8cf..0750ff82bf5 100644 --- a/crates/router/src/core/pm_auth.rs +++ b/crates/router/src/core/pm_auth.rs @@ -52,6 +52,7 @@ use crate::{ storage, transformers::ForeignTryFrom, }, + utils::ext_traits::OptionExt, }; pub async fn create_link_token( @@ -618,6 +619,7 @@ pub async fn retrieve_payment_method_from_auth_service( key_store: &domain::MerchantKeyStore, auth_token: &payment_methods::BankAccountConnectorDetails, payment_intent: &PaymentIntent, + customer: &Option<domain::Customer>, ) -> RouterResult<Option<(PaymentMethodData, enums::PaymentMethod)>> { let db = state.store.as_ref(); @@ -710,10 +712,17 @@ pub async fn retrieve_payment_method_from_auth_service( last_name, } }); + + let email = customer + .as_ref() + .and_then(|customer| customer.email.clone()) + .map(common_utils::pii::Email::from) + .get_required_value("email")?; + let payment_method_data = PaymentMethodData::BankDebit(BankDebitData::AchBankDebit { billing_details: BankDebitBilling { name: name.unwrap_or_default(), - email: common_utils::pii::Email::from(masking::Secret::new("".to_string())), + email, address: address_details, }, account_number: masking::Secret::new(bank_account.account_number.clone()), diff --git a/crates/router/tests/connectors/utils.rs b/crates/router/tests/connectors/utils.rs index c27a648a305..db82cd7e032 100644 --- a/crates/router/tests/connectors/utils.rs +++ b/crates/router/tests/connectors/utils.rs @@ -458,7 +458,7 @@ pub trait ConnectorActions: Connector { customer_details: Some(payments::CustomerDetails { customer_id: core_utils::get_or_generate_id("customer_id", &None, "cust_").ok(), name: Some(Secret::new("John Doe".to_string())), - email: TryFrom::try_from("john.doe@example".to_string()).ok(), + email: Email::from_str("john.doe@example").ok(), phone: Some(Secret::new("620874518".to_string())), phone_country_code: Some("+31".to_string()), }), @@ -996,7 +996,7 @@ impl Default for CustomerType { let data = types::ConnectorCustomerData { payment_method_data: types::api::PaymentMethodData::Card(CCardType::default().0), description: None, - email: Some(Email::from(Secret::new("[email protected]".to_string()))), + email: Email::from_str("[email protected]").ok(), phone: None, name: None, preprocessing_id: None,
refactor
pass customer object to `make_pm_data` (#3246)
a7a3f4f44bc01412152d5ef0bed9a3a2d1b07b6b
2023-09-13 15:58:15
Pa1NarK
ci(postman): Modify confirm call to use client-secret instead of relying on API calls (#2127)
false
diff --git a/postman/collection-dir/aci/.event.meta.json b/postman/collection-dir/aci/.event.meta.json index 2df9d47d936..eb871bbcb9b 100644 --- a/postman/collection-dir/aci/.event.meta.json +++ b/postman/collection-dir/aci/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.prerequest.js", - "event.test.js" - ] + "eventOrder": ["event.prerequest.js", "event.test.js"] } diff --git a/postman/collection-dir/aci/.meta.json b/postman/collection-dir/aci/.meta.json index 91b6a65c5bc..d513035ce2d 100644 --- a/postman/collection-dir/aci/.meta.json +++ b/postman/collection-dir/aci/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Health check", - "Flow Testcases" - ] + "childrenOrder": ["Health check", "Flow Testcases"] } diff --git a/postman/collection-dir/aci/Flow Testcases/.meta.json b/postman/collection-dir/aci/Flow Testcases/.meta.json index 1bbce843680..023989e1e49 100644 --- a/postman/collection-dir/aci/Flow Testcases/.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/.meta.json @@ -1,7 +1,3 @@ { - "childrenOrder": [ - "QuickStart", - "Happy Cases", - "Variation Cases" - ] + "childrenOrder": ["QuickStart", "Happy Cases", "Variation Cases"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js index 72f142cc731..c48d8e2d054 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json index 96d94b58059..391390610b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js index c5bae16750d..c48d8e2d054 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json index 96d94b58059..391390610b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js index 01c5b744eac..4974bba662f 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js @@ -1,58 +1,76 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "refunds" -pm.test("[POST]::/payments - Content check if 'refunds' exists", function() { - pm.expect((typeof jsonData.refunds !== "undefined")).to.be.true; +pm.test("[POST]::/payments - Content check if 'refunds' exists", function () { + pm.expect(typeof jsonData.refunds !== "undefined").to.be.true; }); - - - diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js index d28f25fa46d..56ea9efbac0 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "1000" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '1000'", function() { - pm.expect(jsonData.amount).to.eql(1000); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '1000'", + function () { + pm.expect(jsonData.amount).to.eql(1000); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json index b56057fad5d..caed7818578 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js index 04650f547a2..c1dd16a4551 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '540'", function() { - pm.expect(jsonData.amount).to.eql(540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '540'", + function () { + pm.expect(jsonData.amount).to.eql(540); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json index d18aaf8befd..9fe125ce8ea 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js index bfe3137afb0..f0351c05701 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '1000'", function() { - pm.expect(jsonData.amount).to.eql(1000); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '1000'", + function () { + pm.expect(jsonData.amount).to.eql(1000); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js index 7bff0a3c12c..920a7c47f36 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '540'", function() { - pm.expect(jsonData.amount).to.eql(540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '540'", + function () { + pm.expect(jsonData.amount).to.eql(540); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/event.test.js index b9d305e4fc4..1b37dc2c7d1 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/event.test.js @@ -1,65 +1,97 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/request.json index 6076b8af150..f7573b64a60 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/request.json @@ -94,12 +94,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/event.test.js index b94e329999b..db584da2266 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/event.test.js @@ -1,61 +1,87 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/event.test.js index b94e329999b..db584da2266 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/event.test.js @@ -1,61 +1,87 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/event.test.js index 0868d67db09..e2ddde7136f 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/event.test.js @@ -1,65 +1,95 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); // Response body should have "payment_method_data" -pm.test("[POST]::/payments - Content check if 'payment_method_data' exists", function() { - pm.expect((typeof jsonData.payment_method_data !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'payment_method_data' exists", + function () { + pm.expect(typeof jsonData.payment_method_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/request.json index 50b7f3483dd..ff0340f050f 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/request.json @@ -57,12 +57,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/event.test.js index b9d305e4fc4..1b37dc2c7d1 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/event.test.js @@ -1,65 +1,97 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/request.json index 458c385cc88..b66df150887 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/request.json @@ -82,12 +82,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/event.test.js index b94e329999b..db584da2266 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/event.test.js @@ -1,61 +1,87 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/event.test.js index b94e329999b..db584da2266 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/event.test.js @@ -1,61 +1,87 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/event.test.js index d6f055f4ddd..ef2a8b7e7ac 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/event.test.js @@ -1,70 +1,105 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); // Response body should have "payment_method_data" -pm.test("[POST]::/payments - Content check if 'payment_method_data' exists", function() { - pm.expect((typeof jsonData.payment_method_data !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'payment_method_data' exists", + function () { + pm.expect(typeof jsonData.payment_method_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/request.json index 36e88cf096b..fb25f7ceebf 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/request.json @@ -57,12 +57,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/event.test.js index 1c34027de1d..f89b9b86fef 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/request.json index 5e306df7a55..5f4c58816d5 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/event.test.js index 07a9529b82e..6cb4312a60a 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/event.test.js index 56807929c0b..bcdf4509eca 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "ideal" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'ideal'", function() { - pm.expect(jsonData.payment_method_type).to.eql("ideal"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'ideal'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("ideal"); + }, + ); +} // Response body should have value "aci" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'aci'", function() { - pm.expect(jsonData.connector).to.eql("aci"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'aci'", + function () { + pm.expect(jsonData.connector).to.eql("aci"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/request.json index 6c44ab9d4e0..10b88b51748 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_redirect", "payment_method_type": "ideal", "payment_method_data": { @@ -36,14 +57,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/request.json index 87d07a6016b..0b0c56d2660 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/request.json index 6f4d51c5945..61fcdaec2d2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/event.test.js index 95d8adf3219..f95449f65d6 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "sofort" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'sofort'", function() { - pm.expect(jsonData.payment_method_type).to.eql("sofort"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'sofort'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("sofort"); + }, + ); +} // Response body should have value "aci" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'aci'", function() { - pm.expect(jsonData.connector).to.eql("aci"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'aci'", + function () { + pm.expect(jsonData.connector).to.eql("aci"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/request.json index 1b3aca65658..d8c127799e0 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_redirect", "payment_method_type": "sofort", "payment_method_data": { @@ -36,14 +57,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/request.json index 87d07a6016b..0b0c56d2660 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/request.json index 6f4d51c5945..61fcdaec2d2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/event.test.js index dc12d43aea9..6dd37007bd8 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "eps" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'eps'", function() { - pm.expect(jsonData.payment_method_type).to.eql("eps"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'eps'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("eps"); + }, + ); +} // Response body should have value "aci" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'aci'", function() { - pm.expect(jsonData.connector).to.eql("aci"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'aci'", + function () { + pm.expect(jsonData.connector).to.eql("aci"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/request.json index 66d9d486368..451d1c7e9ae 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_redirect", "payment_method_type": "eps", "payment_method_data": { @@ -36,14 +57,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/request.json index 87d07a6016b..0b0c56d2660 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/request.json index 6f4d51c5945..61fcdaec2d2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Interac/Payments - Confirm/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Interac/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Interac/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Interac/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Interac/Payments - Confirm/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Interac/Payments - Confirm/event.test.js index d882eaae675..812d233e15d 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Interac/Payments - Confirm/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Interac/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "interac" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'interac'", function() { - pm.expect(jsonData.payment_method_type).to.eql("interac"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'interac'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("interac"); + }, + ); +} // Response body should have value "aci" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'aci'", function() { - pm.expect(jsonData.connector).to.eql("aci"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'aci'", + function () { + pm.expect(jsonData.connector).to.eql("aci"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Interac/Payments - Confirm/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Interac/Payments - Confirm/request.json index a524a864336..91973e4f480 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Interac/Payments - Confirm/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Interac/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_redirect", "payment_method_type": "interac", "payment_method_data": { @@ -32,14 +53,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Interac/Payments - Create/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Interac/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Interac/Payments - Create/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Interac/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Interac/Payments - Create/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Interac/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Interac/Payments - Create/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Interac/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Interac/Payments - Create/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Interac/Payments - Create/request.json index 4c13d9f76fe..45ad6103f65 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Interac/Payments - Create/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Interac/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Interac/Payments - Retrieve/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Interac/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Interac/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Interac/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Interac/Payments - Retrieve/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Interac/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Interac/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Interac/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Interac/Payments - Retrieve/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Interac/Payments - Retrieve/request.json index 6f4d51c5945..61fcdaec2d2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Interac/Payments - Retrieve/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Interac/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-P24/Payments - Confirm/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-P24/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-P24/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-P24/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-P24/Payments - Confirm/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-P24/Payments - Confirm/event.test.js index be6cf8f63c1..b345575d7c5 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-P24/Payments - Confirm/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-P24/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "przelewy24" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'przelewy24'", function() { - pm.expect(jsonData.payment_method_type).to.eql("przelewy24"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'przelewy24'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("przelewy24"); + }, + ); +} // Response body should have value "aci" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'aci'", function() { - pm.expect(jsonData.connector).to.eql("aci"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'aci'", + function () { + pm.expect(jsonData.connector).to.eql("aci"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-P24/Payments - Confirm/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-P24/Payments - Confirm/request.json index 3eebeb83ed5..fe8cdfad1fa 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-P24/Payments - Confirm/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-P24/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_redirect", "payment_method_type": "przelewy24", "payment_method_data": { @@ -33,14 +54,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-P24/Payments - Create/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-P24/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-P24/Payments - Create/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-P24/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-P24/Payments - Create/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-P24/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-P24/Payments - Create/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-P24/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-P24/Payments - Create/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-P24/Payments - Create/request.json index adcb89217e3..a0c6e62811b 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-P24/Payments - Create/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-P24/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-P24/Payments - Retrieve/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-P24/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-P24/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-P24/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-P24/Payments - Retrieve/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-P24/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-P24/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-P24/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-P24/Payments - Retrieve/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-P24/Payments - Retrieve/request.json index 6f4d51c5945..61fcdaec2d2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-P24/Payments - Retrieve/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-P24/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Trustly/Payments - Confirm/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Trustly/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Trustly/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Trustly/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Trustly/Payments - Confirm/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Trustly/Payments - Confirm/event.test.js index 47d880e198e..3cac8e5c799 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Trustly/Payments - Confirm/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Trustly/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "trustly" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'trustly'", function() { - pm.expect(jsonData.payment_method_type).to.eql("trustly"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'trustly'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("trustly"); + }, + ); +} // Response body should have value "aci" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'aci'", function() { - pm.expect(jsonData.connector).to.eql("aci"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'aci'", + function () { + pm.expect(jsonData.connector).to.eql("aci"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Trustly/Payments - Confirm/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Trustly/Payments - Confirm/request.json index 1c5b8a5b54c..562e8ea192a 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Trustly/Payments - Confirm/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Trustly/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_redirect", "payment_method_type": "trustly", "payment_method_data": { @@ -31,14 +52,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Trustly/Payments - Create/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Trustly/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Trustly/Payments - Create/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Trustly/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Trustly/Payments - Create/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Trustly/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Trustly/Payments - Create/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Trustly/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Trustly/Payments - Create/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Trustly/Payments - Create/request.json index b17bf977946..8f091a4238b 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Trustly/Payments - Create/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Trustly/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Trustly/Payments - Retrieve/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Trustly/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Trustly/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Trustly/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Trustly/Payments - Retrieve/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Trustly/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Trustly/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Trustly/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Trustly/Payments - Retrieve/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Trustly/Payments - Retrieve/request.json index 6f4d51c5945..61fcdaec2d2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Trustly/Payments - Retrieve/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-Trustly/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/event.test.js index 74c39962661..b49dde3b350 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "giropay" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'giropay'", function() { - pm.expect(jsonData.payment_method_type).to.eql("giropay"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'giropay'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("giropay"); + }, + ); +} // Response body should have value "aci" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'aci'", function() { - pm.expect(jsonData.connector).to.eql("aci"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'aci'", + function () { + pm.expect(jsonData.connector).to.eql("aci"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/request.json index 70123c3aba7..caf10ddd35d 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_redirect", "payment_method_type": "giropay", "payment_method_data": { @@ -36,14 +57,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/request.json index 87d07a6016b..0b0c56d2660 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/request.json index 6f4d51c5945..61fcdaec2d2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-alipay/Payments - Confirm/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-alipay/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-alipay/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-alipay/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-alipay/Payments - Confirm/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-alipay/Payments - Confirm/event.test.js index 365e6516873..9198331897a 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-alipay/Payments - Confirm/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-alipay/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "ali_pay" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'ali_pay'", function() { - pm.expect(jsonData.payment_method_type).to.eql("ali_pay"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'ali_pay'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("ali_pay"); + }, + ); +} // Response body should have value "aci" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'aci'", function() { - pm.expect(jsonData.connector).to.eql("aci"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'aci'", + function () { + pm.expect(jsonData.connector).to.eql("aci"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-alipay/Payments - Confirm/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-alipay/Payments - Confirm/request.json index f827e935251..a5500b44311 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-alipay/Payments - Confirm/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-alipay/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "wallet", "payment_method_type": "ali_pay", "payment_method_data": { @@ -29,14 +50,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-alipay/Payments - Create/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-alipay/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-alipay/Payments - Create/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-alipay/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-alipay/Payments - Create/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-alipay/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-alipay/Payments - Create/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-alipay/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-alipay/Payments - Create/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-alipay/Payments - Create/request.json index 4c13d9f76fe..45ad6103f65 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-alipay/Payments - Create/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-alipay/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-alipay/Payments - Retrieve/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-alipay/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-alipay/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-alipay/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-alipay/Payments - Retrieve/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-alipay/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-alipay/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-alipay/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-alipay/Payments - Retrieve/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-alipay/Payments - Retrieve/request.json index 6f4d51c5945..61fcdaec2d2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-alipay/Payments - Retrieve/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-alipay/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Confirm/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Confirm/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Confirm/event.test.js index e3746655cbe..ee018a4342a 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Confirm/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Confirm/event.test.js @@ -1,60 +1,84 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "mb_way" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'mb_way'", function() { - pm.expect(jsonData.payment_method_type).to.eql("mb_way"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'mb_way'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("mb_way"); + }, + ); +} // Response body should have value "aci" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'aci'", function() { - pm.expect(jsonData.connector).to.eql("aci"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'aci'", + function () { + pm.expect(jsonData.connector).to.eql("aci"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Confirm/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Confirm/request.json index fd87741b52c..8472328c9d2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Confirm/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "wallet", "payment_method_type": "mb_way", "payment_method_data": { @@ -31,14 +52,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Create/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Create/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Create/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Create/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Create/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Create/request.json index b17bf977946..8f091a4238b 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Create/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Retrieve/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Retrieve/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Retrieve/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Retrieve/event.prerequest.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Retrieve/event.prerequest.js index 93c17927dfa..dea419d4845 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Retrieve/event.prerequest.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Retrieve/event.prerequest.js @@ -1,4 +1,4 @@ -//For delay -setTimeout(function(){ - console.log("Sleeping for 5 seconds before next request."); - }, 5000); +//For delay +setTimeout(function () { + console.log("Sleeping for 5 seconds before next request."); +}, 5000); diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Retrieve/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Retrieve/event.test.js index c96ba653323..aced67dbfb7 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Retrieve/event.test.js @@ -1,52 +1,71 @@ - - -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); - -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Retrieve/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Retrieve/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario18-Wallet-mbway/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js index bb50904fd89..f92fba3d044 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js index 5698484c741..55dc35b9128 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json index ff77cfb1512..4e0c4dcc866 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js index 03ccae1adb0..aced67dbfb7 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js index 5d9e5785e6e..6d812bc75fe 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id/confirm - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id/confirm - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json index a4b949c5f75..44d8dd9bf73 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "card", "payment_method_data": { "card": { @@ -32,14 +53,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json index b28abd0c309..e3b1e235042 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json @@ -67,12 +67,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js index 03ccae1adb0..aced67dbfb7 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js index 9632bd19048..dcf3f191643 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js @@ -1,43 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/cancel - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type 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(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "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"); -})}; - - - + pm.test( + "[POST]::/payments/:id/cancel - Content check if value for 'status' matches 'cancelled'", + function () { + pm.expect(jsonData.status).to.eql("cancelled"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js index d8a332a994e..55dc35b9128 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json index 5c68a85a857..66f6af43a82 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js index f4e0ab9b2aa..5e52e13a59e 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "cancelled" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'", function() { - pm.expect(jsonData.status).to.eql("cancelled"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'", + function () { + pm.expect(jsonData.status).to.eql("cancelled"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json index 96d94b58059..391390610b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js index 1c34027de1d..f89b9b86fef 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json index 5e306df7a55..5f4c58816d5 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js index 07a9529b82e..6cb4312a60a 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/aci/Flow Testcases/QuickStart/API Key - Create/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/QuickStart/API Key - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/QuickStart/API Key - Create/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/QuickStart/API Key - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/QuickStart/API Key - Create/event.test.js b/postman/collection-dir/aci/Flow Testcases/QuickStart/API Key - Create/event.test.js index bc42e83a761..4e27c5a5025 100644 --- a/postman/collection-dir/aci/Flow Testcases/QuickStart/API Key - Create/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/QuickStart/API Key - Create/event.test.js @@ -1,32 +1,46 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/api_keys/:merchant_id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/api_keys/:merchant_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/api_keys/:merchant_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; try { jsonData = pm.response.json(); -} catch(e) { -} +} catch (e) {} // pm.collectionVariables - Set api_key_id as variable for jsonData.key_id if (jsonData?.key_id) { - pm.collectionVariables.set("api_key_id", jsonData.key_id); - console.log("- use {{api_key_id}} as collection variable for value", jsonData.key_id); + pm.collectionVariables.set("api_key_id", jsonData.key_id); + console.log( + "- use {{api_key_id}} as collection variable for value", + jsonData.key_id, + ); } else { - console.log('INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value", jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/QuickStart/API Key - Create/request.json b/postman/collection-dir/aci/Flow Testcases/QuickStart/API Key - Create/request.json index 29c2490d1bc..2210d14da0e 100644 --- a/postman/collection-dir/aci/Flow Testcases/QuickStart/API Key - Create/request.json +++ b/postman/collection-dir/aci/Flow Testcases/QuickStart/API Key - Create/request.json @@ -35,13 +35,8 @@ }, "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/aci/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/aci/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js b/postman/collection-dir/aci/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js index 710fc4c85c3..d3d62bd40e0 100644 --- a/postman/collection-dir/aci/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js @@ -1,36 +1,55 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - 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]::/accounts - 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", + ); }); // 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 merchant_id as variable for jsonData.merchant_id if (jsonData?.merchant_id) { - pm.collectionVariables.set("merchant_id", jsonData.merchant_id); - console.log("- use {{merchant_id}} as collection variable for value",jsonData.merchant_id); + pm.collectionVariables.set("merchant_id", jsonData.merchant_id); + console.log( + "- use {{merchant_id}} as collection variable for value", + jsonData.merchant_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value",jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} // pm.collectionVariables - Set publishable_key as variable for jsonData.publishable_key if (jsonData?.publishable_key) { - pm.collectionVariables.set("publishable_key", jsonData.publishable_key); - console.log("- use {{publishable_key}} as collection variable for value",jsonData.publishable_key); + pm.collectionVariables.set("publishable_key", jsonData.publishable_key); + console.log( + "- use {{publishable_key}} as collection variable for value", + jsonData.publishable_key, + ); } else { - console.log('INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.", + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/QuickStart/Merchant Account - Create/request.json b/postman/collection-dir/aci/Flow Testcases/QuickStart/Merchant Account - Create/request.json index ffeea3410a4..dcbf46ee538 100644 --- a/postman/collection-dir/aci/Flow Testcases/QuickStart/Merchant Account - Create/request.json +++ b/postman/collection-dir/aci/Flow Testcases/QuickStart/Merchant Account - Create/request.json @@ -84,12 +84,8 @@ }, "url": { "raw": "{{baseUrl}}/accounts", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "accounts" - ] + "host": ["{{baseUrl}}"], + "path": ["accounts"] }, "description": "Create a new account for a merchant. The merchant could be a seller or retailer or client who likes to receive and send payments." } diff --git a/postman/collection-dir/aci/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js b/postman/collection-dir/aci/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js index 28f23227607..88e92d8d84a 100644 --- a/postman/collection-dir/aci/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js @@ -1,22 +1,39 @@ -// Validate status 2xx -pm.test("[POST]::/account/:account_id/connectors - 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.be.success; + }, +); // Validate if response header has matching content-type -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"); -}); +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){} - +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id if (jsonData?.merchant_connector_id) { - pm.collectionVariables.set("merchant_connector_id", jsonData.merchant_connector_id); - console.log("- use {{merchant_connector_id}} as collection variable for value",jsonData.merchant_connector_id); + pm.collectionVariables.set( + "merchant_connector_id", + jsonData.merchant_connector_id, + ); + console.log( + "- use {{merchant_connector_id}} as collection variable for value", + jsonData.merchant_connector_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.", + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/QuickStart/Payment Connector - Create/request.json b/postman/collection-dir/aci/Flow Testcases/QuickStart/Payment Connector - Create/request.json index a131b501057..086a81d9540 100644 --- a/postman/collection-dir/aci/Flow Testcases/QuickStart/Payment Connector - Create/request.json +++ b/postman/collection-dir/aci/Flow Testcases/QuickStart/Payment Connector - Create/request.json @@ -191,14 +191,8 @@ }, "url": { "raw": "{{baseUrl}}/account/:account_id/connectors", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/aci/Flow Testcases/QuickStart/Payments - Create/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/QuickStart/Payments - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/aci/Flow Testcases/QuickStart/Payments - Create/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/QuickStart/Payments - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/QuickStart/Payments - Create/event.test.js b/postman/collection-dir/aci/Flow Testcases/QuickStart/Payments - Create/event.test.js index 62142d52dca..a6947db94c0 100644 --- a/postman/collection-dir/aci/Flow Testcases/QuickStart/Payments - Create/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/QuickStart/Payments - Create/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/QuickStart/Payments - Create/request.json b/postman/collection-dir/aci/Flow Testcases/QuickStart/Payments - Create/request.json index 941ad5a3db0..d3bbe200c59 100644 --- a/postman/collection-dir/aci/Flow Testcases/QuickStart/Payments - Create/request.json +++ b/postman/collection-dir/aci/Flow Testcases/QuickStart/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/aci/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js b/postman/collection-dir/aci/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js index 4dd072b2222..d0a02af7436 100644 --- a/postman/collection-dir/aci/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // 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.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/QuickStart/Payments - Retrieve/request.json b/postman/collection-dir/aci/Flow Testcases/QuickStart/Payments - Retrieve/request.json index c71774083b2..ef0b213739d 100644 --- a/postman/collection-dir/aci/Flow Testcases/QuickStart/Payments - Retrieve/request.json +++ b/postman/collection-dir/aci/Flow Testcases/QuickStart/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/aci/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/QuickStart/Refunds - Create/event.test.js b/postman/collection-dir/aci/Flow Testcases/QuickStart/Refunds - Create/event.test.js index c862e8e68a7..dbc930608cb 100644 --- a/postman/collection-dir/aci/Flow Testcases/QuickStart/Refunds - Create/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/QuickStart/Refunds - Create/event.test.js @@ -1,21 +1,30 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/QuickStart/Refunds - Create/request.json b/postman/collection-dir/aci/Flow Testcases/QuickStart/Refunds - Create/request.json index 4dbca4d01f2..0c13281ee15 100644 --- a/postman/collection-dir/aci/Flow Testcases/QuickStart/Refunds - Create/request.json +++ b/postman/collection-dir/aci/Flow Testcases/QuickStart/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/aci/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js b/postman/collection-dir/aci/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js index b1e1f12ba50..bbd8e544e2c 100644 --- a/postman/collection-dir/aci/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js @@ -1,22 +1,30 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); - // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/QuickStart/Refunds - Retrieve/request.json b/postman/collection-dir/aci/Flow Testcases/QuickStart/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/aci/Flow Testcases/QuickStart/Refunds - Retrieve/request.json +++ b/postman/collection-dir/aci/Flow Testcases/QuickStart/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js index 6c48697032e..15a759e4d78 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js @@ -1,54 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 "invalid_request" 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"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json index ad281c58256..9cbdbc8e22f 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js index 8c32d60ef55..15a759e4d78 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js @@ -1,56 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); - // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 "invalid_request" 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"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json index 99a24fb4f26..8a9df91718d 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js index 0e6401222ff..52680771c31 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js @@ -1,55 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector_error'", function() { - pm.expect(jsonData.error.type).to.eql("connector_error"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'", + function () { + pm.expect(jsonData.error.type).to.eql("connector_error"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json index 0a16b975817..c7ad4cb2749 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json @@ -75,12 +75,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js index 630c4f25cae..3976f7f496a 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js @@ -1,55 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector'", function() { - pm.expect(jsonData.error.type).to.eql("connector"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector'", + function () { + pm.expect(jsonData.error.type).to.eql("connector"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json index 79a70e782fc..d68379f9444 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json index 90b19864ee1..f2bee31ef66 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Confirm" - ] + "childrenOrder": ["Payments - Create", "Payments - Confirm"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js index 1e8ba8cc3a6..e8d6b2216c5 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js @@ -1,58 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); -}); - - +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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json index b28abd0c309..e3b1e235042 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json @@ -67,12 +67,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json index cafd3a6808e..6df7c0a1943 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Capture" - ] + "childrenOrder": ["Payments - Create", "Payments - Capture"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js index c3e7afc6760..46bf201d1ce 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js @@ -1,59 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json index 766a8330d6e..6c934a9132c 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json index 96d94b58059..391390610b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json index afba25ab6d6..5ff1a7cb4e8 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Cancel" - ] + "childrenOrder": ["Payments - Create", "Payments - Cancel"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js index d7879c70d87..0f869a6dfb8 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js @@ -1,50 +1,69 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/cancel - Status code is 4xx", function () { - pm.response.to.be.error; + 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/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/cancel - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; - - - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json index 96d94b58059..391390610b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json index 96d94b58059..391390610b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js index 9537daf6187..776dbd70712 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js @@ -1,33 +1,48 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/refunds - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + 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; -}); +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"); -})}; - + 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"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json index 326319e8fdf..10de81bed08 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js index 65232a76373..55dc35b9128 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; - - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json index 7186bddbe07..119353069bd 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js index 42bf3e0ac45..fdb8a946f3d 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js index 30888b5cc0c..d3c4451760d 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js @@ -1,32 +1,48 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/refunds - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + 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; -}); +pm.test( + "[POST]::/payments/:id/confirm - Content check if 'error' exists", + function () { + pm.expect(typeof jsonData.error !== "undefined").to.be.true; + }, +); // Response body should have value "invalid_request" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; + pm.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"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json index d18aaf8befd..9fe125ce8ea 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/event.test.js b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/event.test.js index b9d305e4fc4..1b37dc2c7d1 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/event.test.js @@ -1,65 +1,97 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/request.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/request.json index 6076b8af150..f7573b64a60 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/request.json @@ -94,12 +94,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/event.test.js b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/event.test.js index b94e329999b..db584da2266 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/event.test.js @@ -1,61 +1,87 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/request.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/.event.meta.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/.event.meta.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/event.test.js b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/event.test.js index 22617f827cf..e862404c2b2 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/event.test.js +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/event.test.js @@ -1,56 +1,79 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/confirm - Content check if 'error' exists", + function () { + pm.expect(typeof jsonData.error !== "undefined").to.be.true; + }, +); // Response body should have value "invalid_request" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; - - + pm.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"); + }, + ); +} diff --git a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json index d2c4a106d65..8fc4831ccc3 100644 --- a/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json +++ b/postman/collection-dir/aci/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json @@ -69,12 +69,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/aci/Health check/.meta.json b/postman/collection-dir/aci/Health check/.meta.json index 66ee7e50cab..579f9fd541c 100644 --- a/postman/collection-dir/aci/Health check/.meta.json +++ b/postman/collection-dir/aci/Health check/.meta.json @@ -1,5 +1,3 @@ { - "childrenOrder": [ - "New Request" - ] + "childrenOrder": ["New Request"] } diff --git a/postman/collection-dir/aci/Health check/New Request/.event.meta.json b/postman/collection-dir/aci/Health check/New Request/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/aci/Health check/New Request/.event.meta.json +++ b/postman/collection-dir/aci/Health check/New Request/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/aci/Health check/New Request/event.test.js b/postman/collection-dir/aci/Health check/New Request/event.test.js index 325a8c8a479..b490b8be090 100644 --- a/postman/collection-dir/aci/Health check/New Request/event.test.js +++ b/postman/collection-dir/aci/Health check/New Request/event.test.js @@ -1,4 +1,4 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - Status code is 2xx", function () { - pm.response.to.be.success; -}); \ No newline at end of file + pm.response.to.be.success; +}); diff --git a/postman/collection-dir/aci/Health check/New Request/request.json b/postman/collection-dir/aci/Health check/New Request/request.json index 4cc8d4b1a96..e40e9396178 100644 --- a/postman/collection-dir/aci/Health check/New Request/request.json +++ b/postman/collection-dir/aci/Health check/New Request/request.json @@ -10,11 +10,7 @@ ], "url": { "raw": "{{baseUrl}}/health", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "health" - ] + "host": ["{{baseUrl}}"], + "path": ["health"] } } diff --git a/postman/collection-dir/aci/event.test.js b/postman/collection-dir/aci/event.test.js index 69037688f22..fb52caec30f 100644 --- a/postman/collection-dir/aci/event.test.js +++ b/postman/collection-dir/aci/event.test.js @@ -1,11 +1,13 @@ // 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("[LOG]::payment_id - " + jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log("[LOG]::payment_id - " + jsonData.payment_id); } -console.log("[LOG]::x-request-id - " + pm.response.headers.get('x-request-id')); \ No newline at end of file +console.log("[LOG]::x-request-id - " + pm.response.headers.get("x-request-id")); diff --git a/postman/collection-dir/adyen_uk/.event.meta.json b/postman/collection-dir/adyen_uk/.event.meta.json index 2df9d47d936..eb871bbcb9b 100644 --- a/postman/collection-dir/adyen_uk/.event.meta.json +++ b/postman/collection-dir/adyen_uk/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.prerequest.js", - "event.test.js" - ] + "eventOrder": ["event.prerequest.js", "event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/.meta.json b/postman/collection-dir/adyen_uk/.meta.json index 91b6a65c5bc..d513035ce2d 100644 --- a/postman/collection-dir/adyen_uk/.meta.json +++ b/postman/collection-dir/adyen_uk/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Health check", - "Flow Testcases" - ] + "childrenOrder": ["Health check", "Flow Testcases"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/.meta.json index 1bbce843680..023989e1e49 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/.meta.json @@ -1,7 +1,3 @@ { - "childrenOrder": [ - "QuickStart", - "Happy Cases", - "Variation Cases" - ] + "childrenOrder": ["QuickStart", "Happy Cases", "Variation Cases"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js index 72f142cc731..c48d8e2d054 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json index 08c88256395..ad2b0902947 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json @@ -78,12 +78,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js index c5bae16750d..c48d8e2d054 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json index 08c88256395..ad2b0902947 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json @@ -78,12 +78,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js index 01c5b744eac..4974bba662f 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js @@ -1,58 +1,76 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "refunds" -pm.test("[POST]::/payments - Content check if 'refunds' exists", function() { - pm.expect((typeof jsonData.refunds !== "undefined")).to.be.true; +pm.test("[POST]::/payments - Content check if 'refunds' exists", function () { + pm.expect(typeof jsonData.refunds !== "undefined").to.be.true; }); - - - diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js index 47a24658e0e..ca5a5b5d712 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'pending'", function() { - pm.expect(jsonData.status).to.eql("pending"); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'status' matches 'pending'", + function () { + pm.expect(jsonData.status).to.eql("pending"); + }, + ); +} // Response body should have value "1000" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '1000'", function() { - pm.expect(jsonData.amount).to.eql(1000); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '1000'", + function () { + pm.expect(jsonData.amount).to.eql(1000); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json index 61e80a7b1e2..7d812dd1bea 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js index 6f87a195571..68a0024f331 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'pending'", function() { - pm.expect(jsonData.status).to.eql("pending"); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'status' matches 'pending'", + function () { + pm.expect(jsonData.status).to.eql("pending"); + }, + ); +} // Response body should have value "540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '540'", function() { - pm.expect(jsonData.amount).to.eql(540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '540'", + function () { + pm.expect(jsonData.amount).to.eql(540); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json index c942e3b4b4f..204f002f3c2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js index 433ffbb873e..7bdd4b191b1 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'pending'", function() { - pm.expect(jsonData.status).to.eql("pending"); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'status' matches 'pending'", + function () { + pm.expect(jsonData.status).to.eql("pending"); + }, + ); +} // Response body should have value "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '1000'", function() { - pm.expect(jsonData.amount).to.eql(1000); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '1000'", + function () { + pm.expect(jsonData.amount).to.eql(1000); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js index 0c0b8da69f4..86f67eb8f5c 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'pending'", function() { - pm.expect(jsonData.status).to.eql("pending"); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'status' matches 'pending'", + function () { + pm.expect(jsonData.status).to.eql("pending"); + }, + ); +} // Response body should have value "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '540'", function() { - pm.expect(jsonData.amount).to.eql(540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '540'", + function () { + pm.expect(jsonData.amount).to.eql(540); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/event.test.js index b9d305e4fc4..1b37dc2c7d1 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/event.test.js @@ -1,65 +1,97 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/request.json index 07f61127f44..80dad74bb60 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/request.json @@ -95,12 +95,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/event.test.js index b94e329999b..db584da2266 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/event.test.js @@ -1,61 +1,87 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/event.test.js index b94e329999b..db584da2266 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/event.test.js @@ -1,61 +1,87 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/event.test.js index 0868d67db09..e2ddde7136f 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/event.test.js @@ -1,65 +1,95 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); // Response body should have "payment_method_data" -pm.test("[POST]::/payments - Content check if 'payment_method_data' exists", function() { - pm.expect((typeof jsonData.payment_method_data !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'payment_method_data' exists", + function () { + pm.expect(typeof jsonData.payment_method_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/request.json index 50b7f3483dd..ff0340f050f 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/request.json @@ -57,12 +57,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/event.test.js index b9d305e4fc4..1b37dc2c7d1 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/event.test.js @@ -1,65 +1,97 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/request.json index 7098aa4d9c3..08e62dca6e9 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/request.json @@ -83,12 +83,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/event.test.js index b94e329999b..db584da2266 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/event.test.js @@ -1,61 +1,87 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/event.test.js index b94e329999b..db584da2266 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/event.test.js @@ -1,61 +1,87 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/event.test.js index d6f055f4ddd..ef2a8b7e7ac 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/event.test.js @@ -1,70 +1,105 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); // Response body should have "payment_method_data" -pm.test("[POST]::/payments - Content check if 'payment_method_data' exists", function() { - pm.expect((typeof jsonData.payment_method_data !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'payment_method_data' exists", + function () { + pm.expect(typeof jsonData.payment_method_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/request.json index 36e88cf096b..fb25f7ceebf 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/request.json @@ -57,12 +57,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/event.test.js index db627313d75..d49c0aaea58 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'pending'", function() { - pm.expect(jsonData.status).to.eql("pending"); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'status' matches 'pending'", + function () { + pm.expect(jsonData.status).to.eql("pending"); + }, + ); +} // Response body should have value "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/request.json index 877fd1721ae..3d050b53e9d 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/event.test.js index d84dc204779..3793dbdc017 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'pending'", function() { - pm.expect(jsonData.status).to.eql("pending"); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'status' matches 'pending'", + function () { + pm.expect(jsonData.status).to.eql("pending"); + }, + ); +} // Response body should have value "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/event.test.js index dd67fe0d9d0..d4b9fbead7e 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "sofort" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'sofort'", function() { - pm.expect(jsonData.payment_method_type).to.eql("sofort"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'sofort'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("sofort"); + }, + ); +} // Response body should have value "stripe" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'adyen'", function() { - pm.expect(jsonData.connector).to.eql("adyen"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'adyen'", + function () { + pm.expect(jsonData.connector).to.eql("adyen"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/request.json index 5928a53a51d..001749a500f 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_redirect", "payment_method_type": "sofort", "payment_method_data": { @@ -48,14 +69,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/request.json index 87d07a6016b..0b0c56d2660 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/event.test.js index df67cbc276b..8cf6f699e49 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "eps" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'eps'", function() { - pm.expect(jsonData.payment_method_type).to.eql("eps"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'eps'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("eps"); + }, + ); +} // Response body should have value "adyen" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'adyen'", function() { - pm.expect(jsonData.connector).to.eql("adyen"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'adyen'", + function () { + pm.expect(jsonData.connector).to.eql("adyen"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/request.json index b0d693554e2..69caec8548c 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_redirect", "payment_method_type": "eps", "payment_method_data": { @@ -48,14 +69,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/request.json index e96d4d53573..c0e81453375 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/event.test.js index 5cc9cc16b20..924d98f8f9d 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "giropay" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'giropay'", function() { - pm.expect(jsonData.payment_method_type).to.eql("giropay"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'giropay'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("giropay"); + }, + ); +} // Response body should have value "stripe" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'adyen'", function() { - pm.expect(jsonData.connector).to.eql("adyen"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'adyen'", + function () { + pm.expect(jsonData.connector).to.eql("adyen"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/request.json index 46a8ae18891..384d0bfc486 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_redirect", "payment_method_type": "giropay", "payment_method_data": { @@ -48,14 +69,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/request.json index b17bf977946..8f091a4238b 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank Redirect-Trustly/Payments - Confirm/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank Redirect-Trustly/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank Redirect-Trustly/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank Redirect-Trustly/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank Redirect-Trustly/Payments - Confirm/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank Redirect-Trustly/Payments - Confirm/event.test.js index a61c49c4768..963978bdbf9 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank Redirect-Trustly/Payments - Confirm/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank Redirect-Trustly/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "giropay" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'trustly'", function() { - pm.expect(jsonData.payment_method_type).to.eql("trustly"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'trustly'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("trustly"); + }, + ); +} // Response body should have value "stripe" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'adyen'", function() { - pm.expect(jsonData.connector).to.eql("adyen"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'adyen'", + function () { + pm.expect(jsonData.connector).to.eql("adyen"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank Redirect-Trustly/Payments - Confirm/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank Redirect-Trustly/Payments - Confirm/request.json index d83e921dbef..4a26505c3e7 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank Redirect-Trustly/Payments - Confirm/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank Redirect-Trustly/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_redirect", "payment_method_type": "trustly", "payment_method_data": { @@ -48,14 +69,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank Redirect-Trustly/Payments - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank Redirect-Trustly/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank Redirect-Trustly/Payments - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank Redirect-Trustly/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank Redirect-Trustly/Payments - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank Redirect-Trustly/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank Redirect-Trustly/Payments - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank Redirect-Trustly/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank Redirect-Trustly/Payments - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank Redirect-Trustly/Payments - Create/request.json index 790d59c010d..f125b63232a 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank Redirect-Trustly/Payments - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank Redirect-Trustly/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank Redirect-Trustly/Payments - Retrieve/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank Redirect-Trustly/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank Redirect-Trustly/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank Redirect-Trustly/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank Redirect-Trustly/Payments - Retrieve/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank Redirect-Trustly/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank Redirect-Trustly/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank Redirect-Trustly/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank Redirect-Trustly/Payments - Retrieve/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank Redirect-Trustly/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank Redirect-Trustly/Payments - Retrieve/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank Redirect-Trustly/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-Bacs/Payments - Confirm/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-Bacs/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-Bacs/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-Bacs/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-Bacs/Payments - Confirm/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-Bacs/Payments - Confirm/event.test.js index 79af61d6719..38db0d9d7b7 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-Bacs/Payments - Confirm/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-Bacs/Payments - Confirm/event.test.js @@ -1,65 +1,94 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} // Response body should have value "bacs" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'bacs'", function() { - pm.expect(jsonData.payment_method_type).to.eql("bacs"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'bacs'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("bacs"); + }, + ); +} // Response body should have value "adyen" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'adyen'", function() { - pm.expect(jsonData.connector).to.eql("adyen"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'adyen'", + function () { + pm.expect(jsonData.connector).to.eql("adyen"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-Bacs/Payments - Confirm/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-Bacs/Payments - Confirm/request.json index b79a477d4b3..0d66f04b260 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-Bacs/Payments - Confirm/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-Bacs/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_debit", "payment_method_type": "bacs", "payment_method_data": { @@ -47,14 +68,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-Bacs/Payments - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-Bacs/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-Bacs/Payments - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-Bacs/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-Bacs/Payments - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-Bacs/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-Bacs/Payments - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-Bacs/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-Bacs/Payments - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-Bacs/Payments - Create/request.json index 59c18cecfb1..9340a493524 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-Bacs/Payments - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-Bacs/Payments - Create/request.json @@ -79,12 +79,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-Bacs/Payments - Retrieve/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-Bacs/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-Bacs/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-Bacs/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-Bacs/Payments - Retrieve/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-Bacs/Payments - Retrieve/event.test.js index 2056e33b7b7..03b39a354a3 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-Bacs/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-Bacs/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-Bacs/Payments - Retrieve/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-Bacs/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-Bacs/Payments - Retrieve/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-Bacs/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-ach/Payments - Confirm/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-ach/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-ach/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-ach/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-ach/Payments - Confirm/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-ach/Payments - Confirm/event.test.js index bc61459911e..44097765fc1 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-ach/Payments - Confirm/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-ach/Payments - Confirm/event.test.js @@ -1,65 +1,94 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "ach" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'ach'", function() { - pm.expect(jsonData.payment_method_type).to.eql("ach"); -})}; + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'ach'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("ach"); + }, + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have value "stripe" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'adyen'", function() { - pm.expect(jsonData.connector).to.eql("adyen"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'adyen'", + function () { + pm.expect(jsonData.connector).to.eql("adyen"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-ach/Payments - Confirm/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-ach/Payments - Confirm/request.json index cb975fd8463..b44ff93eca9 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-ach/Payments - Confirm/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-ach/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_debit", "payment_method_type": "ach", "payment_method_data": { @@ -59,14 +80,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-ach/Payments - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-ach/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-ach/Payments - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-ach/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-ach/Payments - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-ach/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-ach/Payments - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-ach/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-ach/Payments - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-ach/Payments - Create/request.json index 3df4972d59d..bc160467bf8 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-ach/Payments - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-ach/Payments - Create/request.json @@ -79,12 +79,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-ach/Payments - Retrieve/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-ach/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-ach/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-ach/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-ach/Payments - Retrieve/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-ach/Payments - Retrieve/event.test.js index 03ccae1adb0..aced67dbfb7 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-ach/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-ach/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-ach/Payments - Retrieve/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-ach/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-ach/Payments - Retrieve/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Bank debit-ach/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js index bb50904fd89..f92fba3d044 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js index 5698484c741..55dc35b9128 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json index c1bbfb7132d..6a90dc1f517 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json @@ -78,12 +78,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js index 03ccae1adb0..aced67dbfb7 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js index 5d9e5785e6e..6d812bc75fe 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id/confirm - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id/confirm - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json index e9112cf187e..770b7326827 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { @@ -33,14 +54,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json index b28abd0c309..e3b1e235042 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json @@ -67,12 +67,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js index 03ccae1adb0..aced67dbfb7 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js index 0184786f838..fa72b8541ff 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js @@ -1,68 +1,94 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/capture - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); - -// Validate if response has JSON Body +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.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} - +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]:://payments/:id/capture - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; + pm.test( + "[POST]:://payments/:id/capture - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "6000" for "amount_received" if (jsonData?.amount_received) { -pm.test("[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", function() { - pm.expect(jsonData.amount_received).to.eql(6000); -})}; - - - - + pm.test( + "[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", + function () { + pm.expect(jsonData.amount_received).to.eql(6000); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json index 8975575ca40..9fe257ed85e 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js index b0e69cad2c2..d683186aa00 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json index 12f29b8d109..3f21848a011 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json @@ -78,12 +78,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js index 6fee033b3ed..c5914be3250 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json index c71774083b2..ef0b213739d 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js index 9632bd19048..dcf3f191643 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js @@ -1,43 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/cancel - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type 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(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "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"); -})}; - - - + pm.test( + "[POST]::/payments/:id/cancel - Content check if value for 'status' matches 'cancelled'", + function () { + pm.expect(jsonData.status).to.eql("cancelled"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js index b0e69cad2c2..d683186aa00 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json index 12f29b8d109..3f21848a011 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json @@ -78,12 +78,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js index f4e0ab9b2aa..5e52e13a59e 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "cancelled" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'", function() { - pm.expect(jsonData.status).to.eql("cancelled"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'", + function () { + pm.expect(jsonData.status).to.eql("cancelled"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js index 1388cde7c89..39cbb3ee90e 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js @@ -1,54 +1,80 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", function() { - pm.expect(jsonData.status).to.eql("requires_customer_action"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", + function () { + pm.expect(jsonData.status).to.eql("requires_customer_action"); + }, + ); +} // Response body should have "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; -}); +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; + }, +); diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json index 3880a3b424b..579b42a4005 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json @@ -89,12 +89,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js index 08ad2d6a233..02ab01502c1 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + 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"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js index edf87c9ccdf..1fa0afa6402 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js @@ -1,57 +1,83 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments/:id/confirm - Content check if 'next_action.redirect_to_url' exists", function() { - pm.expect((typeof jsonData.next_action.redirect_to_url !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments/:id/confirm - Content check if 'next_action.redirect_to_url' exists", + function () { + pm.expect(typeof jsonData.next_action.redirect_to_url !== "undefined").to.be + .true; + }, +); diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json index 2e199785b69..d999cf2d649 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "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", @@ -34,14 +55,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js index 5698484c741..55dc35b9128 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json index d3b16097007..4dc05cee3c6 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json index 08c88256395..ad2b0902947 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json @@ -78,12 +78,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js index db627313d75..d49c0aaea58 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'pending'", function() { - pm.expect(jsonData.status).to.eql("pending"); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'status' matches 'pending'", + function () { + pm.expect(jsonData.status).to.eql("pending"); + }, + ); +} // Response body should have value "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json index 877fd1721ae..3d050b53e9d 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js index d84dc204779..3793dbdc017 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'pending'", function() { - pm.expect(jsonData.status).to.eql("pending"); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'status' matches 'pending'", + function () { + pm.expect(jsonData.status).to.eql("pending"); + }, + ); +} // Response body should have value "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/API Key - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/API Key - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/API Key - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/API Key - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/API Key - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/API Key - Create/event.test.js index bc42e83a761..4e27c5a5025 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/API Key - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/API Key - Create/event.test.js @@ -1,32 +1,46 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/api_keys/:merchant_id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/api_keys/:merchant_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/api_keys/:merchant_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; try { jsonData = pm.response.json(); -} catch(e) { -} +} catch (e) {} // pm.collectionVariables - Set api_key_id as variable for jsonData.key_id if (jsonData?.key_id) { - pm.collectionVariables.set("api_key_id", jsonData.key_id); - console.log("- use {{api_key_id}} as collection variable for value", jsonData.key_id); + pm.collectionVariables.set("api_key_id", jsonData.key_id); + console.log( + "- use {{api_key_id}} as collection variable for value", + jsonData.key_id, + ); } else { - console.log('INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value", jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/API Key - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/API Key - Create/request.json index 29c2490d1bc..2210d14da0e 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/API Key - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/API Key - Create/request.json @@ -35,13 +35,8 @@ }, "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js index 538b393c084..7de0d5beb31 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js @@ -1,37 +1,56 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - 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]::/accounts - 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", + ); }); // 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 merchant_id as variable for jsonData.merchant_id if (jsonData?.merchant_id) { - pm.collectionVariables.set("merchant_id", jsonData.merchant_id); - console.log("- use {{merchant_id}} as collection variable for value",jsonData.merchant_id); + pm.collectionVariables.set("merchant_id", jsonData.merchant_id); + console.log( + "- use {{merchant_id}} as collection variable for value", + jsonData.merchant_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value",jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} // pm.collectionVariables - Set publishable_key as variable for jsonData.publishable_key if (jsonData?.publishable_key) { - pm.collectionVariables.set("publishable_key", jsonData.publishable_key); - console.log("- use {{publishable_key}} as collection variable for value",jsonData.publishable_key); + pm.collectionVariables.set("publishable_key", jsonData.publishable_key); + console.log( + "- use {{publishable_key}} as collection variable for value", + jsonData.publishable_key, + ); } else { - console.log('INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.", + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Merchant Account - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Merchant Account - Create/request.json index ffeea3410a4..dcbf46ee538 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Merchant Account - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Merchant Account - Create/request.json @@ -84,12 +84,8 @@ }, "url": { "raw": "{{baseUrl}}/accounts", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "accounts" - ] + "host": ["{{baseUrl}}"], + "path": ["accounts"] }, "description": "Create a new account for a merchant. The merchant could be a seller or retailer or client who likes to receive and send payments." } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js index b831702461e..88e92d8d84a 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js @@ -1,21 +1,39 @@ -// Validate status 2xx -pm.test("[POST]::/account/:account_id/connectors - 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.be.success; + }, +); // Validate if response header has matching content-type -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"); -}); +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){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id if (jsonData?.merchant_connector_id) { - pm.collectionVariables.set("merchant_connector_id", jsonData.merchant_connector_id); - console.log("- use {{merchant_connector_id}} as collection variable for value",jsonData.merchant_connector_id); + pm.collectionVariables.set( + "merchant_connector_id", + jsonData.merchant_connector_id, + ); + console.log( + "- use {{merchant_connector_id}} as collection variable for value", + jsonData.merchant_connector_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.", + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payment Connector - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payment Connector - Create/request.json index bc4a439647b..592cff80751 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payment Connector - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payment Connector - Create/request.json @@ -56,10 +56,7 @@ "payment_method_types": [ { "payment_method_type": "credit", - "card_networks": [ - "Visa", - "Mastercard" - ], + "card_networks": ["Visa", "Mastercard"], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, @@ -67,10 +64,7 @@ }, { "payment_method_type": "debit", - "card_networks": [ - "Visa", - "Mastercard" - ], + "card_networks": ["Visa", "Mastercard"], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, @@ -287,10 +281,7 @@ { "type": "CARD", "parameters": { - "allowed_auth_methods": [ - "PAN_ONLY", - "CRYPTOGRAM_3DS" - ], + "allowed_auth_methods": ["PAN_ONLY", "CRYPTOGRAM_3DS"], "allowed_card_networks": [ "AMEX", "DISCOVER", @@ -320,15 +311,8 @@ }, "payment_request_data": { "label": "applepay pvt.ltd", - "supported_networks": [ - "visa", - "masterCard", - "amex", - "discover" - ], - "merchant_capabilities": [ - "supports3DS" - ] + "supported_networks": ["visa", "masterCard", "amex", "discover"], + "merchant_capabilities": ["supports3DS"] } } } @@ -336,14 +320,8 @@ }, "url": { "raw": "{{baseUrl}}/account/:account_id/connectors", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payments - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payments - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payments - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payments - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payments - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payments - Create/event.test.js index 62142d52dca..a6947db94c0 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payments - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payments - Create/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payments - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payments - Create/request.json index 91267b5b23d..8ac3ed14b0a 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payments - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payments - Create/request.json @@ -78,12 +78,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js index 4dd072b2222..d0a02af7436 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // 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.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payments - Retrieve/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payments - Retrieve/request.json index c71774083b2..ef0b213739d 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payments - Retrieve/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Refunds - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Refunds - Create/event.test.js index c862e8e68a7..dbc930608cb 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Refunds - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Refunds - Create/event.test.js @@ -1,21 +1,30 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Refunds - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Refunds - Create/request.json index 4dbca4d01f2..0c13281ee15 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Refunds - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js index b1e1f12ba50..bbd8e544e2c 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js @@ -1,22 +1,30 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); - // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Refunds - Retrieve/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Refunds - Retrieve/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js index 17933eb16e0..3f9bb6049c7 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js @@ -1,60 +1,86 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 "invalid_request" 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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} // Response body should have value "invalid_request" for "error type" 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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json index 671498b7b65..b994c6bfef1 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js index 3a170661de6..93bd98b4ccb 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js @@ -1,62 +1,86 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); - // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 "invalid_request" 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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} // Response body should have value "invalid_request" for "error type" if (jsonData?.error?.message) { -pm.test("[POST]::/payments - Content check if value for 'error.message' matches 'Card Expired'", function() { - pm.expect(jsonData.error.message).to.eql("Card Expired"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.message' matches 'Card Expired'", + function () { + pm.expect(jsonData.error.message).to.eql("Card Expired"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json index 000907f9adb..9f409826257 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js index 0e6401222ff..52680771c31 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js @@ -1,55 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector_error'", function() { - pm.expect(jsonData.error.type).to.eql("connector_error"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'", + function () { + pm.expect(jsonData.error.type).to.eql("connector_error"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json index 0a16b975817..c7ad4cb2749 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json @@ -75,12 +75,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js index 1158a1e3eb0..efeee70ef9a 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js @@ -1,61 +1,86 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 "invalid_request" 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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} // Response body should have value "invalid_request" for "error type" if (jsonData?.error?.message) { -pm.test("[POST]::/payments - Content check if value for 'error.message' matches 'Invalid card_cvc length'", function() { - pm.expect(jsonData.error.message).to.eql("Invalid card_cvc length"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.message' matches 'Invalid card_cvc length'", + function () { + pm.expect(jsonData.error.message).to.eql("Invalid card_cvc length"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json index 6c8f6d24304..1ae83751a40 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json index 90b19864ee1..f2bee31ef66 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Confirm" - ] + "childrenOrder": ["Payments - Create", "Payments - Confirm"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js index 1e8ba8cc3a6..e8d6b2216c5 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js @@ -1,58 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); -}); - - +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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json index b28abd0c309..e3b1e235042 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json @@ -67,12 +67,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js index c3e7afc6760..46bf201d1ce 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js @@ -1,59 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json index 766a8330d6e..6c934a9132c 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js index b0e69cad2c2..d683186aa00 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json index ca740738fd7..c029e72ab46 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js index 6b03e0b9ee6..34beacf976b 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" 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"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json index cafd3a6808e..6df7c0a1943 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Capture" - ] + "childrenOrder": ["Payments - Create", "Payments - Capture"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js index c3e7afc6760..46bf201d1ce 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js @@ -1,59 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json index 766a8330d6e..6c934a9132c 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json index 86f02e077cb..e05de78af19 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json index afba25ab6d6..5ff1a7cb4e8 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Cancel" - ] + "childrenOrder": ["Payments - Create", "Payments - Cancel"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js index d7879c70d87..0f869a6dfb8 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js @@ -1,50 +1,69 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/cancel - Status code is 4xx", function () { - pm.response.to.be.error; + 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/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/cancel - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; - - - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json index 86f02e077cb..e05de78af19 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/event.test.js index df348dc5d89..46bf201d1ce 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/event.test.js @@ -1,58 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/request.json index 14ac5f8bb4a..2b31ac6d784 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/event.test.js index c289d7d25fb..39cbb3ee90e 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/event.test.js @@ -1,55 +1,80 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", function() { - pm.expect(jsonData.status).to.eql("requires_customer_action"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", + function () { + pm.expect(jsonData.status).to.eql("requires_customer_action"); + }, + ); +} // Response body should have "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; -}); - +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; + }, +); diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json index 5b91b6dfb1e..4511546b410 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json @@ -89,12 +89,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/event.test.js index 1f59e2b00ac..02ab01502c1 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json index 86f02e077cb..e05de78af19 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js index e5230bf1ea7..a195cd43879 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js @@ -1,40 +1,60 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/refunds - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + 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; -}); +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"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} // Response body should have value "invalid_request" for "error type" if (jsonData?.error?.message) { -pm.test("[POST]::/payments - Content check if value for 'error.message' matches 'Refund amount exceeds the payment amount'", function() { - pm.expect(jsonData.error.message).to.eql("Refund amount exceeds the payment amount"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'error.message' matches 'Refund amount exceeds the payment amount'", + function () { + pm.expect(jsonData.error.message).to.eql( + "Refund amount exceeds the payment amount", + ); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json index 326319e8fdf..10de81bed08 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js index 65232a76373..55dc35b9128 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; - - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json index 1b04db7cee6..19e3369a340 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js index 42bf3e0ac45..fdb8a946f3d 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js index 0512588fe4b..6731d57fb69 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js @@ -1,39 +1,60 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/refunds - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + 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; -}); +pm.test( + "[POST]::/payments/:id/confirm - Content check if 'error' exists", + function () { + pm.expect(typeof jsonData.error !== "undefined").to.be.true; + }, +); // Response body should have value "invalid_request" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} // Response body should have value "invalid_request" for "error type" if (jsonData?.error?.message) { -pm.test("[POST]::/payments - Content check if value for 'error.message' matches 'The payment has not succeeded yet. Please pass a successful payment to initiate refund'", function() { - pm.expect(jsonData.error.message).to.eql("The payment has not succeeded yet. Please pass a successful payment to initiate refund"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'error.message' matches 'The payment has not succeeded yet. Please pass a successful payment to initiate refund'", + function () { + pm.expect(jsonData.error.message).to.eql( + "The payment has not succeeded yet. Please pass a successful payment to initiate refund", + ); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json index d18aaf8befd..9fe125ce8ea 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/event.test.js index b9d305e4fc4..1b37dc2c7d1 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/event.test.js @@ -1,65 +1,97 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/request.json index ca013f20e18..93e802128f2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/request.json @@ -94,12 +94,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/event.test.js index b94e329999b..db584da2266 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/event.test.js @@ -1,61 +1,87 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/.event.meta.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/event.test.js b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/event.test.js index 0223b68b030..37e4c113663 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/event.test.js +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/event.test.js @@ -1,63 +1,89 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/confirm - Content check if 'error' exists", + function () { + pm.expect(typeof jsonData.error !== "undefined").to.be.true; + }, +); // Response body should have value "invalid_request" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} // Response body should have value "invalid_request" for "error type" if (jsonData?.error?.message) { -pm.test("[POST]::/payments - Content check if value for 'error.message' matches 'Mandate Validation Failed'", function() { - pm.expect(jsonData.error.message).to.eql("Mandate Validation Failed"); -})}; - - - + pm.test( + "[POST]::/payments - Content check if value for 'error.message' matches 'Mandate Validation Failed'", + function () { + pm.expect(jsonData.error.message).to.eql("Mandate Validation Failed"); + }, + ); +} diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json index d2c4a106d65..8fc4831ccc3 100644 --- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json +++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json @@ -69,12 +69,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/adyen_uk/Health check/.meta.json b/postman/collection-dir/adyen_uk/Health check/.meta.json index 66ee7e50cab..579f9fd541c 100644 --- a/postman/collection-dir/adyen_uk/Health check/.meta.json +++ b/postman/collection-dir/adyen_uk/Health check/.meta.json @@ -1,5 +1,3 @@ { - "childrenOrder": [ - "New Request" - ] + "childrenOrder": ["New Request"] } diff --git a/postman/collection-dir/adyen_uk/Health check/New Request/.event.meta.json b/postman/collection-dir/adyen_uk/Health check/New Request/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/adyen_uk/Health check/New Request/.event.meta.json +++ b/postman/collection-dir/adyen_uk/Health check/New Request/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/adyen_uk/Health check/New Request/event.test.js b/postman/collection-dir/adyen_uk/Health check/New Request/event.test.js index 325a8c8a479..b490b8be090 100644 --- a/postman/collection-dir/adyen_uk/Health check/New Request/event.test.js +++ b/postman/collection-dir/adyen_uk/Health check/New Request/event.test.js @@ -1,4 +1,4 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - Status code is 2xx", function () { - pm.response.to.be.success; -}); \ No newline at end of file + pm.response.to.be.success; +}); diff --git a/postman/collection-dir/adyen_uk/Health check/New Request/request.json b/postman/collection-dir/adyen_uk/Health check/New Request/request.json index 4cc8d4b1a96..e40e9396178 100644 --- a/postman/collection-dir/adyen_uk/Health check/New Request/request.json +++ b/postman/collection-dir/adyen_uk/Health check/New Request/request.json @@ -10,11 +10,7 @@ ], "url": { "raw": "{{baseUrl}}/health", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "health" - ] + "host": ["{{baseUrl}}"], + "path": ["health"] } } diff --git a/postman/collection-dir/adyen_uk/event.test.js b/postman/collection-dir/adyen_uk/event.test.js index 69037688f22..fb52caec30f 100644 --- a/postman/collection-dir/adyen_uk/event.test.js +++ b/postman/collection-dir/adyen_uk/event.test.js @@ -1,11 +1,13 @@ // 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("[LOG]::payment_id - " + jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log("[LOG]::payment_id - " + jsonData.payment_id); } -console.log("[LOG]::x-request-id - " + pm.response.headers.get('x-request-id')); \ No newline at end of file +console.log("[LOG]::x-request-id - " + pm.response.headers.get("x-request-id")); diff --git a/postman/collection-dir/airwallex/.event.meta.json b/postman/collection-dir/airwallex/.event.meta.json index 2df9d47d936..eb871bbcb9b 100644 --- a/postman/collection-dir/airwallex/.event.meta.json +++ b/postman/collection-dir/airwallex/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.prerequest.js", - "event.test.js" - ] + "eventOrder": ["event.prerequest.js", "event.test.js"] } diff --git a/postman/collection-dir/airwallex/.meta.json b/postman/collection-dir/airwallex/.meta.json index 91b6a65c5bc..d513035ce2d 100644 --- a/postman/collection-dir/airwallex/.meta.json +++ b/postman/collection-dir/airwallex/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Health check", - "Flow Testcases" - ] + "childrenOrder": ["Health check", "Flow Testcases"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/.meta.json b/postman/collection-dir/airwallex/Flow Testcases/.meta.json index 1bbce843680..023989e1e49 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/.meta.json @@ -1,7 +1,3 @@ { - "childrenOrder": [ - "QuickStart", - "Happy Cases", - "Variation Cases" - ] + "childrenOrder": ["QuickStart", "Happy Cases", "Variation Cases"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js index 72f142cc731..c48d8e2d054 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json index 5dd395f74f3..05d527a1805 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js index c5bae16750d..c48d8e2d054 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json index 8cb0f3a6ea1..bdfd506c340 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js index 01c5b744eac..4974bba662f 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js @@ -1,58 +1,76 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "refunds" -pm.test("[POST]::/payments - Content check if 'refunds' exists", function() { - pm.expect((typeof jsonData.refunds !== "undefined")).to.be.true; +pm.test("[POST]::/payments - Content check if 'refunds' exists", function () { + pm.expect(typeof jsonData.refunds !== "undefined").to.be.true; }); - - - diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js index 5c0761f9405..3619086b45b 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("pending"); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("pending"); + }, + ); +} // Response body should have value "1000" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '1000'", function() { - pm.expect(jsonData.amount).to.eql(1000); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '1000'", + function () { + pm.expect(jsonData.amount).to.eql(1000); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json index b56057fad5d..caed7818578 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js index 1fe1966b2ab..6aa44bd5fa7 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("pending"); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("pending"); + }, + ); +} // Response body should have value "540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '540'", function() { - pm.expect(jsonData.amount).to.eql(540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '540'", + function () { + pm.expect(jsonData.amount).to.eql(540); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json index d18aaf8befd..9fe125ce8ea 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js index 823c5f02aad..5b57c9deb90 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "Pending" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("pending"); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("pending"); + }, + ); +} // Response body should have value "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '1000'", function() { - pm.expect(jsonData.amount).to.eql(1000); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '1000'", + function () { + pm.expect(jsonData.amount).to.eql(1000); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js index ae86d1fed61..d4a1a90278c 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("pending"); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("pending"); + }, + ); +} // Response body should have value "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '540'", function() { - pm.expect(jsonData.amount).to.eql(540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '540'", + function () { + pm.expect(jsonData.amount).to.eql(540); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js index bb50904fd89..f92fba3d044 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js index 5698484c741..55dc35b9128 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json index 876d19016e2..aba1cab6835 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js index 03ccae1adb0..aced67dbfb7 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js index 5d9e5785e6e..6d812bc75fe 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id/confirm - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id/confirm - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json index 6bfbb501dd5..cee3810c700 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "card", "payment_method_data": { "card": { @@ -32,14 +53,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json index b28abd0c309..e3b1e235042 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json @@ -67,12 +67,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js index 03ccae1adb0..aced67dbfb7 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js index 1e2875ec9f6..2d7dbc507fb 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js @@ -1,68 +1,94 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/capture - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); - -// Validate if response has JSON Body +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.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} - +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]:://payments/:id/capture - 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 "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "6000" for "amount_received" if (jsonData?.amount_received) { -pm.test("[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", function() { - pm.expect(jsonData.amount_received).to.eql(6000); -})}; - - - - + pm.test( + "[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", + function () { + pm.expect(jsonData.amount_received).to.eql(6000); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json index 8975575ca40..9fe257ed85e 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js index b0e69cad2c2..d683186aa00 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json index f2687c85cec..0cc6a0477a9 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js index 1a0942b5f88..5c7196baa4f 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js index 9632bd19048..dcf3f191643 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js @@ -1,43 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/cancel - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type 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(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "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"); -})}; - - - + pm.test( + "[POST]::/payments/:id/cancel - Content check if value for 'status' matches 'cancelled'", + function () { + pm.expect(jsonData.status).to.eql("cancelled"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js index b0e69cad2c2..d683186aa00 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json index f2687c85cec..0cc6a0477a9 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js index f4e0ab9b2aa..5e52e13a59e 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "cancelled" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'", function() { - pm.expect(jsonData.status).to.eql("cancelled"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'", + function () { + pm.expect(jsonData.status).to.eql("cancelled"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js index 1388cde7c89..39cbb3ee90e 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js @@ -1,54 +1,80 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", function() { - pm.expect(jsonData.status).to.eql("requires_customer_action"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", + function () { + pm.expect(jsonData.status).to.eql("requires_customer_action"); + }, + ); +} // Response body should have "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; -}); +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; + }, +); diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json index c8fe285ed13..65888d62e39 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js index 08ad2d6a233..02ab01502c1 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + 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"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js index edf87c9ccdf..1fa0afa6402 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js @@ -1,57 +1,83 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments/:id/confirm - Content check if 'next_action.redirect_to_url' exists", function() { - pm.expect((typeof jsonData.next_action.redirect_to_url !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments/:id/confirm - Content check if 'next_action.redirect_to_url' exists", + function () { + pm.expect(typeof jsonData.next_action.redirect_to_url !== "undefined").to.be + .true; + }, +); diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js index 5698484c741..55dc35b9128 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json index 91f790c9011..ad4ba648a2f 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json index 5dd395f74f3..05d527a1805 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js index 68d9e639f09..28f6a4ad4e0 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("pending"); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("pending"); + }, + ); +} // Response body should have value "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json index 5e306df7a55..5f4c58816d5 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js index d84dc204779..3793dbdc017 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'pending'", function() { - pm.expect(jsonData.status).to.eql("pending"); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'status' matches 'pending'", + function () { + pm.expect(jsonData.status).to.eql("pending"); + }, + ); +} // Response body should have value "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/API Key - Create/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/API Key - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/API Key - Create/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/API Key - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/API Key - Create/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/API Key - Create/event.test.js index bc42e83a761..4e27c5a5025 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/API Key - Create/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/API Key - Create/event.test.js @@ -1,32 +1,46 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/api_keys/:merchant_id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/api_keys/:merchant_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/api_keys/:merchant_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; try { jsonData = pm.response.json(); -} catch(e) { -} +} catch (e) {} // pm.collectionVariables - Set api_key_id as variable for jsonData.key_id if (jsonData?.key_id) { - pm.collectionVariables.set("api_key_id", jsonData.key_id); - console.log("- use {{api_key_id}} as collection variable for value", jsonData.key_id); + pm.collectionVariables.set("api_key_id", jsonData.key_id); + console.log( + "- use {{api_key_id}} as collection variable for value", + jsonData.key_id, + ); } else { - console.log('INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value", jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/API Key - Create/request.json b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/API Key - Create/request.json index 29c2490d1bc..2210d14da0e 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/API Key - Create/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/API Key - Create/request.json @@ -35,13 +35,8 @@ }, "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js index 538b393c084..7de0d5beb31 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js @@ -1,37 +1,56 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - 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]::/accounts - 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", + ); }); // 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 merchant_id as variable for jsonData.merchant_id if (jsonData?.merchant_id) { - pm.collectionVariables.set("merchant_id", jsonData.merchant_id); - console.log("- use {{merchant_id}} as collection variable for value",jsonData.merchant_id); + pm.collectionVariables.set("merchant_id", jsonData.merchant_id); + console.log( + "- use {{merchant_id}} as collection variable for value", + jsonData.merchant_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value",jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} // pm.collectionVariables - Set publishable_key as variable for jsonData.publishable_key if (jsonData?.publishable_key) { - pm.collectionVariables.set("publishable_key", jsonData.publishable_key); - console.log("- use {{publishable_key}} as collection variable for value",jsonData.publishable_key); + pm.collectionVariables.set("publishable_key", jsonData.publishable_key); + console.log( + "- use {{publishable_key}} as collection variable for value", + jsonData.publishable_key, + ); } else { - console.log('INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.", + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Merchant Account - Create/request.json b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Merchant Account - Create/request.json index ffeea3410a4..dcbf46ee538 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Merchant Account - Create/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Merchant Account - Create/request.json @@ -84,12 +84,8 @@ }, "url": { "raw": "{{baseUrl}}/accounts", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "accounts" - ] + "host": ["{{baseUrl}}"], + "path": ["accounts"] }, "description": "Create a new account for a merchant. The merchant could be a seller or retailer or client who likes to receive and send payments." } diff --git a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js index b831702461e..88e92d8d84a 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js @@ -1,21 +1,39 @@ -// Validate status 2xx -pm.test("[POST]::/account/:account_id/connectors - 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.be.success; + }, +); // Validate if response header has matching content-type -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"); -}); +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){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id if (jsonData?.merchant_connector_id) { - pm.collectionVariables.set("merchant_connector_id", jsonData.merchant_connector_id); - console.log("- use {{merchant_connector_id}} as collection variable for value",jsonData.merchant_connector_id); + pm.collectionVariables.set( + "merchant_connector_id", + jsonData.merchant_connector_id, + ); + console.log( + "- use {{merchant_connector_id}} as collection variable for value", + jsonData.merchant_connector_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.", + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payment Connector - Create/request.json b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payment Connector - Create/request.json index 4c4763001a0..2437ba2360e 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payment Connector - Create/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payment Connector - Create/request.json @@ -258,14 +258,8 @@ }, "url": { "raw": "{{baseUrl}}/account/:account_id/connectors", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payments - Create/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payments - Create/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payments - Create/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payments - Create/event.test.js index 62142d52dca..a6947db94c0 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payments - Create/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payments - Create/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payments - Create/request.json b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payments - Create/request.json index 007ae3dd4b4..9dac4b9a574 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payments - Create/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js index 4dd072b2222..d0a02af7436 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // 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.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payments - Retrieve/request.json b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payments - Retrieve/request.json index c71774083b2..ef0b213739d 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payments - Retrieve/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Refunds - Create/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Refunds - Create/event.test.js index c862e8e68a7..dbc930608cb 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Refunds - Create/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Refunds - Create/event.test.js @@ -1,21 +1,30 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Refunds - Create/request.json b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Refunds - Create/request.json index 4dbca4d01f2..0c13281ee15 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Refunds - Create/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js index b1e1f12ba50..bbd8e544e2c 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js @@ -1,22 +1,30 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); - // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Refunds - Retrieve/request.json b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Refunds - Retrieve/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/QuickStart/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js index fd7a3e05de9..5606a8b1979 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js @@ -1,54 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json index aa3f582f2af..74635f11bf8 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js index 457ef5a37b4..5606a8b1979 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js @@ -1,56 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); - // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json index c7e0134cb29..56ff39dd901 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js index 0e6401222ff..52680771c31 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js @@ -1,55 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector_error'", function() { - pm.expect(jsonData.error.type).to.eql("connector_error"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'", + function () { + pm.expect(jsonData.error.type).to.eql("connector_error"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json index c0953ac8ca7..6b7a76214aa 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json @@ -75,12 +75,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js index 43c8b98fce7..156ce4fda5b 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js @@ -1,55 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json index fa3fcea9b2a..40fd14662e7 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json index 90b19864ee1..f2bee31ef66 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Confirm" - ] + "childrenOrder": ["Payments - Create", "Payments - Confirm"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js index 1e8ba8cc3a6..e8d6b2216c5 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js @@ -1,58 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); -}); - - +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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json index b28abd0c309..e3b1e235042 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json @@ -67,12 +67,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js index c3e7afc6760..46bf201d1ce 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js @@ -1,59 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json index 766a8330d6e..6c934a9132c 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js index b0e69cad2c2..d683186aa00 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json index f2687c85cec..0cc6a0477a9 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js index 6b03e0b9ee6..34beacf976b 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" 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"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json index cafd3a6808e..6df7c0a1943 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Capture" - ] + "childrenOrder": ["Payments - Create", "Payments - Capture"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js index c3e7afc6760..46bf201d1ce 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js @@ -1,59 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json index 766a8330d6e..6c934a9132c 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json index 23a12c9e1f0..12874c60cf8 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json index afba25ab6d6..5ff1a7cb4e8 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Cancel" - ] + "childrenOrder": ["Payments - Create", "Payments - Cancel"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js index d7879c70d87..0f869a6dfb8 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js @@ -1,50 +1,69 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/cancel - Status code is 4xx", function () { - pm.response.to.be.error; + 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/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/cancel - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; - - - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json index 23a12c9e1f0..12874c60cf8 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/event.test.js index f125e2a7885..46bf201d1ce 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/event.test.js @@ -1,61 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + 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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/request.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/request.json index 14ac5f8bb4a..2b31ac6d784 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/event.test.js index c289d7d25fb..39cbb3ee90e 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/event.test.js @@ -1,55 +1,80 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", function() { - pm.expect(jsonData.status).to.eql("requires_customer_action"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", + function () { + pm.expect(jsonData.status).to.eql("requires_customer_action"); + }, + ); +} // Response body should have "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; -}); - +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; + }, +); diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json index abfe4916bc3..71d963ee124 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/event.test.js index fc715bf7fc0..d5e6269fc85 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", function() { - pm.expect(jsonData.status).to.eql("requires_customer_action"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", + function () { + pm.expect(jsonData.status).to.eql("requires_customer_action"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/request.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/request.json index 66a57c15ea8..b30007ef96c 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json index 23a12c9e1f0..12874c60cf8 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js index 9537daf6187..776dbd70712 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js @@ -1,33 +1,48 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/refunds - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + 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; -}); +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"); -})}; - + 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"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json index 326319e8fdf..10de81bed08 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js index 65232a76373..55dc35b9128 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; - - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json index 81a3c511c47..08b88ac1f35 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js index 42bf3e0ac45..fdb8a946f3d 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js index 30888b5cc0c..d3c4451760d 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js @@ -1,32 +1,48 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/refunds - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + 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; -}); +pm.test( + "[POST]::/payments/:id/confirm - Content check if 'error' exists", + function () { + pm.expect(typeof jsonData.error !== "undefined").to.be.true; + }, +); // Response body should have value "invalid_request" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; + pm.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"); + }, + ); +} diff --git a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json index d18aaf8befd..9fe125ce8ea 100644 --- a/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json +++ b/postman/collection-dir/airwallex/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/airwallex/Health check/.meta.json b/postman/collection-dir/airwallex/Health check/.meta.json index 66ee7e50cab..579f9fd541c 100644 --- a/postman/collection-dir/airwallex/Health check/.meta.json +++ b/postman/collection-dir/airwallex/Health check/.meta.json @@ -1,5 +1,3 @@ { - "childrenOrder": [ - "New Request" - ] + "childrenOrder": ["New Request"] } diff --git a/postman/collection-dir/airwallex/Health check/New Request/.event.meta.json b/postman/collection-dir/airwallex/Health check/New Request/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/airwallex/Health check/New Request/.event.meta.json +++ b/postman/collection-dir/airwallex/Health check/New Request/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/airwallex/Health check/New Request/event.test.js b/postman/collection-dir/airwallex/Health check/New Request/event.test.js index 325a8c8a479..b490b8be090 100644 --- a/postman/collection-dir/airwallex/Health check/New Request/event.test.js +++ b/postman/collection-dir/airwallex/Health check/New Request/event.test.js @@ -1,4 +1,4 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - Status code is 2xx", function () { - pm.response.to.be.success; -}); \ No newline at end of file + pm.response.to.be.success; +}); diff --git a/postman/collection-dir/airwallex/Health check/New Request/request.json b/postman/collection-dir/airwallex/Health check/New Request/request.json index 4cc8d4b1a96..e40e9396178 100644 --- a/postman/collection-dir/airwallex/Health check/New Request/request.json +++ b/postman/collection-dir/airwallex/Health check/New Request/request.json @@ -10,11 +10,7 @@ ], "url": { "raw": "{{baseUrl}}/health", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "health" - ] + "host": ["{{baseUrl}}"], + "path": ["health"] } } diff --git a/postman/collection-dir/airwallex/event.test.js b/postman/collection-dir/airwallex/event.test.js index 69037688f22..fb52caec30f 100644 --- a/postman/collection-dir/airwallex/event.test.js +++ b/postman/collection-dir/airwallex/event.test.js @@ -1,11 +1,13 @@ // 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("[LOG]::payment_id - " + jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log("[LOG]::payment_id - " + jsonData.payment_id); } -console.log("[LOG]::x-request-id - " + pm.response.headers.get('x-request-id')); \ No newline at end of file +console.log("[LOG]::x-request-id - " + pm.response.headers.get("x-request-id")); diff --git a/postman/collection-dir/authorizedotnet/.event.meta.json b/postman/collection-dir/authorizedotnet/.event.meta.json index 2df9d47d936..eb871bbcb9b 100644 --- a/postman/collection-dir/authorizedotnet/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.prerequest.js", - "event.test.js" - ] + "eventOrder": ["event.prerequest.js", "event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/.meta.json b/postman/collection-dir/authorizedotnet/.meta.json index 91b6a65c5bc..d513035ce2d 100644 --- a/postman/collection-dir/authorizedotnet/.meta.json +++ b/postman/collection-dir/authorizedotnet/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Health check", - "Flow Testcases" - ] + "childrenOrder": ["Health check", "Flow Testcases"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/.meta.json index 1bbce843680..023989e1e49 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/.meta.json @@ -1,7 +1,3 @@ { - "childrenOrder": [ - "QuickStart", - "Happy Cases", - "Variation Cases" - ] + "childrenOrder": ["QuickStart", "Happy Cases", "Variation Cases"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.prerequest.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.prerequest.js index 726d5815380..27965bb9c01 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.prerequest.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.prerequest.js @@ -1 +1 @@ -pm.environment.set("random_number", _.random(1000, 100000)) +pm.environment.set("random_number", _.random(1000, 100000)); diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js index 9db2286cb10..611bb438bb8 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" or "failed" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", function() { - pm.expect(jsonData.status).to.be.oneOf(["processing", "failed"]); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", + function () { + pm.expect(jsonData.status).to.be.oneOf(["processing", "failed"]); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json index afe08092250..6cd197f8744 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js index 9db2286cb10..611bb438bb8 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" or "failed" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", function() { - pm.expect(jsonData.status).to.be.oneOf(["processing", "failed"]); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", + function () { + pm.expect(jsonData.status).to.be.oneOf(["processing", "failed"]); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js index 9db2286cb10..611bb438bb8 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" or "failed" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", function() { - pm.expect(jsonData.status).to.be.oneOf(["processing", "failed"]); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", + function () { + pm.expect(jsonData.status).to.be.oneOf(["processing", "failed"]); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.prerequest.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.prerequest.js index 726d5815380..27965bb9c01 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.prerequest.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.prerequest.js @@ -1 +1 @@ -pm.environment.set("random_number", _.random(1000, 100000)) +pm.environment.set("random_number", _.random(1000, 100000)); diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js index 7cb55ca69df..faa7bc1c19d 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js @@ -1,50 +1,75 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" or "failed" or "requires_confirmation" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' or 'requires_confirmation'", function() { - pm.expect(jsonData.status).to.be.oneOf(["processing", "requires_confirmation", "failed"]); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' or 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.be.oneOf([ + "processing", + "requires_confirmation", + "failed", + ]); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json index 024e9cd8081..d30229f9661 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js index 9db2286cb10..611bb438bb8 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" or "failed" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", function() { - pm.expect(jsonData.status).to.be.oneOf(["processing", "failed"]); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", + function () { + pm.expect(jsonData.status).to.be.oneOf(["processing", "failed"]); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js index 9db2286cb10..611bb438bb8 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" or "failed" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", function() { - pm.expect(jsonData.status).to.be.oneOf(["processing", "failed"]); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", + function () { + pm.expect(jsonData.status).to.be.oneOf(["processing", "failed"]); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json index 1c77275181c..ab7b144f94b 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "card", "payment_method_data": { "card": { @@ -32,14 +53,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.prerequest.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.prerequest.js index 726d5815380..27965bb9c01 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.prerequest.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.prerequest.js @@ -1 +1 @@ -pm.environment.set("random_number", _.random(1000, 100000)) +pm.environment.set("random_number", _.random(1000, 100000)); diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json index a14b824b36b..fc4e0cc59cd 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js index 9db2286cb10..611bb438bb8 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" or "failed" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", function() { - pm.expect(jsonData.status).to.be.oneOf(["processing", "failed"]); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", + function () { + pm.expect(jsonData.status).to.be.oneOf(["processing", "failed"]); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/API Key - Create/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/API Key - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/API Key - Create/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/API Key - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/API Key - Create/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/API Key - Create/event.test.js index bc42e83a761..4e27c5a5025 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/API Key - Create/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/API Key - Create/event.test.js @@ -1,32 +1,46 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/api_keys/:merchant_id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/api_keys/:merchant_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/api_keys/:merchant_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; try { jsonData = pm.response.json(); -} catch(e) { -} +} catch (e) {} // pm.collectionVariables - Set api_key_id as variable for jsonData.key_id if (jsonData?.key_id) { - pm.collectionVariables.set("api_key_id", jsonData.key_id); - console.log("- use {{api_key_id}} as collection variable for value", jsonData.key_id); + pm.collectionVariables.set("api_key_id", jsonData.key_id); + console.log( + "- use {{api_key_id}} as collection variable for value", + jsonData.key_id, + ); } else { - console.log('INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value", jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/API Key - Create/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/API Key - Create/request.json index 29c2490d1bc..2210d14da0e 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/API Key - Create/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/API Key - Create/request.json @@ -35,13 +35,8 @@ }, "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js index 538b393c084..7de0d5beb31 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js @@ -1,37 +1,56 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - 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]::/accounts - 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", + ); }); // 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 merchant_id as variable for jsonData.merchant_id if (jsonData?.merchant_id) { - pm.collectionVariables.set("merchant_id", jsonData.merchant_id); - console.log("- use {{merchant_id}} as collection variable for value",jsonData.merchant_id); + pm.collectionVariables.set("merchant_id", jsonData.merchant_id); + console.log( + "- use {{merchant_id}} as collection variable for value", + jsonData.merchant_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value",jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} // pm.collectionVariables - Set publishable_key as variable for jsonData.publishable_key if (jsonData?.publishable_key) { - pm.collectionVariables.set("publishable_key", jsonData.publishable_key); - console.log("- use {{publishable_key}} as collection variable for value",jsonData.publishable_key); + pm.collectionVariables.set("publishable_key", jsonData.publishable_key); + console.log( + "- use {{publishable_key}} as collection variable for value", + jsonData.publishable_key, + ); } else { - console.log('INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.", + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Merchant Account - Create/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Merchant Account - Create/request.json index ffeea3410a4..dcbf46ee538 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Merchant Account - Create/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Merchant Account - Create/request.json @@ -84,12 +84,8 @@ }, "url": { "raw": "{{baseUrl}}/accounts", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "accounts" - ] + "host": ["{{baseUrl}}"], + "path": ["accounts"] }, "description": "Create a new account for a merchant. The merchant could be a seller or retailer or client who likes to receive and send payments." } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js index b831702461e..88e92d8d84a 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js @@ -1,21 +1,39 @@ -// Validate status 2xx -pm.test("[POST]::/account/:account_id/connectors - 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.be.success; + }, +); // Validate if response header has matching content-type -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"); -}); +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){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id if (jsonData?.merchant_connector_id) { - pm.collectionVariables.set("merchant_connector_id", jsonData.merchant_connector_id); - console.log("- use {{merchant_connector_id}} as collection variable for value",jsonData.merchant_connector_id); + pm.collectionVariables.set( + "merchant_connector_id", + jsonData.merchant_connector_id, + ); + console.log( + "- use {{merchant_connector_id}} as collection variable for value", + jsonData.merchant_connector_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.", + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payment Connector - Create/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payment Connector - Create/request.json index 3905b54d00d..6255eb17066 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payment Connector - Create/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payment Connector - Create/request.json @@ -55,10 +55,7 @@ "payment_method_types": [ { "payment_method_type": "credit", - "card_networks": [ - "Visa", - "Mastercard" - ], + "card_networks": ["Visa", "Mastercard"], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, @@ -66,10 +63,7 @@ }, { "payment_method_type": "debit", - "card_networks": [ - "Visa", - "Mastercard" - ], + "card_networks": ["Visa", "Mastercard"], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, @@ -115,14 +109,8 @@ }, "url": { "raw": "{{baseUrl}}/account/:account_id/connectors", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payments - Create/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payments - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payments - Create/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payments - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payments - Create/event.prerequest.js b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payments - Create/event.prerequest.js index 726d5815380..27965bb9c01 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payments - Create/event.prerequest.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payments - Create/event.prerequest.js @@ -1 +1 @@ -pm.environment.set("random_number", _.random(1000, 100000)) +pm.environment.set("random_number", _.random(1000, 100000)); diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payments - Create/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payments - Create/event.test.js index 2e7622314fd..a6947db94c0 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payments - Create/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payments - Create/event.test.js @@ -1,45 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payments - Create/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payments - Create/request.json index 95b19ed8520..176c927bd69 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payments - Create/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js index 4dd072b2222..d0a02af7436 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // 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.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payments - Retrieve/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payments - Retrieve/request.json index c71774083b2..ef0b213739d 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payments - Retrieve/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Refunds - Create/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Refunds - Create/event.test.js index 991cd0b5648..33e9e001baf 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Refunds - Create/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Refunds - Create/event.test.js @@ -1,28 +1,42 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - Status code is 2xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have an error message as we try to refund a "processing" payment if (jsonData?.error) { - pm.test("[POST]::/payments - Content check if error type is 'invalid_request'", function() { - pm.expect(jsonData.error.message).to.eql("The payment has not succeeded yet. Please pass a successful payment to initiate refund"); -})}; - + pm.test( + "[POST]::/payments - Content check if error type is 'invalid_request'", + function () { + pm.expect(jsonData.error.message).to.eql( + "The payment has not succeeded yet. Please pass a successful payment to initiate refund", + ); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Refunds - Create/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Refunds - Create/request.json index 4dbca4d01f2..0c13281ee15 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Refunds - Create/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js index e6234f27afe..6b122d1df53 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js @@ -1,28 +1,40 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - Status code is 2xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have an error message as we try to retrieve refund that doesn't exist if (jsonData?.error) { - pm.test("[POST]::/payments - Content check if error type is 'invalid_request'", function() { - pm.expect(jsonData.error.message).to.eql("Unrecognized request URL"); -})}; - + pm.test( + "[POST]::/payments - Content check if error type is 'invalid_request'", + function () { + pm.expect(jsonData.error.message).to.eql("Unrecognized request URL"); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Refunds - Retrieve/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Refunds - Retrieve/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.prerequest.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.prerequest.js index 726d5815380..27965bb9c01 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.prerequest.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.prerequest.js @@ -1 +1 @@ -pm.environment.set("random_number", _.random(1000, 100000)) +pm.environment.set("random_number", _.random(1000, 100000)); diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js index 08f14e045be..edb1f073bee 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js @@ -1,54 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json index c81973f8927..b2e3fb603a5 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.prerequest.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.prerequest.js index 726d5815380..27965bb9c01 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.prerequest.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.prerequest.js @@ -1 +1 @@ -pm.environment.set("random_number", _.random(1000, 100000)) +pm.environment.set("random_number", _.random(1000, 100000)); diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js index 7d118e2f5e5..edb1f073bee 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js @@ -1,56 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); - // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json index 6daf389cdd9..aa55deec366 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.prerequest.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.prerequest.js index 862accaff2d..27965bb9c01 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.prerequest.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.prerequest.js @@ -1 +1 @@ -pm.environment.set("random_number", _.random(1000, 100000)) \ No newline at end of file +pm.environment.set("random_number", _.random(1000, 100000)); diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js index 739c06af117..bcf23903b67 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js @@ -1,57 +1,78 @@ -pm.environment.set("random_number", _.random(1000, 100000)) +pm.environment.set("random_number", _.random(1000, 100000)); -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector_error'", function() { - pm.expect(jsonData.error.type).to.eql("connector_error"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'", + function () { + pm.expect(jsonData.error.type).to.eql("connector_error"); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json index 7a6b0a920a1..2096526df5a 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.prerequest.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.prerequest.js index 726d5815380..27965bb9c01 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.prerequest.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.prerequest.js @@ -1 +1 @@ -pm.environment.set("random_number", _.random(1000, 100000)) +pm.environment.set("random_number", _.random(1000, 100000)); diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js index 630c4f25cae..3976f7f496a 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js @@ -1,55 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector'", function() { - pm.expect(jsonData.error.type).to.eql("connector"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector'", + function () { + pm.expect(jsonData.error.type).to.eql("connector"); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json index ebdea4cf7b0..58376c99d77 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Create/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Create/event.prerequest.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Create/event.prerequest.js index 862accaff2d..27965bb9c01 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Create/event.prerequest.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Create/event.prerequest.js @@ -1 +1 @@ -pm.environment.set("random_number", _.random(1000, 100000)) \ No newline at end of file +pm.environment.set("random_number", _.random(1000, 100000)); diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Create/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Create/event.test.js index d746a0185d0..d707a44aa72 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Create/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Create/event.test.js @@ -1,65 +1,93 @@ -pm.environment.set("random_number", _.random(1000, 100000)) +pm.environment.set("random_number", _.random(1000, 100000)); -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "processing" or "failed" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", function() { - pm.expect(jsonData.status).to.be.oneOf(["processing", "failed"]); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", + function () { + pm.expect(jsonData.status).to.be.oneOf(["processing", "failed"]); + }, + ); +} // Response body should have "mandate_id" if (jsonData?.mandate_id) { -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -})}; + pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, + ); +} // Response body should have "mandate_data" if (jsonData?.mandate_data) { -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Create/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Create/request.json index 133140282b7..0a28845fb2e 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Create/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Retrieve-copy/event.test.js index 6abf6f37825..5afdb675fd4 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Retrieve-copy/event.test.js @@ -1,63 +1,91 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "processing" or "failed" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", function() { - pm.expect(jsonData.status).to.be.oneOf(["processing", "failed"]); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", + function () { + pm.expect(jsonData.status).to.be.oneOf(["processing", "failed"]); + }, + ); +} // Response body should have "mandate_id" if (jsonData?.mandate_id) { -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -})}; + pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, + ); +} // Response body should have "mandate_data" if (jsonData?.mandate_data) { -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Retrieve-copy/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Retrieve/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Retrieve/event.test.js index 6abf6f37825..5afdb675fd4 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Retrieve/event.test.js @@ -1,63 +1,91 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "processing" or "failed" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", function() { - pm.expect(jsonData.status).to.be.oneOf(["processing", "failed"]); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", + function () { + pm.expect(jsonData.status).to.be.oneOf(["processing", "failed"]); + }, + ); +} // Response body should have "mandate_id" if (jsonData?.mandate_id) { -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -})}; + pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, + ); +} // Response body should have "mandate_data" if (jsonData?.mandate_data) { -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Retrieve/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Recurring Payments - Create/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Recurring Payments - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Recurring Payments - Create/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Recurring Payments - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Recurring Payments - Create/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Recurring Payments - Create/event.test.js index 89ce6bd6b45..f5eb1d3c06c 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Recurring Payments - Create/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Recurring Payments - Create/event.test.js @@ -1,73 +1,111 @@ // Validate status 2xx or 4xx pm.test("[POST]::/payments/:id/capture - Status code is 2xx", function () { - pm.expect(pm.response.code).to.be.oneOf([200,400]); + pm.expect(pm.response.code).to.be.oneOf([200, 400]); }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" or "failed" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", function() { - pm.expect(jsonData.status).to.be.oneOf(["processing", "failed"]); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", + function () { + pm.expect(jsonData.status).to.be.oneOf(["processing", "failed"]); + }, + ); +} // Response body should have "mandate_id" if (jsonData?.mandate_id) { -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -})}; + pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, + ); +} // Response body should have "mandate_data" if (jsonData?.mandate_data) { -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -})}; + pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, + ); +} // Response body should have "payment_method_data" if (jsonData?.payment_method_data) { -pm.test("[POST]::/payments - Content check if 'payment_method_data' exists", function() { - pm.expect((typeof jsonData.payment_method_data !== "undefined")).to.be.true; -})}; + pm.test( + "[POST]::/payments - Content check if 'payment_method_data' exists", + function () { + pm.expect(typeof jsonData.payment_method_data !== "undefined").to.be.true; + }, + ); +} // Response body should have value "connector error" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Recurring Payments - Create/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Recurring Payments - Create/request.json index a79f155ee9d..0bd395bff63 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Recurring Payments - Create/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario10-Create a mandate and recurring payment/Recurring Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario11-Create a recurring payment with greater mandate amount/Payments - Create/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario11-Create a recurring payment with greater mandate amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario11-Create a recurring payment with greater mandate amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario11-Create a recurring payment with greater mandate amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario11-Create a recurring payment with greater mandate amount/Payments - Create/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario11-Create a recurring payment with greater mandate amount/Payments - Create/event.test.js index 6abf6f37825..5afdb675fd4 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario11-Create a recurring payment with greater mandate amount/Payments - Create/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario11-Create a recurring payment with greater mandate amount/Payments - Create/event.test.js @@ -1,63 +1,91 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "processing" or "failed" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", function() { - pm.expect(jsonData.status).to.be.oneOf(["processing", "failed"]); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", + function () { + pm.expect(jsonData.status).to.be.oneOf(["processing", "failed"]); + }, + ); +} // Response body should have "mandate_id" if (jsonData?.mandate_id) { -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -})}; + pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, + ); +} // Response body should have "mandate_data" if (jsonData?.mandate_data) { -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario11-Create a recurring payment with greater mandate amount/Payments - Create/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario11-Create a recurring payment with greater mandate amount/Payments - Create/request.json index 2f23b96ec43..e3d19912b79 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario11-Create a recurring payment with greater mandate amount/Payments - Create/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario11-Create a recurring payment with greater mandate amount/Payments - Create/request.json @@ -94,12 +94,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario11-Create a recurring payment with greater mandate amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario11-Create a recurring payment with greater mandate amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario11-Create a recurring payment with greater mandate amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario11-Create a recurring payment with greater mandate amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario11-Create a recurring payment with greater mandate amount/Payments - Retrieve/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario11-Create a recurring payment with greater mandate amount/Payments - Retrieve/event.test.js index 6abf6f37825..5afdb675fd4 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario11-Create a recurring payment with greater mandate amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario11-Create a recurring payment with greater mandate amount/Payments - Retrieve/event.test.js @@ -1,63 +1,91 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "processing" or "failed" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", function() { - pm.expect(jsonData.status).to.be.oneOf(["processing", "failed"]); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", + function () { + pm.expect(jsonData.status).to.be.oneOf(["processing", "failed"]); + }, + ); +} // Response body should have "mandate_id" if (jsonData?.mandate_id) { -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -})}; + pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, + ); +} // Response body should have "mandate_data" if (jsonData?.mandate_data) { -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario11-Create a recurring payment with greater mandate amount/Payments - Retrieve/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario11-Create a recurring payment with greater mandate amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario11-Create a recurring payment with greater mandate amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario11-Create a recurring payment with greater mandate amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario11-Create a recurring payment with greater mandate amount/Recurring Payments - Create/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario11-Create a recurring payment with greater mandate amount/Recurring Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario11-Create a recurring payment with greater mandate amount/Recurring Payments - Create/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario11-Create a recurring payment with greater mandate amount/Recurring Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario11-Create a recurring payment with greater mandate amount/Recurring Payments - Create/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario11-Create a recurring payment with greater mandate amount/Recurring Payments - Create/event.test.js index 22617f827cf..e862404c2b2 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario11-Create a recurring payment with greater mandate amount/Recurring Payments - Create/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario11-Create a recurring payment with greater mandate amount/Recurring Payments - Create/event.test.js @@ -1,56 +1,79 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/confirm - Content check if 'error' exists", + function () { + pm.expect(typeof jsonData.error !== "undefined").to.be.true; + }, +); // Response body should have value "invalid_request" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; - - + pm.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"); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario11-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario11-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json index d2c4a106d65..8fc4831ccc3 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario11-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario11-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json @@ -69,12 +69,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Capture/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Capture/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Capture/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Capture/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Capture/event.test.js index 7b5ea7df830..5b660989c50 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Capture/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Capture/event.test.js @@ -1,71 +1,97 @@ // Get the value of 'amount' from the environment const amount = pm.environment.get("amount"); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/capture - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); - -// Validate if response has JSON Body +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.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} - +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]:://payments/:id/capture - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; + pm.test( + "[POST]:://payments/:id/capture - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} // Response body should have value "{{amount}}" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '{{amount}}'", function() { - pm.expect(jsonData.amount).to.eql(amount); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '{{amount}}'", + function () { + pm.expect(jsonData.amount).to.eql(amount); + }, + ); +} // Response body should have value "{{amount}}" for "amount_received" if (jsonData?.amount_received) { -pm.test("[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '{{amount}}'", function() { - pm.expect(jsonData.amount_received).to.eql(amount); -})}; - - - - + pm.test( + "[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '{{amount}}'", + function () { + pm.expect(jsonData.amount_received).to.eql(amount); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Capture/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Capture/request.json index a72f5213579..e63913158bf 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Capture/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Capture/request.json @@ -21,14 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Create/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Create/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Create/event.prerequest.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Create/event.prerequest.js index 726d5815380..27965bb9c01 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Create/event.prerequest.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Create/event.prerequest.js @@ -1 +1 @@ -pm.environment.set("random_number", _.random(1000, 100000)) +pm.environment.set("random_number", _.random(1000, 100000)); diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Create/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Create/event.test.js index ee00d56ddb6..fc943633672 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Create/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Create/event.test.js @@ -1,53 +1,77 @@ pm.environment.set("amount", pm.response.json().amount); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" or "requires_capturefor" status if (jsonData?.status) { - pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing' or 'requires_capture'", function () { -pm.collectionVariables.set("variable_key", "variable_value"); - pm.expect(jsonData.status).to.be.oneOf(["processing", "requires_capture"]); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing' or 'requires_capture'", + function () { + pm.collectionVariables.set("variable_key", "variable_value"); + pm.expect(jsonData.status).to.be.oneOf([ + "processing", + "requires_capture", + ]); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Create/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Create/request.json index 947eb896b58..613a57f2342 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Create/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Retrieve-copy/event.test.js index 9db2286cb10..611bb438bb8 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Retrieve-copy/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" or "failed" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", function() { - pm.expect(jsonData.status).to.be.oneOf(["processing", "failed"]); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", + function () { + pm.expect(jsonData.status).to.be.oneOf(["processing", "failed"]); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Retrieve-copy/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Retrieve/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Retrieve/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Retrieve/event.test.js index 20c404390e5..51c55cde523 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Retrieve/event.test.js @@ -1,51 +1,75 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" or "requires_capturefor" status if (jsonData?.status) { - pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing' or 'requires_capture'", function () { -pm.collectionVariables.set("variable_key", "variable_value"); - pm.expect(jsonData.status).to.be.oneOf(["processing", "requires_capture"]); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing' or 'requires_capture'", + function () { + pm.collectionVariables.set("variable_key", "variable_value"); + pm.expect(jsonData.status).to.be.oneOf([ + "processing", + "requires_capture", + ]); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Retrieve/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Retrieve/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario2-Create payment with Manual capture/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario3-Confirming the payment without PMD/.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario3-Confirming the payment without PMD/.meta.json index 90b19864ee1..f2bee31ef66 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario3-Confirming the payment without PMD/.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario3-Confirming the payment without PMD/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Confirm" - ] + "childrenOrder": ["Payments - Create", "Payments - Confirm"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario3-Confirming the payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario3-Confirming the payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario3-Confirming the payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario3-Confirming the payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario3-Confirming the payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario3-Confirming the payment without PMD/Payments - Confirm/event.test.js index 1e8ba8cc3a6..e8d6b2216c5 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario3-Confirming the payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario3-Confirming the payment without PMD/Payments - Confirm/event.test.js @@ -1,58 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); -}); - - +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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario3-Confirming the payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario3-Confirming the payment without PMD/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario3-Confirming the payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario3-Confirming the payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario3-Confirming the payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario3-Confirming the payment without PMD/Payments - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario3-Confirming the payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario3-Confirming the payment without PMD/Payments - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario3-Confirming the payment without PMD/Payments - Create/event.prerequest.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario3-Confirming the payment without PMD/Payments - Create/event.prerequest.js index 726d5815380..27965bb9c01 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario3-Confirming the payment without PMD/Payments - Create/event.prerequest.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario3-Confirming the payment without PMD/Payments - Create/event.prerequest.js @@ -1 +1 @@ -pm.environment.set("random_number", _.random(1000, 100000)) +pm.environment.set("random_number", _.random(1000, 100000)); diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario3-Confirming the payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario3-Confirming the payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario3-Confirming the payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario3-Confirming the payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario3-Confirming the payment without PMD/Payments - Create/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario3-Confirming the payment without PMD/Payments - Create/request.json index 56568cc6352..23fdd23e496 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario3-Confirming the payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario3-Confirming the payment without PMD/Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Cancel/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Cancel/event.test.js index 0a0b2e2ffa8..ed2e7a64e60 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Cancel/event.test.js @@ -1,48 +1,74 @@ // Validate status 2xx or 4xx pm.test("[POST]::/payments/:id/capture - Status code is 2xx", function () { - pm.expect(pm.response.code).to.be.oneOf([200,400]); + pm.expect(pm.response.code).to.be.oneOf([200, 400]); }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/cancel - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/cancel - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" or "failed" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", function() { - pm.expect(jsonData.status).to.be.oneOf(["processing", "cancelled"]); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", + function () { + pm.expect(jsonData.status).to.be.oneOf(["processing", "cancelled"]); + }, + ); +} // Response body should have an error message as we try to capture a "processing" payment if (jsonData?.error) { - pm.test("[POST]::/payments - Content check if error type is 'invalid_request'", function() { - pm.expect(jsonData.error.message).to.be.oneOf(["You cannot cancelled this payment because it has status processing", "You cannot cancelled this payment because it has status failed"] ); -})}; - - + pm.test( + "[POST]::/payments - Content check if error type is 'invalid_request'", + function () { + pm.expect(jsonData.error.message).to.be.oneOf([ + "You cannot cancelled this payment because it has status processing", + "You cannot cancelled this payment because it has status failed", + ]); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Cancel/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Cancel/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Create/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Create/event.prerequest.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Create/event.prerequest.js index 862accaff2d..27965bb9c01 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Create/event.prerequest.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Create/event.prerequest.js @@ -1 +1 @@ -pm.environment.set("random_number", _.random(1000, 100000)) \ No newline at end of file +pm.environment.set("random_number", _.random(1000, 100000)); diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Create/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Create/event.test.js index 8df657bbf54..f46aa0517fc 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Create/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Create/event.test.js @@ -1,53 +1,77 @@ -pm.environment.set("random_number", _.random(1000, 100000)) +pm.environment.set("random_number", _.random(1000, 100000)); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" or "requires_capturefor" status if (jsonData?.status) { - pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing' or 'requires_capture'", function () { - pm.collectionVariables.set("variable_key", "variable_value"); - pm.expect(jsonData.status).to.be.oneOf(["processing", "requires_capture"]); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing' or 'requires_capture'", + function () { + pm.collectionVariables.set("variable_key", "variable_value"); + pm.expect(jsonData.status).to.be.oneOf([ + "processing", + "requires_capture", + ]); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Create/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Create/request.json index 39ee738d6dc..f2ba0f5cb45 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Create/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Retrieve-copy/event.test.js index 5f08709de73..7c8c6f5c65f 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Retrieve-copy/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "processing" or "failed" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", function() { - pm.expect(jsonData.status).to.be.oneOf(["processing", "cancelled"]); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", + function () { + pm.expect(jsonData.status).to.be.oneOf(["processing", "cancelled"]); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Retrieve-copy/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Retrieve/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Retrieve/event.test.js index fbe08454820..51c55cde523 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Retrieve/event.test.js @@ -1,51 +1,75 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" or "requires_capturefor" status if (jsonData?.status) { - pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing' or 'requires_capture'", function () { - pm.collectionVariables.set("variable_key", "variable_value"); - pm.expect(jsonData.status).to.be.oneOf(["processing", "requires_capture"]); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing' or 'requires_capture'", + function () { + pm.collectionVariables.set("variable_key", "variable_value"); + pm.expect(jsonData.status).to.be.oneOf([ + "processing", + "requires_capture", + ]); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Retrieve/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario4-Void the payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Capture/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Capture/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Capture/event.test.js index c3e7afc6760..46bf201d1ce 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Capture/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Capture/event.test.js @@ -1,59 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Capture/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Capture/request.json index 766a8330d6e..6c934a9132c 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Capture/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Create/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Create/event.prerequest.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Create/event.prerequest.js index 862accaff2d..27965bb9c01 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Create/event.prerequest.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Create/event.prerequest.js @@ -1 +1 @@ -pm.environment.set("random_number", _.random(1000, 100000)) \ No newline at end of file +pm.environment.set("random_number", _.random(1000, 100000)); diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Create/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Create/event.test.js index 7ea54bb82a8..f46aa0517fc 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Create/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Create/event.test.js @@ -1,53 +1,77 @@ -pm.environment.set("random_number", _.random(1000, 100000)) +pm.environment.set("random_number", _.random(1000, 100000)); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" or "requires_capturefor" status if (jsonData?.status) { - pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing' or 'requires_capture'", function () { -pm.collectionVariables.set("variable_key", "variable_value"); - pm.expect(jsonData.status).to.be.oneOf(["processing", "requires_capture"]); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing' or 'requires_capture'", + function () { + pm.collectionVariables.set("variable_key", "variable_value"); + pm.expect(jsonData.status).to.be.oneOf([ + "processing", + "requires_capture", + ]); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Create/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Create/request.json index 793caad5486..9215a6a326b 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Create/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Retrieve/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Retrieve/event.test.js index fbe08454820..51c55cde523 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Retrieve/event.test.js @@ -1,51 +1,75 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" or "requires_capturefor" status if (jsonData?.status) { - pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing' or 'requires_capture'", function () { - pm.collectionVariables.set("variable_key", "variable_value"); - pm.expect(jsonData.status).to.be.oneOf(["processing", "requires_capture"]); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing' or 'requires_capture'", + function () { + pm.collectionVariables.set("variable_key", "variable_value"); + pm.expect(jsonData.status).to.be.oneOf([ + "processing", + "requires_capture", + ]); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Retrieve/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario5-Capture the succeeded payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Capture/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Capture/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Capture/event.test.js index 9f6d640c022..1abf5cf7c31 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Capture/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Capture/event.test.js @@ -1,62 +1,85 @@ // Get the value of 'amount' from the environment const capture_amount = parseInt(pm.environment.get("amount")) + 1000; -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Capture/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Capture/request.json index e18ddb89565..305ee93aaee 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Capture/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Capture/request.json @@ -21,14 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Create/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Create/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Create/event.test.js index a2a01eac0c9..2dcd7866349 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Create/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Create/event.test.js @@ -1,52 +1,73 @@ -pm.environment.set("random_number", _.random(100, 100000)) +pm.environment.set("random_number", _.random(100, 100000)); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Create/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Create/request.json index 39ee738d6dc..f2ba0f5cb45 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Create/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Retrieve-copy/event.test.js index 6b03e0b9ee6..34beacf976b 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Retrieve-copy/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" 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"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Retrieve-copy/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Retrieve/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Retrieve/event.test.js index 6b03e0b9ee6..34beacf976b 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" 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"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Retrieve/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario6-Capture greater amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario7-Void the success_slash_failure payment/.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario7-Void the success_slash_failure payment/.meta.json index afba25ab6d6..5ff1a7cb4e8 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario7-Void the success_slash_failure payment/.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario7-Void the success_slash_failure payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Cancel" - ] + "childrenOrder": ["Payments - Create", "Payments - Cancel"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario7-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario7-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario7-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario7-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario7-Void the success_slash_failure payment/Payments - Cancel/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario7-Void the success_slash_failure payment/Payments - Cancel/event.test.js index d7879c70d87..0f869a6dfb8 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario7-Void the success_slash_failure payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario7-Void the success_slash_failure payment/Payments - Cancel/event.test.js @@ -1,50 +1,69 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/cancel - Status code is 4xx", function () { - pm.response.to.be.error; + 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/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/cancel - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; - - - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario7-Void the success_slash_failure payment/Payments - Cancel/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario7-Void the success_slash_failure payment/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario7-Void the success_slash_failure payment/Payments - Cancel/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario7-Void the success_slash_failure payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario7-Void the success_slash_failure payment/Payments - Create/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario7-Void the success_slash_failure payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario7-Void the success_slash_failure payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario7-Void the success_slash_failure payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario7-Void the success_slash_failure payment/Payments - Create/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario7-Void the success_slash_failure payment/Payments - Create/event.test.js index 9db2286cb10..611bb438bb8 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario7-Void the success_slash_failure payment/Payments - Create/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario7-Void the success_slash_failure payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" or "failed" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", function() { - pm.expect(jsonData.status).to.be.oneOf(["processing", "failed"]); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", + function () { + pm.expect(jsonData.status).to.be.oneOf(["processing", "failed"]); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario7-Void the success_slash_failure payment/Payments - Create/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario7-Void the success_slash_failure payment/Payments - Create/request.json index 9e0cb13f14a..6ae4c4896a0 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario7-Void the success_slash_failure payment/Payments - Create/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario7-Void the success_slash_failure payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Payments - Create/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Payments - Create/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Payments - Create/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Payments - Create/event.test.js index 9db2286cb10..611bb438bb8 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Payments - Create/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" or "failed" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", function() { - pm.expect(jsonData.status).to.be.oneOf(["processing", "failed"]); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", + function () { + pm.expect(jsonData.status).to.be.oneOf(["processing", "failed"]); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Payments - Create/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Payments - Create/request.json index 9e0cb13f14a..6ae4c4896a0 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Payments - Create/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Payments - Retrieve/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Payments - Retrieve/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Payments - Retrieve/event.test.js index 9db2286cb10..611bb438bb8 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" or "failed" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", function() { - pm.expect(jsonData.status).to.be.oneOf(["processing", "failed"]); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", + function () { + pm.expect(jsonData.status).to.be.oneOf(["processing", "failed"]); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Payments - Retrieve/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Payments - Retrieve/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Refunds - Create/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Refunds - Create/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Refunds - Create/event.test.js index 991cd0b5648..33e9e001baf 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Refunds - Create/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Refunds - Create/event.test.js @@ -1,28 +1,42 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - Status code is 2xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have an error message as we try to refund a "processing" payment if (jsonData?.error) { - pm.test("[POST]::/payments - Content check if error type is 'invalid_request'", function() { - pm.expect(jsonData.error.message).to.eql("The payment has not succeeded yet. Please pass a successful payment to initiate refund"); -})}; - + pm.test( + "[POST]::/payments - Content check if error type is 'invalid_request'", + function () { + pm.expect(jsonData.error.message).to.eql( + "The payment has not succeeded yet. Please pass a successful payment to initiate refund", + ); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Refunds - Create/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Refunds - Create/request.json index 5e306df7a55..5f4c58816d5 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Refunds - Create/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Refunds - Retrieve/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Refunds - Retrieve/event.test.js index e6234f27afe..6b122d1df53 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Refunds - Retrieve/event.test.js @@ -1,28 +1,40 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - Status code is 2xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have an error message as we try to retrieve refund that doesn't exist if (jsonData?.error) { - pm.test("[POST]::/payments - Content check if error type is 'invalid_request'", function() { - pm.expect(jsonData.error.message).to.eql("Unrecognized request URL"); -})}; - + pm.test( + "[POST]::/payments - Content check if error type is 'invalid_request'", + function () { + pm.expect(jsonData.error.message).to.eql("Unrecognized request URL"); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Refunds - Retrieve/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Refunds - Retrieve/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario8-Refund full payment Copy/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario9-Refund exceeds amount/Payments - Create/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario9-Refund exceeds amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario9-Refund exceeds amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario9-Refund exceeds amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario9-Refund exceeds amount/Payments - Create/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario9-Refund exceeds amount/Payments - Create/event.test.js index 9db2286cb10..611bb438bb8 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario9-Refund exceeds amount/Payments - Create/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario9-Refund exceeds amount/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" or "failed" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", function() { - pm.expect(jsonData.status).to.be.oneOf(["processing", "failed"]); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", + function () { + pm.expect(jsonData.status).to.be.oneOf(["processing", "failed"]); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario9-Refund exceeds amount/Payments - Create/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario9-Refund exceeds amount/Payments - Create/request.json index 9e0cb13f14a..6ae4c4896a0 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario9-Refund exceeds amount/Payments - Create/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario9-Refund exceeds amount/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario9-Refund exceeds amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario9-Refund exceeds amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario9-Refund exceeds amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario9-Refund exceeds amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario9-Refund exceeds amount/Payments - Retrieve/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario9-Refund exceeds amount/Payments - Retrieve/event.test.js index 9db2286cb10..611bb438bb8 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario9-Refund exceeds amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario9-Refund exceeds amount/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" or "failed" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", function() { - pm.expect(jsonData.status).to.be.oneOf(["processing", "failed"]); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing' or 'failed' ", + function () { + pm.expect(jsonData.status).to.be.oneOf(["processing", "failed"]); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario9-Refund exceeds amount/Payments - Retrieve/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario9-Refund exceeds amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario9-Refund exceeds amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario9-Refund exceeds amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario9-Refund exceeds amount/Refunds - Create/.event.meta.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario9-Refund exceeds amount/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario9-Refund exceeds amount/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario9-Refund exceeds amount/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario9-Refund exceeds amount/Refunds - Create/event.test.js b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario9-Refund exceeds amount/Refunds - Create/event.test.js index 9537daf6187..776dbd70712 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario9-Refund exceeds amount/Refunds - Create/event.test.js +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario9-Refund exceeds amount/Refunds - Create/event.test.js @@ -1,33 +1,48 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/refunds - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + 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; -}); +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"); -})}; - + 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"); + }, + ); +} diff --git a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario9-Refund exceeds amount/Refunds - Create/request.json b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario9-Refund exceeds amount/Refunds - Create/request.json index 326319e8fdf..10de81bed08 100644 --- a/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario9-Refund exceeds amount/Refunds - Create/request.json +++ b/postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario9-Refund exceeds amount/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/authorizedotnet/Health check/.meta.json b/postman/collection-dir/authorizedotnet/Health check/.meta.json index 66ee7e50cab..579f9fd541c 100644 --- a/postman/collection-dir/authorizedotnet/Health check/.meta.json +++ b/postman/collection-dir/authorizedotnet/Health check/.meta.json @@ -1,5 +1,3 @@ { - "childrenOrder": [ - "New Request" - ] + "childrenOrder": ["New Request"] } diff --git a/postman/collection-dir/authorizedotnet/Health check/New Request/.event.meta.json b/postman/collection-dir/authorizedotnet/Health check/New Request/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/authorizedotnet/Health check/New Request/.event.meta.json +++ b/postman/collection-dir/authorizedotnet/Health check/New Request/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/authorizedotnet/Health check/New Request/event.test.js b/postman/collection-dir/authorizedotnet/Health check/New Request/event.test.js index 325a8c8a479..b490b8be090 100644 --- a/postman/collection-dir/authorizedotnet/Health check/New Request/event.test.js +++ b/postman/collection-dir/authorizedotnet/Health check/New Request/event.test.js @@ -1,4 +1,4 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - Status code is 2xx", function () { - pm.response.to.be.success; -}); \ No newline at end of file + pm.response.to.be.success; +}); diff --git a/postman/collection-dir/authorizedotnet/Health check/New Request/request.json b/postman/collection-dir/authorizedotnet/Health check/New Request/request.json index 4cc8d4b1a96..e40e9396178 100644 --- a/postman/collection-dir/authorizedotnet/Health check/New Request/request.json +++ b/postman/collection-dir/authorizedotnet/Health check/New Request/request.json @@ -10,11 +10,7 @@ ], "url": { "raw": "{{baseUrl}}/health", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "health" - ] + "host": ["{{baseUrl}}"], + "path": ["health"] } } diff --git a/postman/collection-dir/authorizedotnet/event.test.js b/postman/collection-dir/authorizedotnet/event.test.js index 69037688f22..fb52caec30f 100644 --- a/postman/collection-dir/authorizedotnet/event.test.js +++ b/postman/collection-dir/authorizedotnet/event.test.js @@ -1,11 +1,13 @@ // 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("[LOG]::payment_id - " + jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log("[LOG]::payment_id - " + jsonData.payment_id); } -console.log("[LOG]::x-request-id - " + pm.response.headers.get('x-request-id')); \ No newline at end of file +console.log("[LOG]::x-request-id - " + pm.response.headers.get("x-request-id")); diff --git a/postman/collection-dir/bambora/.event.meta.json b/postman/collection-dir/bambora/.event.meta.json index 2df9d47d936..eb871bbcb9b 100644 --- a/postman/collection-dir/bambora/.event.meta.json +++ b/postman/collection-dir/bambora/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.prerequest.js", - "event.test.js" - ] + "eventOrder": ["event.prerequest.js", "event.test.js"] } diff --git a/postman/collection-dir/bambora/.meta.json b/postman/collection-dir/bambora/.meta.json index 91b6a65c5bc..d513035ce2d 100644 --- a/postman/collection-dir/bambora/.meta.json +++ b/postman/collection-dir/bambora/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Health check", - "Flow Testcases" - ] + "childrenOrder": ["Health check", "Flow Testcases"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/.meta.json b/postman/collection-dir/bambora/Flow Testcases/.meta.json index 1bbce843680..023989e1e49 100644 --- a/postman/collection-dir/bambora/Flow Testcases/.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/.meta.json @@ -1,7 +1,3 @@ { - "childrenOrder": [ - "QuickStart", - "Happy Cases", - "Variation Cases" - ] + "childrenOrder": ["QuickStart", "Happy Cases", "Variation Cases"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js index 72f142cc731..c48d8e2d054 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json index 158215c07a9..9329da1f7ee 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json @@ -100,12 +100,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js index c5bae16750d..c48d8e2d054 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json index 158215c07a9..9329da1f7ee 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json @@ -100,12 +100,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js index 01c5b744eac..4974bba662f 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js @@ -1,58 +1,76 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "refunds" -pm.test("[POST]::/payments - Content check if 'refunds' exists", function() { - pm.expect((typeof jsonData.refunds !== "undefined")).to.be.true; +pm.test("[POST]::/payments - Content check if 'refunds' exists", function () { + pm.expect(typeof jsonData.refunds !== "undefined").to.be.true; }); - - - diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js index d26ca4f668d..66f034dc91b 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "100" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '1000'", function() { - pm.expect(jsonData.amount).to.eql(100); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '1000'", + function () { + pm.expect(jsonData.amount).to.eql(100); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json index 49682c95224..142ab27d01c 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js index 04650f547a2..c1dd16a4551 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '540'", function() { - pm.expect(jsonData.amount).to.eql(540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '540'", + function () { + pm.expect(jsonData.amount).to.eql(540); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json index d18aaf8befd..9fe125ce8ea 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js index e4d4872dbea..d94f650592f 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "100" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '1000'", function() { - pm.expect(jsonData.amount).to.eql(100); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '1000'", + function () { + pm.expect(jsonData.amount).to.eql(100); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js index 7bff0a3c12c..920a7c47f36 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '540'", function() { - pm.expect(jsonData.amount).to.eql(540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '540'", + function () { + pm.expect(jsonData.amount).to.eql(540); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js index bb50904fd89..f92fba3d044 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js index 5698484c741..55dc35b9128 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json index 9f6b89fe7fb..afb52aa63cb 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json @@ -100,12 +100,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js index 03ccae1adb0..aced67dbfb7 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js index 5d9e5785e6e..6d812bc75fe 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id/confirm - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id/confirm - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json index 51668835b46..4a53d499e5b 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "card", "payment_method_data": { "card": { @@ -32,14 +53,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json index aeee3228e7b..4c00586d479 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json @@ -79,12 +79,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js index 03ccae1adb0..aced67dbfb7 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js index 7e2b9c5b07c..6fb0ae6faf8 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js @@ -1,68 +1,94 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/capture - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); - -// Validate if response has JSON Body +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.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} - +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]:://payments/:id/capture - 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 "1000" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '1000'", function() { - pm.expect(jsonData.amount).to.eql(1000); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '1000'", + function () { + pm.expect(jsonData.amount).to.eql(1000); + }, + ); +} // 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); -})}; - - - - + pm.test( + "[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '600'", + function () { + pm.expect(jsonData.amount_received).to.eql(600); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json index ae3e65c501f..8d8df15d919 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js index b0e69cad2c2..d683186aa00 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json index 144a4735ec5..e68c1575579 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json @@ -100,12 +100,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js index 1a0942b5f88..5c7196baa4f 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js index 9632bd19048..dcf3f191643 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js @@ -1,43 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/cancel - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type 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(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "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"); -})}; - - - + pm.test( + "[POST]::/payments/:id/cancel - Content check if value for 'status' matches 'cancelled'", + function () { + pm.expect(jsonData.status).to.eql("cancelled"); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js index b0e69cad2c2..d683186aa00 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json index 144a4735ec5..e68c1575579 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json @@ -100,12 +100,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js index f4e0ab9b2aa..5e52e13a59e 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "cancelled" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'", function() { - pm.expect(jsonData.status).to.eql("cancelled"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'", + function () { + pm.expect(jsonData.status).to.eql("cancelled"); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json index 158215c07a9..9329da1f7ee 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json @@ -100,12 +100,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js index d28f25fa46d..56ea9efbac0 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "1000" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '1000'", function() { - pm.expect(jsonData.amount).to.eql(1000); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '1000'", + function () { + pm.expect(jsonData.amount).to.eql(1000); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json index b56057fad5d..caed7818578 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js index b71b33264a4..8651b4e7d03 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "1000" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(1000); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(1000); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/bambora/Flow Testcases/QuickStart/API Key - Create/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/QuickStart/API Key - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/QuickStart/API Key - Create/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/QuickStart/API Key - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/QuickStart/API Key - Create/event.test.js b/postman/collection-dir/bambora/Flow Testcases/QuickStart/API Key - Create/event.test.js index bc42e83a761..4e27c5a5025 100644 --- a/postman/collection-dir/bambora/Flow Testcases/QuickStart/API Key - Create/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/QuickStart/API Key - Create/event.test.js @@ -1,32 +1,46 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/api_keys/:merchant_id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/api_keys/:merchant_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/api_keys/:merchant_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; try { jsonData = pm.response.json(); -} catch(e) { -} +} catch (e) {} // pm.collectionVariables - Set api_key_id as variable for jsonData.key_id if (jsonData?.key_id) { - pm.collectionVariables.set("api_key_id", jsonData.key_id); - console.log("- use {{api_key_id}} as collection variable for value", jsonData.key_id); + pm.collectionVariables.set("api_key_id", jsonData.key_id); + console.log( + "- use {{api_key_id}} as collection variable for value", + jsonData.key_id, + ); } else { - console.log('INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value", jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/QuickStart/API Key - Create/request.json b/postman/collection-dir/bambora/Flow Testcases/QuickStart/API Key - Create/request.json index 29c2490d1bc..2210d14da0e 100644 --- a/postman/collection-dir/bambora/Flow Testcases/QuickStart/API Key - Create/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/QuickStart/API Key - Create/request.json @@ -35,13 +35,8 @@ }, "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/bambora/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/bambora/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js b/postman/collection-dir/bambora/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js index 538b393c084..7de0d5beb31 100644 --- a/postman/collection-dir/bambora/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js @@ -1,37 +1,56 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - 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]::/accounts - 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", + ); }); // 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 merchant_id as variable for jsonData.merchant_id if (jsonData?.merchant_id) { - pm.collectionVariables.set("merchant_id", jsonData.merchant_id); - console.log("- use {{merchant_id}} as collection variable for value",jsonData.merchant_id); + pm.collectionVariables.set("merchant_id", jsonData.merchant_id); + console.log( + "- use {{merchant_id}} as collection variable for value", + jsonData.merchant_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value",jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} // pm.collectionVariables - Set publishable_key as variable for jsonData.publishable_key if (jsonData?.publishable_key) { - pm.collectionVariables.set("publishable_key", jsonData.publishable_key); - console.log("- use {{publishable_key}} as collection variable for value",jsonData.publishable_key); + pm.collectionVariables.set("publishable_key", jsonData.publishable_key); + console.log( + "- use {{publishable_key}} as collection variable for value", + jsonData.publishable_key, + ); } else { - console.log('INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.", + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/QuickStart/Merchant Account - Create/request.json b/postman/collection-dir/bambora/Flow Testcases/QuickStart/Merchant Account - Create/request.json index 45a28d21b7c..6e18cb498f5 100644 --- a/postman/collection-dir/bambora/Flow Testcases/QuickStart/Merchant Account - Create/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/QuickStart/Merchant Account - Create/request.json @@ -84,12 +84,8 @@ }, "url": { "raw": "{{baseUrl}}/accounts", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "accounts" - ] + "host": ["{{baseUrl}}"], + "path": ["accounts"] }, "description": "Create a new account for a merchant. The merchant could be a seller or retailer or client who likes to receive and send payments." } diff --git a/postman/collection-dir/bambora/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/bambora/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js b/postman/collection-dir/bambora/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js index b831702461e..88e92d8d84a 100644 --- a/postman/collection-dir/bambora/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js @@ -1,21 +1,39 @@ -// Validate status 2xx -pm.test("[POST]::/account/:account_id/connectors - 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.be.success; + }, +); // Validate if response header has matching content-type -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"); -}); +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){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id if (jsonData?.merchant_connector_id) { - pm.collectionVariables.set("merchant_connector_id", jsonData.merchant_connector_id); - console.log("- use {{merchant_connector_id}} as collection variable for value",jsonData.merchant_connector_id); + pm.collectionVariables.set( + "merchant_connector_id", + jsonData.merchant_connector_id, + ); + console.log( + "- use {{merchant_connector_id}} as collection variable for value", + jsonData.merchant_connector_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.", + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/QuickStart/Payment Connector - Create/request.json b/postman/collection-dir/bambora/Flow Testcases/QuickStart/Payment Connector - Create/request.json index 8b45ed26e9d..9473aa1d8ee 100644 --- a/postman/collection-dir/bambora/Flow Testcases/QuickStart/Payment Connector - Create/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/QuickStart/Payment Connector - Create/request.json @@ -258,14 +258,8 @@ }, "url": { "raw": "{{baseUrl}}/account/:account_id/connectors", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/bambora/Flow Testcases/QuickStart/Payments - Create/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/QuickStart/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/QuickStart/Payments - Create/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/QuickStart/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/QuickStart/Payments - Create/event.test.js b/postman/collection-dir/bambora/Flow Testcases/QuickStart/Payments - Create/event.test.js index 62142d52dca..a6947db94c0 100644 --- a/postman/collection-dir/bambora/Flow Testcases/QuickStart/Payments - Create/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/QuickStart/Payments - Create/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/QuickStart/Payments - Create/request.json b/postman/collection-dir/bambora/Flow Testcases/QuickStart/Payments - Create/request.json index 51b71756136..51fb8ceeea8 100644 --- a/postman/collection-dir/bambora/Flow Testcases/QuickStart/Payments - Create/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/QuickStart/Payments - Create/request.json @@ -100,12 +100,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bambora/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js b/postman/collection-dir/bambora/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js index 4dd072b2222..d0a02af7436 100644 --- a/postman/collection-dir/bambora/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // 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.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/QuickStart/Payments - Retrieve/request.json b/postman/collection-dir/bambora/Flow Testcases/QuickStart/Payments - Retrieve/request.json index c71774083b2..ef0b213739d 100644 --- a/postman/collection-dir/bambora/Flow Testcases/QuickStart/Payments - Retrieve/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/QuickStart/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/bambora/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/QuickStart/Refunds - Create/event.test.js b/postman/collection-dir/bambora/Flow Testcases/QuickStart/Refunds - Create/event.test.js index c862e8e68a7..dbc930608cb 100644 --- a/postman/collection-dir/bambora/Flow Testcases/QuickStart/Refunds - Create/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/QuickStart/Refunds - Create/event.test.js @@ -1,21 +1,30 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/QuickStart/Refunds - Create/request.json b/postman/collection-dir/bambora/Flow Testcases/QuickStart/Refunds - Create/request.json index 4dbca4d01f2..0c13281ee15 100644 --- a/postman/collection-dir/bambora/Flow Testcases/QuickStart/Refunds - Create/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/QuickStart/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/bambora/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js b/postman/collection-dir/bambora/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js index b1e1f12ba50..bbd8e544e2c 100644 --- a/postman/collection-dir/bambora/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js @@ -1,22 +1,30 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); - // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/QuickStart/Refunds - Retrieve/request.json b/postman/collection-dir/bambora/Flow Testcases/QuickStart/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/bambora/Flow Testcases/QuickStart/Refunds - Retrieve/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/QuickStart/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js index 2a63db39e24..c9a72ccbadc 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js @@ -1,54 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector'", function() { - pm.expect(jsonData.error.type).to.eql("connector"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector'", + function () { + pm.expect(jsonData.error.type).to.eql("connector"); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json index c1c662ebdf2..dab5ebe2f88 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json @@ -89,12 +89,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js index 7d118e2f5e5..edb1f073bee 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js @@ -1,56 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); - // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json index d5076f657b8..789f0d1b32e 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json @@ -89,12 +89,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js index 0e6401222ff..52680771c31 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js @@ -1,55 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector_error'", function() { - pm.expect(jsonData.error.type).to.eql("connector_error"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'", + function () { + pm.expect(jsonData.error.type).to.eql("connector_error"); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json index ce076fc61d0..1b33c00dbbf 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json @@ -100,12 +100,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js index ab9532fab05..c1dffb25d86 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js @@ -1,55 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json index 9ea4b0db81c..b163cc8c412 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json @@ -89,12 +89,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json index 90b19864ee1..f2bee31ef66 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Confirm" - ] + "childrenOrder": ["Payments - Create", "Payments - Confirm"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js index 1e8ba8cc3a6..e8d6b2216c5 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js @@ -1,58 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); -}); - - +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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json index aeee3228e7b..4c00586d479 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json @@ -79,12 +79,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js index c3e7afc6760..46bf201d1ce 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js @@ -1,59 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json index 766a8330d6e..6c934a9132c 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js index b0e69cad2c2..d683186aa00 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json index 144a4735ec5..e68c1575579 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json @@ -100,12 +100,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js index 6b03e0b9ee6..34beacf976b 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" 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"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json index cafd3a6808e..6df7c0a1943 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Capture" - ] + "childrenOrder": ["Payments - Create", "Payments - Capture"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js index c3e7afc6760..46bf201d1ce 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js @@ -1,59 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json index 766a8330d6e..6c934a9132c 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json index 158215c07a9..9329da1f7ee 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json @@ -100,12 +100,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json index afba25ab6d6..5ff1a7cb4e8 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Cancel" - ] + "childrenOrder": ["Payments - Create", "Payments - Cancel"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js index d7879c70d87..0f869a6dfb8 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js @@ -1,50 +1,69 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/cancel - Status code is 4xx", function () { - pm.response.to.be.error; + 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/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/cancel - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; - - - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json index 158215c07a9..9329da1f7ee 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json @@ -100,12 +100,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json index c360c3f254f..a5f73d508e1 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json @@ -89,12 +89,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js index 9537daf6187..776dbd70712 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js @@ -1,33 +1,48 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/refunds - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + 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; -}); +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"); -})}; - + 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"); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json index 326319e8fdf..10de81bed08 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js index 65232a76373..55dc35b9128 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; - - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json index 87ac9443adf..cf8a1b61ffd 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json @@ -89,12 +89,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js index 42bf3e0ac45..fdb8a946f3d 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js index 30888b5cc0c..d3c4451760d 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js @@ -1,32 +1,48 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/refunds - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + 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; -}); +pm.test( + "[POST]::/payments/:id/confirm - Content check if 'error' exists", + function () { + pm.expect(typeof jsonData.error !== "undefined").to.be.true; + }, +); // Response body should have value "invalid_request" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; + pm.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"); + }, + ); +} diff --git a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json index d18aaf8befd..9fe125ce8ea 100644 --- a/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json +++ b/postman/collection-dir/bambora/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/bambora/Health check/.meta.json b/postman/collection-dir/bambora/Health check/.meta.json index 66ee7e50cab..579f9fd541c 100644 --- a/postman/collection-dir/bambora/Health check/.meta.json +++ b/postman/collection-dir/bambora/Health check/.meta.json @@ -1,5 +1,3 @@ { - "childrenOrder": [ - "New Request" - ] + "childrenOrder": ["New Request"] } diff --git a/postman/collection-dir/bambora/Health check/New Request/.event.meta.json b/postman/collection-dir/bambora/Health check/New Request/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora/Health check/New Request/.event.meta.json +++ b/postman/collection-dir/bambora/Health check/New Request/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora/Health check/New Request/event.test.js b/postman/collection-dir/bambora/Health check/New Request/event.test.js index 325a8c8a479..b490b8be090 100644 --- a/postman/collection-dir/bambora/Health check/New Request/event.test.js +++ b/postman/collection-dir/bambora/Health check/New Request/event.test.js @@ -1,4 +1,4 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - Status code is 2xx", function () { - pm.response.to.be.success; -}); \ No newline at end of file + pm.response.to.be.success; +}); diff --git a/postman/collection-dir/bambora/Health check/New Request/request.json b/postman/collection-dir/bambora/Health check/New Request/request.json index 4cc8d4b1a96..e40e9396178 100644 --- a/postman/collection-dir/bambora/Health check/New Request/request.json +++ b/postman/collection-dir/bambora/Health check/New Request/request.json @@ -10,11 +10,7 @@ ], "url": { "raw": "{{baseUrl}}/health", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "health" - ] + "host": ["{{baseUrl}}"], + "path": ["health"] } } diff --git a/postman/collection-dir/bambora/event.test.js b/postman/collection-dir/bambora/event.test.js index 69037688f22..fb52caec30f 100644 --- a/postman/collection-dir/bambora/event.test.js +++ b/postman/collection-dir/bambora/event.test.js @@ -1,11 +1,13 @@ // 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("[LOG]::payment_id - " + jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log("[LOG]::payment_id - " + jsonData.payment_id); } -console.log("[LOG]::x-request-id - " + pm.response.headers.get('x-request-id')); \ No newline at end of file +console.log("[LOG]::x-request-id - " + pm.response.headers.get("x-request-id")); diff --git a/postman/collection-dir/bambora_3ds/.event.meta.json b/postman/collection-dir/bambora_3ds/.event.meta.json index 2df9d47d936..eb871bbcb9b 100644 --- a/postman/collection-dir/bambora_3ds/.event.meta.json +++ b/postman/collection-dir/bambora_3ds/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.prerequest.js", - "event.test.js" - ] + "eventOrder": ["event.prerequest.js", "event.test.js"] } diff --git a/postman/collection-dir/bambora_3ds/.meta.json b/postman/collection-dir/bambora_3ds/.meta.json index 91b6a65c5bc..d513035ce2d 100644 --- a/postman/collection-dir/bambora_3ds/.meta.json +++ b/postman/collection-dir/bambora_3ds/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Health check", - "Flow Testcases" - ] + "childrenOrder": ["Health check", "Flow Testcases"] } diff --git a/postman/collection-dir/bambora_3ds/Flow Testcases/.meta.json b/postman/collection-dir/bambora_3ds/Flow Testcases/.meta.json index 1bbce843680..023989e1e49 100644 --- a/postman/collection-dir/bambora_3ds/Flow Testcases/.meta.json +++ b/postman/collection-dir/bambora_3ds/Flow Testcases/.meta.json @@ -1,7 +1,3 @@ { - "childrenOrder": [ - "QuickStart", - "Happy Cases", - "Variation Cases" - ] + "childrenOrder": ["QuickStart", "Happy Cases", "Variation Cases"] } diff --git a/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/.meta.json b/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/.meta.json +++ b/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json b/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js b/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js index 1388cde7c89..39cbb3ee90e 100644 --- a/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js +++ b/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js @@ -1,54 +1,80 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", function() { - pm.expect(jsonData.status).to.eql("requires_customer_action"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", + function () { + pm.expect(jsonData.status).to.eql("requires_customer_action"); + }, + ); +} // Response body should have "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; -}); +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; + }, +); diff --git a/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json b/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json index 5b0a9d5ce66..dac2027f991 100644 --- a/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json +++ b/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json @@ -100,12 +100,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js b/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js index 08ad2d6a233..02ab01502c1 100644 --- a/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + 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"); + }, + ); +} diff --git a/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json b/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js b/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js index a269c21f770..1fa0afa6402 100644 --- a/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js @@ -1,56 +1,83 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments/:id/confirm - Content check if 'next_action.redirect_to_url' exists", function() { - pm.expect((typeof jsonData.next_action.redirect_to_url !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments/:id/confirm - Content check if 'next_action.redirect_to_url' exists", + function () { + pm.expect(typeof jsonData.next_action.redirect_to_url !== "undefined").to.be + .true; + }, +); diff --git a/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json b/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json index c52ea7d2be6..90bd4c8a92a 100644 --- a/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json +++ b/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "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", @@ -34,14 +55,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json b/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js b/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js index 5698484c741..55dc35b9128 100644 --- a/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js +++ b/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json b/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json index ae1a0d4bc57..cf0f69f5c69 100644 --- a/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json +++ b/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json @@ -100,12 +100,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js b/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json b/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/bambora_3ds/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/API Key - Create/.event.meta.json b/postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/API Key - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/API Key - Create/.event.meta.json +++ b/postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/API Key - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/API Key - Create/event.test.js b/postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/API Key - Create/event.test.js index bc42e83a761..4e27c5a5025 100644 --- a/postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/API Key - Create/event.test.js +++ b/postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/API Key - Create/event.test.js @@ -1,32 +1,46 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/api_keys/:merchant_id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/api_keys/:merchant_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/api_keys/:merchant_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; try { jsonData = pm.response.json(); -} catch(e) { -} +} catch (e) {} // pm.collectionVariables - Set api_key_id as variable for jsonData.key_id if (jsonData?.key_id) { - pm.collectionVariables.set("api_key_id", jsonData.key_id); - console.log("- use {{api_key_id}} as collection variable for value", jsonData.key_id); + pm.collectionVariables.set("api_key_id", jsonData.key_id); + console.log( + "- use {{api_key_id}} as collection variable for value", + jsonData.key_id, + ); } else { - console.log('INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value", jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} diff --git a/postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/API Key - Create/request.json b/postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/API Key - Create/request.json index 29c2490d1bc..2210d14da0e 100644 --- a/postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/API Key - Create/request.json +++ b/postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/API Key - Create/request.json @@ -35,13 +35,8 @@ }, "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json b/postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json +++ b/postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js b/postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js index 538b393c084..7de0d5beb31 100644 --- a/postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js +++ b/postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js @@ -1,37 +1,56 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - 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]::/accounts - 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", + ); }); // 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 merchant_id as variable for jsonData.merchant_id if (jsonData?.merchant_id) { - pm.collectionVariables.set("merchant_id", jsonData.merchant_id); - console.log("- use {{merchant_id}} as collection variable for value",jsonData.merchant_id); + pm.collectionVariables.set("merchant_id", jsonData.merchant_id); + console.log( + "- use {{merchant_id}} as collection variable for value", + jsonData.merchant_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value",jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} // pm.collectionVariables - Set publishable_key as variable for jsonData.publishable_key if (jsonData?.publishable_key) { - pm.collectionVariables.set("publishable_key", jsonData.publishable_key); - console.log("- use {{publishable_key}} as collection variable for value",jsonData.publishable_key); + pm.collectionVariables.set("publishable_key", jsonData.publishable_key); + console.log( + "- use {{publishable_key}} as collection variable for value", + jsonData.publishable_key, + ); } else { - console.log('INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.", + ); +} diff --git a/postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/Merchant Account - Create/request.json b/postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/Merchant Account - Create/request.json index ffeea3410a4..dcbf46ee538 100644 --- a/postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/Merchant Account - Create/request.json +++ b/postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/Merchant Account - Create/request.json @@ -84,12 +84,8 @@ }, "url": { "raw": "{{baseUrl}}/accounts", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "accounts" - ] + "host": ["{{baseUrl}}"], + "path": ["accounts"] }, "description": "Create a new account for a merchant. The merchant could be a seller or retailer or client who likes to receive and send payments." } diff --git a/postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json b/postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json +++ b/postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js b/postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js index b831702461e..88e92d8d84a 100644 --- a/postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js +++ b/postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js @@ -1,21 +1,39 @@ -// Validate status 2xx -pm.test("[POST]::/account/:account_id/connectors - 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.be.success; + }, +); // Validate if response header has matching content-type -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"); -}); +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){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id if (jsonData?.merchant_connector_id) { - pm.collectionVariables.set("merchant_connector_id", jsonData.merchant_connector_id); - console.log("- use {{merchant_connector_id}} as collection variable for value",jsonData.merchant_connector_id); + pm.collectionVariables.set( + "merchant_connector_id", + jsonData.merchant_connector_id, + ); + console.log( + "- use {{merchant_connector_id}} as collection variable for value", + jsonData.merchant_connector_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.", + ); +} diff --git a/postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/Payment Connector - Create/request.json b/postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/Payment Connector - Create/request.json index 8b45ed26e9d..9473aa1d8ee 100644 --- a/postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/Payment Connector - Create/request.json +++ b/postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/Payment Connector - Create/request.json @@ -258,14 +258,8 @@ }, "url": { "raw": "{{baseUrl}}/account/:account_id/connectors", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/.meta.json b/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/.meta.json index b53a19f4fb5..2e7ad4bbcf3 100644 --- a/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/.meta.json +++ b/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/.meta.json @@ -1,5 +1,3 @@ { - "childrenOrder": [ - "Scenario6-Create 3DS payment with greater capture" - ] + "childrenOrder": ["Scenario6-Create 3DS payment with greater capture"] } diff --git a/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/.event.meta.json b/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/event.test.js b/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/event.test.js index f125e2a7885..46bf201d1ce 100644 --- a/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/event.test.js +++ b/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/event.test.js @@ -1,61 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + 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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/request.json b/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/request.json index 14ac5f8bb4a..2b31ac6d784 100644 --- a/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/request.json +++ b/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/.event.meta.json b/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/.event.meta.json +++ b/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/event.test.js b/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/event.test.js index c289d7d25fb..39cbb3ee90e 100644 --- a/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/event.test.js +++ b/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/event.test.js @@ -1,55 +1,80 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", function() { - pm.expect(jsonData.status).to.eql("requires_customer_action"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", + function () { + pm.expect(jsonData.status).to.eql("requires_customer_action"); + }, + ); +} // Response body should have "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; -}); - +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; + }, +); diff --git a/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json b/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json index 0afb44039ca..7366ca1750f 100644 --- a/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json +++ b/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json @@ -89,12 +89,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/.event.meta.json b/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/event.test.js b/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/event.test.js index 1f59e2b00ac..02ab01502c1 100644 --- a/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/request.json b/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/request.json +++ b/postman/collection-dir/bambora_3ds/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/bambora_3ds/Health check/.meta.json b/postman/collection-dir/bambora_3ds/Health check/.meta.json index 66ee7e50cab..579f9fd541c 100644 --- a/postman/collection-dir/bambora_3ds/Health check/.meta.json +++ b/postman/collection-dir/bambora_3ds/Health check/.meta.json @@ -1,5 +1,3 @@ { - "childrenOrder": [ - "New Request" - ] + "childrenOrder": ["New Request"] } diff --git a/postman/collection-dir/bambora_3ds/Health check/New Request/.event.meta.json b/postman/collection-dir/bambora_3ds/Health check/New Request/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bambora_3ds/Health check/New Request/.event.meta.json +++ b/postman/collection-dir/bambora_3ds/Health check/New Request/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bambora_3ds/Health check/New Request/event.test.js b/postman/collection-dir/bambora_3ds/Health check/New Request/event.test.js index 325a8c8a479..b490b8be090 100644 --- a/postman/collection-dir/bambora_3ds/Health check/New Request/event.test.js +++ b/postman/collection-dir/bambora_3ds/Health check/New Request/event.test.js @@ -1,4 +1,4 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - Status code is 2xx", function () { - pm.response.to.be.success; -}); \ No newline at end of file + pm.response.to.be.success; +}); diff --git a/postman/collection-dir/bambora_3ds/Health check/New Request/request.json b/postman/collection-dir/bambora_3ds/Health check/New Request/request.json index 4cc8d4b1a96..e40e9396178 100644 --- a/postman/collection-dir/bambora_3ds/Health check/New Request/request.json +++ b/postman/collection-dir/bambora_3ds/Health check/New Request/request.json @@ -10,11 +10,7 @@ ], "url": { "raw": "{{baseUrl}}/health", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "health" - ] + "host": ["{{baseUrl}}"], + "path": ["health"] } } diff --git a/postman/collection-dir/bambora_3ds/event.test.js b/postman/collection-dir/bambora_3ds/event.test.js index 69037688f22..fb52caec30f 100644 --- a/postman/collection-dir/bambora_3ds/event.test.js +++ b/postman/collection-dir/bambora_3ds/event.test.js @@ -1,11 +1,13 @@ // 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("[LOG]::payment_id - " + jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log("[LOG]::payment_id - " + jsonData.payment_id); } -console.log("[LOG]::x-request-id - " + pm.response.headers.get('x-request-id')); \ No newline at end of file +console.log("[LOG]::x-request-id - " + pm.response.headers.get("x-request-id")); diff --git a/postman/collection-dir/bluesnap/.event.meta.json b/postman/collection-dir/bluesnap/.event.meta.json index 2df9d47d936..eb871bbcb9b 100644 --- a/postman/collection-dir/bluesnap/.event.meta.json +++ b/postman/collection-dir/bluesnap/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.prerequest.js", - "event.test.js" - ] + "eventOrder": ["event.prerequest.js", "event.test.js"] } diff --git a/postman/collection-dir/bluesnap/.meta.json b/postman/collection-dir/bluesnap/.meta.json index 91b6a65c5bc..d513035ce2d 100644 --- a/postman/collection-dir/bluesnap/.meta.json +++ b/postman/collection-dir/bluesnap/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Health check", - "Flow Testcases" - ] + "childrenOrder": ["Health check", "Flow Testcases"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/.meta.json index 1bbce843680..023989e1e49 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/.meta.json @@ -1,7 +1,3 @@ { - "childrenOrder": [ - "QuickStart", - "Happy Cases", - "Variation Cases" - ] + "childrenOrder": ["QuickStart", "Happy Cases", "Variation Cases"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js index 72f142cc731..c48d8e2d054 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json index d2d7c92c7b7..cf879796777 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json @@ -78,12 +78,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js index c5bae16750d..c48d8e2d054 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json index d2d7c92c7b7..cf879796777 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json @@ -78,12 +78,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js index 01c5b744eac..4974bba662f 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js @@ -1,58 +1,76 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "refunds" -pm.test("[POST]::/payments - Content check if 'refunds' exists", function() { - pm.expect((typeof jsonData.refunds !== "undefined")).to.be.true; +pm.test("[POST]::/payments - Content check if 'refunds' exists", function () { + pm.expect(typeof jsonData.refunds !== "undefined").to.be.true; }); - - - diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js index 47a24658e0e..ca5a5b5d712 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'pending'", function() { - pm.expect(jsonData.status).to.eql("pending"); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'status' matches 'pending'", + function () { + pm.expect(jsonData.status).to.eql("pending"); + }, + ); +} // Response body should have value "1000" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '1000'", function() { - pm.expect(jsonData.amount).to.eql(1000); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '1000'", + function () { + pm.expect(jsonData.amount).to.eql(1000); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json index b56057fad5d..caed7818578 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js index 6f87a195571..68a0024f331 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'pending'", function() { - pm.expect(jsonData.status).to.eql("pending"); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'status' matches 'pending'", + function () { + pm.expect(jsonData.status).to.eql("pending"); + }, + ); +} // Response body should have value "540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '540'", function() { - pm.expect(jsonData.amount).to.eql(540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '540'", + function () { + pm.expect(jsonData.amount).to.eql(540); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json index d18aaf8befd..9fe125ce8ea 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js index bfe3137afb0..f0351c05701 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '1000'", function() { - pm.expect(jsonData.amount).to.eql(1000); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '1000'", + function () { + pm.expect(jsonData.amount).to.eql(1000); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js index 7bff0a3c12c..920a7c47f36 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '540'", function() { - pm.expect(jsonData.amount).to.eql(540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '540'", + function () { + pm.expect(jsonData.amount).to.eql(540); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js index bb50904fd89..f92fba3d044 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js index 5698484c741..55dc35b9128 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json index 89e77e7079e..a224e4801f6 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json @@ -78,12 +78,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js index 03ccae1adb0..aced67dbfb7 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js index 5d9e5785e6e..6d812bc75fe 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id/confirm - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id/confirm - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json index bb2b0cdc1b0..402aa25fef8 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "card", "payment_method_data": { "card": { @@ -32,14 +53,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json index af13dcdb8d9..302bb6bacff 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json @@ -68,12 +68,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js index 03ccae1adb0..aced67dbfb7 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js index 1e2875ec9f6..2d7dbc507fb 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js @@ -1,68 +1,94 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/capture - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); - -// Validate if response has JSON Body +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.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} - +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]:://payments/:id/capture - 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 "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "6000" for "amount_received" if (jsonData?.amount_received) { -pm.test("[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", function() { - pm.expect(jsonData.amount_received).to.eql(6000); -})}; - - - - + pm.test( + "[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", + function () { + pm.expect(jsonData.amount_received).to.eql(6000); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json index 8975575ca40..9fe257ed85e 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js index b0e69cad2c2..d683186aa00 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json index 49e921186bb..25b3254440e 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json @@ -78,12 +78,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js index 1a0942b5f88..5c7196baa4f 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js index 9632bd19048..dcf3f191643 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js @@ -1,43 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/cancel - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type 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(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "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"); -})}; - - - + pm.test( + "[POST]::/payments/:id/cancel - Content check if value for 'status' matches 'cancelled'", + function () { + pm.expect(jsonData.status).to.eql("cancelled"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js index b0e69cad2c2..d683186aa00 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json index 49e921186bb..25b3254440e 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json @@ -78,12 +78,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js index f4e0ab9b2aa..5e52e13a59e 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "cancelled" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'", function() { - pm.expect(jsonData.status).to.eql("cancelled"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'", + function () { + pm.expect(jsonData.status).to.eql("cancelled"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js index 1388cde7c89..39cbb3ee90e 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js @@ -1,54 +1,80 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", function() { - pm.expect(jsonData.status).to.eql("requires_customer_action"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", + function () { + pm.expect(jsonData.status).to.eql("requires_customer_action"); + }, + ); +} // Response body should have "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; -}); +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; + }, +); diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json index 7e4f6b207cf..b65703d6e8c 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json @@ -78,12 +78,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js index 08ad2d6a233..02ab01502c1 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + 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"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js index edf87c9ccdf..1fa0afa6402 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js @@ -1,57 +1,83 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments/:id/confirm - Content check if 'next_action.redirect_to_url' exists", function() { - pm.expect((typeof jsonData.next_action.redirect_to_url !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments/:id/confirm - Content check if 'next_action.redirect_to_url' exists", + function () { + pm.expect(typeof jsonData.next_action.redirect_to_url !== "undefined").to.be + .true; + }, +); diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js index 5698484c741..55dc35b9128 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json index ffbe159fc29..c8ed633c9ff 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json @@ -78,12 +78,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json index d2d7c92c7b7..cf879796777 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json @@ -78,12 +78,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js index db627313d75..d49c0aaea58 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'pending'", function() { - pm.expect(jsonData.status).to.eql("pending"); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'status' matches 'pending'", + function () { + pm.expect(jsonData.status).to.eql("pending"); + }, + ); +} // Response body should have value "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json index 5e306df7a55..5f4c58816d5 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js index 07a9529b82e..6cb4312a60a 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/API Key - Create/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/API Key - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/API Key - Create/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/API Key - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/API Key - Create/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/API Key - Create/event.test.js index bc42e83a761..4e27c5a5025 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/API Key - Create/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/API Key - Create/event.test.js @@ -1,32 +1,46 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/api_keys/:merchant_id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/api_keys/:merchant_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/api_keys/:merchant_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; try { jsonData = pm.response.json(); -} catch(e) { -} +} catch (e) {} // pm.collectionVariables - Set api_key_id as variable for jsonData.key_id if (jsonData?.key_id) { - pm.collectionVariables.set("api_key_id", jsonData.key_id); - console.log("- use {{api_key_id}} as collection variable for value", jsonData.key_id); + pm.collectionVariables.set("api_key_id", jsonData.key_id); + console.log( + "- use {{api_key_id}} as collection variable for value", + jsonData.key_id, + ); } else { - console.log('INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value", jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/API Key - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/API Key - Create/request.json index 29c2490d1bc..2210d14da0e 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/API Key - Create/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/API Key - Create/request.json @@ -35,13 +35,8 @@ }, "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js index 538b393c084..7de0d5beb31 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js @@ -1,37 +1,56 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - 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]::/accounts - 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", + ); }); // 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 merchant_id as variable for jsonData.merchant_id if (jsonData?.merchant_id) { - pm.collectionVariables.set("merchant_id", jsonData.merchant_id); - console.log("- use {{merchant_id}} as collection variable for value",jsonData.merchant_id); + pm.collectionVariables.set("merchant_id", jsonData.merchant_id); + console.log( + "- use {{merchant_id}} as collection variable for value", + jsonData.merchant_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value",jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} // pm.collectionVariables - Set publishable_key as variable for jsonData.publishable_key if (jsonData?.publishable_key) { - pm.collectionVariables.set("publishable_key", jsonData.publishable_key); - console.log("- use {{publishable_key}} as collection variable for value",jsonData.publishable_key); + pm.collectionVariables.set("publishable_key", jsonData.publishable_key); + console.log( + "- use {{publishable_key}} as collection variable for value", + jsonData.publishable_key, + ); } else { - console.log('INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.", + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Merchant Account - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Merchant Account - Create/request.json index ffeea3410a4..dcbf46ee538 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Merchant Account - Create/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Merchant Account - Create/request.json @@ -84,12 +84,8 @@ }, "url": { "raw": "{{baseUrl}}/accounts", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "accounts" - ] + "host": ["{{baseUrl}}"], + "path": ["accounts"] }, "description": "Create a new account for a merchant. The merchant could be a seller or retailer or client who likes to receive and send payments." } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js index 1e1a83c2b27..8867e2c8f09 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js @@ -1,34 +1,64 @@ -// Validate status 2xx -pm.test("[POST]::/account/:account_id/connectors - 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.be.success; + }, +); // Validate if response header has matching content-type -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"); -}); +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){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id if (jsonData?.merchant_connector_id) { - pm.collectionVariables.set("merchant_connector_id", jsonData.merchant_connector_id); - console.log("- use {{merchant_connector_id}} as collection variable for value",jsonData.merchant_connector_id); + pm.collectionVariables.set( + "merchant_connector_id", + jsonData.merchant_connector_id, + ); + console.log( + "- use {{merchant_connector_id}} as collection variable for value", + jsonData.merchant_connector_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.", + ); +} // Validate the auth_type and its credentials -pm.test("[POST]::/account/:account_id/connectors - Content check if auth_type is BodyKey", function() { - pm.expect((typeof jsonData.connector_account_details.auth_type !== "BodyKey")).to.be.true; -}); +pm.test( + "[POST]::/account/:account_id/connectors - Content check if auth_type is BodyKey", + function () { + pm.expect(typeof jsonData.connector_account_details.auth_type !== "BodyKey") + .to.be.true; + }, +); -pm.test("[POST]::/account/:account_id/connectors - Content check if 'api_key' exists", function() { - pm.expect((typeof jsonData.connector_account_details.api_key !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/account/:account_id/connectors - Content check if 'api_key' exists", + function () { + pm.expect(typeof jsonData.connector_account_details.api_key !== "undefined") + .to.be.true; + }, +); -pm.test("[POST]::/account/:account_id/connectors - Content check if 'key1' exists", function() { - pm.expect((typeof jsonData.connector_account_details.key1 !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/account/:account_id/connectors - Content check if 'key1' exists", + function () { + pm.expect(typeof jsonData.connector_account_details.key1 !== "undefined").to + .be.true; + }, +); diff --git a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payment Connector - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payment Connector - Create/request.json index 63fdcba1347..ef3bdcd3aa6 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payment Connector - Create/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payment Connector - Create/request.json @@ -53,10 +53,7 @@ "payment_method_types": [ { "payment_method_type": "credit", - "card_networks": [ - "Visa", - "Mastercard" - ], + "card_networks": ["Visa", "Mastercard"], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, @@ -96,14 +93,8 @@ }, "url": { "raw": "{{baseUrl}}/account/:account_id/connectors", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payments - Create/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payments - Create/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payments - Create/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payments - Create/event.test.js index 62142d52dca..a6947db94c0 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payments - Create/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payments - Create/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payments - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payments - Create/request.json index ea8af41ae08..4159d076f50 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payments - Create/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payments - Create/request.json @@ -78,12 +78,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js index 4dd072b2222..d0a02af7436 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // 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.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payments - Retrieve/request.json b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payments - Retrieve/request.json index c71774083b2..ef0b213739d 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payments - Retrieve/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Refunds - Create/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Refunds - Create/event.test.js index c862e8e68a7..dbc930608cb 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Refunds - Create/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Refunds - Create/event.test.js @@ -1,21 +1,30 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Refunds - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Refunds - Create/request.json index 4dbca4d01f2..0c13281ee15 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Refunds - Create/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js index b1e1f12ba50..bbd8e544e2c 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js @@ -1,22 +1,30 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); - // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Refunds - Retrieve/request.json b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Refunds - Retrieve/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js index 08f14e045be..edb1f073bee 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js @@ -1,54 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json index 7689fb86368..642b173fea8 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json @@ -78,12 +78,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js index 7d118e2f5e5..edb1f073bee 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js @@ -1,56 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); - // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json index 02bce2fa09a..8608137c575 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json @@ -78,12 +78,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js index 0e6401222ff..52680771c31 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js @@ -1,55 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector_error'", function() { - pm.expect(jsonData.error.type).to.eql("connector_error"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'", + function () { + pm.expect(jsonData.error.type).to.eql("connector_error"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json index 0a16b975817..c7ad4cb2749 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json @@ -75,12 +75,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js index 630c4f25cae..3976f7f496a 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js @@ -1,55 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector'", function() { - pm.expect(jsonData.error.type).to.eql("connector"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector'", + function () { + pm.expect(jsonData.error.type).to.eql("connector"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json index 79a70e782fc..d68379f9444 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json index 90b19864ee1..f2bee31ef66 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Confirm" - ] + "childrenOrder": ["Payments - Create", "Payments - Confirm"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js index 1e8ba8cc3a6..e8d6b2216c5 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js @@ -1,58 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); -}); - - +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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json index b28abd0c309..e3b1e235042 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json @@ -67,12 +67,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js index c3e7afc6760..46bf201d1ce 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js @@ -1,59 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json index 766a8330d6e..6c934a9132c 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js index b0e69cad2c2..d683186aa00 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json index 49e921186bb..25b3254440e 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json @@ -78,12 +78,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js index 6b03e0b9ee6..34beacf976b 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" 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"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json index cafd3a6808e..6df7c0a1943 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Capture" - ] + "childrenOrder": ["Payments - Create", "Payments - Capture"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js index c3e7afc6760..46bf201d1ce 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js @@ -1,59 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json index 766a8330d6e..6c934a9132c 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json index d2d7c92c7b7..cf879796777 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json @@ -78,12 +78,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json index afba25ab6d6..5ff1a7cb4e8 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Cancel" - ] + "childrenOrder": ["Payments - Create", "Payments - Cancel"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js index d7879c70d87..0f869a6dfb8 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js @@ -1,50 +1,69 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/cancel - Status code is 4xx", function () { - pm.response.to.be.error; + 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/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/cancel - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; - - - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json index d2d7c92c7b7..cf879796777 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json @@ -78,12 +78,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/event.test.js index f125e2a7885..46bf201d1ce 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/event.test.js @@ -1,61 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + 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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/request.json index 14ac5f8bb4a..2b31ac6d784 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/event.test.js index c289d7d25fb..39cbb3ee90e 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/event.test.js @@ -1,55 +1,80 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", function() { - pm.expect(jsonData.status).to.eql("requires_customer_action"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", + function () { + pm.expect(jsonData.status).to.eql("requires_customer_action"); + }, + ); +} // Response body should have "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; -}); - +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; + }, +); diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json index 72d7de35495..ce837e7a52d 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json @@ -78,12 +78,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/event.test.js index 1f59e2b00ac..02ab01502c1 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json index d2d7c92c7b7..cf879796777 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json @@ -78,12 +78,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js index 9537daf6187..776dbd70712 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js @@ -1,33 +1,48 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/refunds - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + 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; -}); +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"); -})}; - + 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"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json index 326319e8fdf..10de81bed08 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js index 65232a76373..55dc35b9128 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; - - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json index 7186bddbe07..119353069bd 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js index 42bf3e0ac45..fdb8a946f3d 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js index 30888b5cc0c..d3c4451760d 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js @@ -1,32 +1,48 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/refunds - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + 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; -}); +pm.test( + "[POST]::/payments/:id/confirm - Content check if 'error' exists", + function () { + pm.expect(typeof jsonData.error !== "undefined").to.be.true; + }, +); // Response body should have value "invalid_request" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; + pm.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"); + }, + ); +} diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json index d18aaf8befd..9fe125ce8ea 100644 --- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json +++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/bluesnap/Health check/.meta.json b/postman/collection-dir/bluesnap/Health check/.meta.json index 66ee7e50cab..579f9fd541c 100644 --- a/postman/collection-dir/bluesnap/Health check/.meta.json +++ b/postman/collection-dir/bluesnap/Health check/.meta.json @@ -1,5 +1,3 @@ { - "childrenOrder": [ - "New Request" - ] + "childrenOrder": ["New Request"] } diff --git a/postman/collection-dir/bluesnap/Health check/New Request/.event.meta.json b/postman/collection-dir/bluesnap/Health check/New Request/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/bluesnap/Health check/New Request/.event.meta.json +++ b/postman/collection-dir/bluesnap/Health check/New Request/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/bluesnap/Health check/New Request/event.test.js b/postman/collection-dir/bluesnap/Health check/New Request/event.test.js index 325a8c8a479..b490b8be090 100644 --- a/postman/collection-dir/bluesnap/Health check/New Request/event.test.js +++ b/postman/collection-dir/bluesnap/Health check/New Request/event.test.js @@ -1,4 +1,4 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - Status code is 2xx", function () { - pm.response.to.be.success; -}); \ No newline at end of file + pm.response.to.be.success; +}); diff --git a/postman/collection-dir/bluesnap/Health check/New Request/request.json b/postman/collection-dir/bluesnap/Health check/New Request/request.json index 4cc8d4b1a96..e40e9396178 100644 --- a/postman/collection-dir/bluesnap/Health check/New Request/request.json +++ b/postman/collection-dir/bluesnap/Health check/New Request/request.json @@ -10,11 +10,7 @@ ], "url": { "raw": "{{baseUrl}}/health", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "health" - ] + "host": ["{{baseUrl}}"], + "path": ["health"] } } diff --git a/postman/collection-dir/bluesnap/event.test.js b/postman/collection-dir/bluesnap/event.test.js index 69037688f22..fb52caec30f 100644 --- a/postman/collection-dir/bluesnap/event.test.js +++ b/postman/collection-dir/bluesnap/event.test.js @@ -1,11 +1,13 @@ // 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("[LOG]::payment_id - " + jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log("[LOG]::payment_id - " + jsonData.payment_id); } -console.log("[LOG]::x-request-id - " + pm.response.headers.get('x-request-id')); \ No newline at end of file +console.log("[LOG]::x-request-id - " + pm.response.headers.get("x-request-id")); diff --git a/postman/collection-dir/braintree/.event.meta.json b/postman/collection-dir/braintree/.event.meta.json index 2df9d47d936..eb871bbcb9b 100644 --- a/postman/collection-dir/braintree/.event.meta.json +++ b/postman/collection-dir/braintree/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.prerequest.js", - "event.test.js" - ] + "eventOrder": ["event.prerequest.js", "event.test.js"] } diff --git a/postman/collection-dir/braintree/.meta.json b/postman/collection-dir/braintree/.meta.json index 91b6a65c5bc..d513035ce2d 100644 --- a/postman/collection-dir/braintree/.meta.json +++ b/postman/collection-dir/braintree/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Health check", - "Flow Testcases" - ] + "childrenOrder": ["Health check", "Flow Testcases"] } diff --git a/postman/collection-dir/braintree/Flow Testcases/.meta.json b/postman/collection-dir/braintree/Flow Testcases/.meta.json index 1bbce843680..023989e1e49 100644 --- a/postman/collection-dir/braintree/Flow Testcases/.meta.json +++ b/postman/collection-dir/braintree/Flow Testcases/.meta.json @@ -1,7 +1,3 @@ { - "childrenOrder": [ - "QuickStart", - "Happy Cases", - "Variation Cases" - ] + "childrenOrder": ["QuickStart", "Happy Cases", "Variation Cases"] } diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 1 - Create payment with confirm true/.meta.json b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 1 - Create payment with confirm true/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 1 - Create payment with confirm true/.meta.json +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 1 - Create payment with confirm true/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 1 - Create payment with confirm true/Payments - Create/.event.meta.json b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 1 - Create payment with confirm true/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 1 - Create payment with confirm true/Payments - Create/.event.meta.json +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 1 - Create payment with confirm true/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 1 - Create payment with confirm true/Payments - Create/event.test.js b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 1 - Create payment with confirm true/Payments - Create/event.test.js index 7bd53fe946b..16c37817f0b 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 1 - Create payment with confirm true/Payments - Create/event.test.js +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 1 - Create payment with confirm true/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 1 - Create payment with confirm true/Payments - Create/request.json b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 1 - Create payment with confirm true/Payments - Create/request.json index a1e5375d70c..6a3c5a782cd 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 1 - Create payment with confirm true/Payments - Create/request.json +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 1 - Create payment with confirm true/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 1 - Create payment with confirm true/Payments - Retrieve/.event.meta.json b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 1 - Create payment with confirm true/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 1 - Create payment with confirm true/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 1 - Create payment with confirm true/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 1 - Create payment with confirm true/Payments - Retrieve/event.test.js b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 1 - Create payment with confirm true/Payments - Retrieve/event.test.js index 5f6bcb6027f..83ba283f472 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 1 - Create payment with confirm true/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 1 - Create payment with confirm true/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 1 - Create payment with confirm true/Payments - Retrieve/request.json b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 1 - Create payment with confirm true/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 1 - Create payment with confirm true/Payments - Retrieve/request.json +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 1 - Create payment with confirm true/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 2 - Create payment with confirm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 2 - Create payment with confirm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 2 - Create payment with confirm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 2 - Create payment with confirm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 2 - Create payment with confirm false/Payments - Confirm/event.test.js b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 2 - Create payment with confirm false/Payments - Confirm/event.test.js index dec48e36875..37ee4bfbceb 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 2 - Create payment with confirm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 2 - Create payment with confirm false/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 2 - Create payment with confirm false/Payments - Confirm/request.json b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 2 - Create payment with confirm false/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 2 - Create payment with confirm false/Payments - Confirm/request.json +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 2 - Create payment with confirm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 2 - Create payment with confirm false/Payments - Create/.event.meta.json b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 2 - Create payment with confirm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 2 - Create payment with confirm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 2 - Create payment with confirm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 2 - Create payment with confirm false/Payments - Create/event.test.js b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 2 - Create payment with confirm false/Payments - Create/event.test.js index 5698484c741..55dc35b9128 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 2 - Create payment with confirm false/Payments - Create/event.test.js +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 2 - Create payment with confirm false/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 2 - Create payment with confirm false/Payments - Create/request.json b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 2 - Create payment with confirm false/Payments - Create/request.json index d3f960ef4ea..19bdfe4d56d 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 2 - Create payment with confirm false/Payments - Create/request.json +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 2 - Create payment with confirm false/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 2 - Create payment with confirm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 2 - Create payment with confirm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 2 - Create payment with confirm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 2 - Create payment with confirm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 2 - Create payment with confirm false/Payments - Retrieve/event.test.js b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 2 - Create payment with confirm false/Payments - Retrieve/event.test.js index 2056e33b7b7..03b39a354a3 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 2 - Create payment with confirm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 2 - Create payment with confirm false/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 2 - Create payment with confirm false/Payments - Retrieve/request.json b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 2 - Create payment with confirm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 2 - Create payment with confirm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 2 - Create payment with confirm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 3 - Create payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 3 - Create payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 3 - Create payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 3 - Create payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 3 - Create payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 3 - Create payment without PMD/Payments - Confirm/event.test.js index 71869299026..df082881525 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 3 - Create payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 3 - Create payment without PMD/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id/confirm - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id/confirm - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 3 - Create payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 3 - Create payment without PMD/Payments - Confirm/request.json index bb2b0cdc1b0..402aa25fef8 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 3 - Create payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 3 - Create payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "card", "payment_method_data": { "card": { @@ -32,14 +53,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 3 - Create payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 3 - Create payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 3 - Create payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 3 - Create payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 3 - Create payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 3 - Create payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 3 - Create payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 3 - Create payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 3 - Create payment without PMD/Payments - Create/request.json b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 3 - Create payment without PMD/Payments - Create/request.json index f26a5089190..ccb58134507 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 3 - Create payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 3 - Create payment without PMD/Payments - Create/request.json @@ -67,12 +67,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 3 - Create payment without PMD/Payments - Retrieve/.event.meta.json b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 3 - Create payment without PMD/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 3 - Create payment without PMD/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 3 - Create payment without PMD/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 3 - Create payment without PMD/Payments - Retrieve/event.test.js b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 3 - Create payment without PMD/Payments - Retrieve/event.test.js index 2056e33b7b7..03b39a354a3 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 3 - Create payment without PMD/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 3 - Create payment without PMD/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 3 - Create payment without PMD/Payments - Retrieve/request.json b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 3 - Create payment without PMD/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 3 - Create payment without PMD/Payments - Retrieve/request.json +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 3 - Create payment without PMD/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 4 - Void the payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 4 - Void the payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 4 - Void the payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 4 - Void the payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 4 - Void the payment/Payments - Cancel/event.test.js b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 4 - Void the payment/Payments - Cancel/event.test.js index 368f72e4c0b..ce56fca7deb 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 4 - Void the payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 4 - Void the payment/Payments - Cancel/event.test.js @@ -1,44 +1,62 @@ // Disabling this for now since there's an issue with cancelling a payment in the code -// Validate status 2xx +// Validate status 2xx // pm.test("[POST]::/payments/:id/cancel - Status code is 2xx", function () { // pm.response.to.be.success; // }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/cancel - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); - -// Validate if response has JSON Body +pm.test( + "[POST]::/payments/:id/cancel - Content-Type 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(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "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"); -})}; - - - + pm.test( + "[POST]::/payments/:id/cancel - Content check if value for 'status' matches 'cancelled'", + function () { + pm.expect(jsonData.status).to.eql("cancelled"); + }, + ); +} diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 4 - Void the payment/Payments - Cancel/request.json b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 4 - Void the payment/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 4 - Void the payment/Payments - Cancel/request.json +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 4 - Void the payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 4 - Void the payment/Payments - Create/.event.meta.json b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 4 - Void the payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 4 - Void the payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 4 - Void the payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 4 - Void the payment/Payments - Create/event.test.js b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 4 - Void the payment/Payments - Create/event.test.js index b0e69cad2c2..d683186aa00 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 4 - Void the payment/Payments - Create/event.test.js +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 4 - Void the payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 4 - Void the payment/Payments - Create/request.json b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 4 - Void the payment/Payments - Create/request.json index 61a3c7020c4..16f272886c8 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 4 - Void the payment/Payments - Create/request.json +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 4 - Void the payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 4 - Void the payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 4 - Void the payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 4 - Void the payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 4 - Void the payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 4 - Void the payment/Payments - Retrieve/event.test.js b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 4 - Void the payment/Payments - Retrieve/event.test.js index c0014462d8d..37b802442fc 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 4 - Void the payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 4 - Void the payment/Payments - Retrieve/event.test.js @@ -1,50 +1,68 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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.", + ); +} // Disabling this for now since there's an issue with cancelling a payment in the code // Response body should have value "cancelled" for "status" // if (jsonData?.status) { // pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'", function() { // pm.expect(jsonData.status).to.eql("cancelled"); -// })}; \ No newline at end of file +// })}; diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 4 - Void the payment/Payments - Retrieve/request.json b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 4 - Void the payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 4 - Void the payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario 4 - Void the payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario5 - Create paypal wallet/Payments - Confirm/.event.meta.json b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario5 - Create paypal wallet/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario5 - Create paypal wallet/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario5 - Create paypal wallet/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario5 - Create paypal wallet/Payments - Confirm/event.test.js b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario5 - Create paypal wallet/Payments - Confirm/event.test.js index 171dd6dce5d..2d00498fbfd 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario5 - Create paypal wallet/Payments - Confirm/event.test.js +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario5 - Create paypal wallet/Payments - Confirm/event.test.js @@ -1,58 +1,84 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} // Response body should have value "paypal" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'paypal'", function() { - pm.expect(jsonData.payment_method_type).to.eql("paypal"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'paypal'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("paypal"); + }, + ); +} diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario5 - Create paypal wallet/Payments - Confirm/request.json b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario5 - Create paypal wallet/Payments - Confirm/request.json index 2abc90cf7a8..293db9e2385 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario5 - Create paypal wallet/Payments - Confirm/request.json +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario5 - Create paypal wallet/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "wallet", "payment_method_type": "paypal", "payment_experience": "invoke_sdk_client", @@ -32,14 +53,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario5 - Create paypal wallet/Payments - Create/.event.meta.json b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario5 - Create paypal wallet/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario5 - Create paypal wallet/Payments - Create/.event.meta.json +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario5 - Create paypal wallet/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario5 - Create paypal wallet/Payments - Create/event.test.js b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario5 - Create paypal wallet/Payments - Create/event.test.js index f495cd783d4..83b8880ddbd 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario5 - Create paypal wallet/Payments - Create/event.test.js +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario5 - Create paypal wallet/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario5 - Create paypal wallet/Payments - Create/request.json b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario5 - Create paypal wallet/Payments - Create/request.json index b7f75aef3ca..6ea5b37557e 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario5 - Create paypal wallet/Payments - Create/request.json +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario5 - Create paypal wallet/Payments - Create/request.json @@ -66,12 +66,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario5 - Create paypal wallet/Payments - Retrieve/.event.meta.json b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario5 - Create paypal wallet/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario5 - Create paypal wallet/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario5 - Create paypal wallet/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario5 - Create paypal wallet/Payments - Retrieve/event.test.js b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario5 - Create paypal wallet/Payments - Retrieve/event.test.js index 2056e33b7b7..03b39a354a3 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario5 - Create paypal wallet/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario5 - Create paypal wallet/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario5 - Create paypal wallet/Payments - Retrieve/request.json b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario5 - Create paypal wallet/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario5 - Create paypal wallet/Payments - Retrieve/request.json +++ b/postman/collection-dir/braintree/Flow Testcases/Happy Cases/Scenario5 - Create paypal wallet/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/braintree/Flow Testcases/QuickStart/API Key - Create/.event.meta.json b/postman/collection-dir/braintree/Flow Testcases/QuickStart/API Key - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/braintree/Flow Testcases/QuickStart/API Key - Create/.event.meta.json +++ b/postman/collection-dir/braintree/Flow Testcases/QuickStart/API Key - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/braintree/Flow Testcases/QuickStart/API Key - Create/event.test.js b/postman/collection-dir/braintree/Flow Testcases/QuickStart/API Key - Create/event.test.js index bc42e83a761..4e27c5a5025 100644 --- a/postman/collection-dir/braintree/Flow Testcases/QuickStart/API Key - Create/event.test.js +++ b/postman/collection-dir/braintree/Flow Testcases/QuickStart/API Key - Create/event.test.js @@ -1,32 +1,46 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/api_keys/:merchant_id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/api_keys/:merchant_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/api_keys/:merchant_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; try { jsonData = pm.response.json(); -} catch(e) { -} +} catch (e) {} // pm.collectionVariables - Set api_key_id as variable for jsonData.key_id if (jsonData?.key_id) { - pm.collectionVariables.set("api_key_id", jsonData.key_id); - console.log("- use {{api_key_id}} as collection variable for value", jsonData.key_id); + pm.collectionVariables.set("api_key_id", jsonData.key_id); + console.log( + "- use {{api_key_id}} as collection variable for value", + jsonData.key_id, + ); } else { - console.log('INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value", jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} diff --git a/postman/collection-dir/braintree/Flow Testcases/QuickStart/API Key - Create/request.json b/postman/collection-dir/braintree/Flow Testcases/QuickStart/API Key - Create/request.json index 29c2490d1bc..2210d14da0e 100644 --- a/postman/collection-dir/braintree/Flow Testcases/QuickStart/API Key - Create/request.json +++ b/postman/collection-dir/braintree/Flow Testcases/QuickStart/API Key - Create/request.json @@ -35,13 +35,8 @@ }, "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/braintree/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json b/postman/collection-dir/braintree/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/braintree/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json +++ b/postman/collection-dir/braintree/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/braintree/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js b/postman/collection-dir/braintree/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js index 538b393c084..7de0d5beb31 100644 --- a/postman/collection-dir/braintree/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js +++ b/postman/collection-dir/braintree/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js @@ -1,37 +1,56 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - 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]::/accounts - 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", + ); }); // 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 merchant_id as variable for jsonData.merchant_id if (jsonData?.merchant_id) { - pm.collectionVariables.set("merchant_id", jsonData.merchant_id); - console.log("- use {{merchant_id}} as collection variable for value",jsonData.merchant_id); + pm.collectionVariables.set("merchant_id", jsonData.merchant_id); + console.log( + "- use {{merchant_id}} as collection variable for value", + jsonData.merchant_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value",jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} // pm.collectionVariables - Set publishable_key as variable for jsonData.publishable_key if (jsonData?.publishable_key) { - pm.collectionVariables.set("publishable_key", jsonData.publishable_key); - console.log("- use {{publishable_key}} as collection variable for value",jsonData.publishable_key); + pm.collectionVariables.set("publishable_key", jsonData.publishable_key); + console.log( + "- use {{publishable_key}} as collection variable for value", + jsonData.publishable_key, + ); } else { - console.log('INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.", + ); +} diff --git a/postman/collection-dir/braintree/Flow Testcases/QuickStart/Merchant Account - Create/request.json b/postman/collection-dir/braintree/Flow Testcases/QuickStart/Merchant Account - Create/request.json index ed67effface..42bba8d0744 100644 --- a/postman/collection-dir/braintree/Flow Testcases/QuickStart/Merchant Account - Create/request.json +++ b/postman/collection-dir/braintree/Flow Testcases/QuickStart/Merchant Account - Create/request.json @@ -84,12 +84,8 @@ }, "url": { "raw": "{{baseUrl}}/accounts", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "accounts" - ] + "host": ["{{baseUrl}}"], + "path": ["accounts"] }, "description": "Create a new account for a merchant. The merchant could be a seller or retailer or client who likes to receive and send payments." } diff --git a/postman/collection-dir/braintree/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json b/postman/collection-dir/braintree/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/braintree/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json +++ b/postman/collection-dir/braintree/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/braintree/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js b/postman/collection-dir/braintree/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js index b831702461e..88e92d8d84a 100644 --- a/postman/collection-dir/braintree/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js +++ b/postman/collection-dir/braintree/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js @@ -1,21 +1,39 @@ -// Validate status 2xx -pm.test("[POST]::/account/:account_id/connectors - 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.be.success; + }, +); // Validate if response header has matching content-type -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"); -}); +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){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id if (jsonData?.merchant_connector_id) { - pm.collectionVariables.set("merchant_connector_id", jsonData.merchant_connector_id); - console.log("- use {{merchant_connector_id}} as collection variable for value",jsonData.merchant_connector_id); + pm.collectionVariables.set( + "merchant_connector_id", + jsonData.merchant_connector_id, + ); + console.log( + "- use {{merchant_connector_id}} as collection variable for value", + jsonData.merchant_connector_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.", + ); +} diff --git a/postman/collection-dir/braintree/Flow Testcases/QuickStart/Payment Connector - Create/request.json b/postman/collection-dir/braintree/Flow Testcases/QuickStart/Payment Connector - Create/request.json index ab875d100c1..209292129b3 100644 --- a/postman/collection-dir/braintree/Flow Testcases/QuickStart/Payment Connector - Create/request.json +++ b/postman/collection-dir/braintree/Flow Testcases/QuickStart/Payment Connector - Create/request.json @@ -56,10 +56,7 @@ "payment_method_types": [ { "payment_method_type": "credit", - "card_networks": [ - "Visa", - "Mastercard" - ], + "card_networks": ["Visa", "Mastercard"], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, @@ -67,10 +64,7 @@ }, { "payment_method_type": "debit", - "card_networks": [ - "Visa", - "Mastercard" - ], + "card_networks": ["Visa", "Mastercard"], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, @@ -129,14 +123,8 @@ }, "url": { "raw": "{{baseUrl}}/account/:account_id/connectors", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/braintree/Flow Testcases/QuickStart/Payments - Create/.event.meta.json b/postman/collection-dir/braintree/Flow Testcases/QuickStart/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/braintree/Flow Testcases/QuickStart/Payments - Create/.event.meta.json +++ b/postman/collection-dir/braintree/Flow Testcases/QuickStart/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/braintree/Flow Testcases/QuickStart/Payments - Create/event.test.js b/postman/collection-dir/braintree/Flow Testcases/QuickStart/Payments - Create/event.test.js index 62142d52dca..a6947db94c0 100644 --- a/postman/collection-dir/braintree/Flow Testcases/QuickStart/Payments - Create/event.test.js +++ b/postman/collection-dir/braintree/Flow Testcases/QuickStart/Payments - Create/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/braintree/Flow Testcases/QuickStart/Payments - Create/request.json b/postman/collection-dir/braintree/Flow Testcases/QuickStart/Payments - Create/request.json index a653f4f3dee..8d3ce0dc637 100644 --- a/postman/collection-dir/braintree/Flow Testcases/QuickStart/Payments - Create/request.json +++ b/postman/collection-dir/braintree/Flow Testcases/QuickStart/Payments - Create/request.json @@ -88,12 +88,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/braintree/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json b/postman/collection-dir/braintree/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/braintree/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/braintree/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/braintree/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js b/postman/collection-dir/braintree/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js index 4dd072b2222..d0a02af7436 100644 --- a/postman/collection-dir/braintree/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/braintree/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // 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.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/braintree/Flow Testcases/QuickStart/Payments - Retrieve/request.json b/postman/collection-dir/braintree/Flow Testcases/QuickStart/Payments - Retrieve/request.json index c71774083b2..ef0b213739d 100644 --- a/postman/collection-dir/braintree/Flow Testcases/QuickStart/Payments - Retrieve/request.json +++ b/postman/collection-dir/braintree/Flow Testcases/QuickStart/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json +++ b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js index e9dd0a7e18a..725102a94cb 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js +++ b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js @@ -1,54 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 "invalid_request 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"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json index 95dc1ddb380..be9c1cdcbc1 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json +++ b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json +++ b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js index dc599602940..725102a94cb 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js +++ b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js @@ -1,56 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); - // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 "invalid_request 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"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json index a828cc35172..b655487c04d 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json +++ b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json +++ b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js index 0e6401222ff..52680771c31 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js +++ b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js @@ -1,55 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector_error'", function() { - pm.expect(jsonData.error.type).to.eql("connector_error"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'", + function () { + pm.expect(jsonData.error.type).to.eql("connector_error"); + }, + ); +} diff --git a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json index 7d26805fcda..bbbd0143d0e 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json +++ b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json @@ -75,12 +75,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json +++ b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js index 4c6ae2dd574..c7b67c24003 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js +++ b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js @@ -1,55 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 "invalid_request 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"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json index 5aaf78579e6..c42feeaaf07 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json +++ b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 1 - Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 2 - Confirming the payment without PMD/.meta.json b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 2 - Confirming the payment without PMD/.meta.json index 90b19864ee1..f2bee31ef66 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 2 - Confirming the payment without PMD/.meta.json +++ b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 2 - Confirming the payment without PMD/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Confirm" - ] + "childrenOrder": ["Payments - Create", "Payments - Confirm"] } diff --git a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 2 - Confirming the payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 2 - Confirming the payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 2 - Confirming the payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 2 - Confirming the payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 2 - Confirming the payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 2 - Confirming the payment without PMD/Payments - Confirm/event.test.js index 1e8ba8cc3a6..e8d6b2216c5 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 2 - Confirming the payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 2 - Confirming the payment without PMD/Payments - Confirm/event.test.js @@ -1,58 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); -}); - - +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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 2 - Confirming the payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 2 - Confirming the payment without PMD/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 2 - Confirming the payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 2 - Confirming the payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 2 - Confirming the payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 2 - Confirming the payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 2 - Confirming the payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 2 - Confirming the payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 2 - Confirming the payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 2 - Confirming the payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 2 - Confirming the payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 2 - Confirming the payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 2 - Confirming the payment without PMD/Payments - Create/request.json b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 2 - Confirming the payment without PMD/Payments - Create/request.json index 34888748f38..f380b9696db 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 2 - Confirming the payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 2 - Confirming the payment without PMD/Payments - Create/request.json @@ -67,12 +67,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 3 - Void the success_slash_failure payment/.meta.json b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 3 - Void the success_slash_failure payment/.meta.json index afba25ab6d6..5ff1a7cb4e8 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 3 - Void the success_slash_failure payment/.meta.json +++ b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 3 - Void the success_slash_failure payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Cancel" - ] + "childrenOrder": ["Payments - Create", "Payments - Cancel"] } diff --git a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 3 - Void the success_slash_failure payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 3 - Void the success_slash_failure payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 3 - Void the success_slash_failure payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 3 - Void the success_slash_failure payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 3 - Void the success_slash_failure payment/Payments - Cancel/event.test.js b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 3 - Void the success_slash_failure payment/Payments - Cancel/event.test.js index d7879c70d87..0f869a6dfb8 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 3 - Void the success_slash_failure payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 3 - Void the success_slash_failure payment/Payments - Cancel/event.test.js @@ -1,50 +1,69 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/cancel - Status code is 4xx", function () { - pm.response.to.be.error; + 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/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/cancel - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; - - - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 3 - Void the success_slash_failure payment/Payments - Cancel/request.json b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 3 - Void the success_slash_failure payment/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 3 - Void the success_slash_failure payment/Payments - Cancel/request.json +++ b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 3 - Void the success_slash_failure payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 3 - Void the success_slash_failure payment/Payments - Create/.event.meta.json b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 3 - Void the success_slash_failure payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 3 - Void the success_slash_failure payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 3 - Void the success_slash_failure payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 3 - Void the success_slash_failure payment/Payments - Create/event.test.js b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 3 - Void the success_slash_failure payment/Payments - Create/event.test.js index cd0c4d65e21..16c37817f0b 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 3 - Void the success_slash_failure payment/Payments - Create/event.test.js +++ b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 3 - Void the success_slash_failure payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 3 - Void the success_slash_failure payment/Payments - Create/request.json b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 3 - Void the success_slash_failure payment/Payments - Create/request.json index 4f2df7bee12..eb7e5a0c29a 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 3 - Void the success_slash_failure payment/Payments - Create/request.json +++ b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 3 - Void the success_slash_failure payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 4 - Create a payment with greater capture/Payments - Capture/.event.meta.json b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 4 - Create a payment with greater capture/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 4 - Create a payment with greater capture/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 4 - Create a payment with greater capture/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 4 - Create a payment with greater capture/Payments - Capture/event.test.js b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 4 - Create a payment with greater capture/Payments - Capture/event.test.js index f125e2a7885..46bf201d1ce 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 4 - Create a payment with greater capture/Payments - Capture/event.test.js +++ b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 4 - Create a payment with greater capture/Payments - Capture/event.test.js @@ -1,61 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + 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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 4 - Create a payment with greater capture/Payments - Capture/request.json b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 4 - Create a payment with greater capture/Payments - Capture/request.json index 14ac5f8bb4a..2b31ac6d784 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 4 - Create a payment with greater capture/Payments - Capture/request.json +++ b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 4 - Create a payment with greater capture/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 4 - Create a payment with greater capture/Payments - Create/.event.meta.json b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 4 - Create a payment with greater capture/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 4 - Create a payment with greater capture/Payments - Create/.event.meta.json +++ b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 4 - Create a payment with greater capture/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 4 - Create a payment with greater capture/Payments - Create/event.test.js b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 4 - Create a payment with greater capture/Payments - Create/event.test.js index b0e69cad2c2..d683186aa00 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 4 - Create a payment with greater capture/Payments - Create/event.test.js +++ b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 4 - Create a payment with greater capture/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 4 - Create a payment with greater capture/Payments - Create/request.json b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 4 - Create a payment with greater capture/Payments - Create/request.json index 1ae31f3c248..ca59d554503 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 4 - Create a payment with greater capture/Payments - Create/request.json +++ b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 4 - Create a payment with greater capture/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 4 - Create a payment with greater capture/Payments - Retrieve/.event.meta.json b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 4 - Create a payment with greater capture/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 4 - Create a payment with greater capture/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 4 - Create a payment with greater capture/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 4 - Create a payment with greater capture/Payments - Retrieve/event.test.js b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 4 - Create a payment with greater capture/Payments - Retrieve/event.test.js index 172f901a40b..473d1477798 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 4 - Create a payment with greater capture/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 4 - Create a payment with greater capture/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 4 - Create a payment with greater capture/Payments - Retrieve/request.json b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 4 - Create a payment with greater capture/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 4 - Create a payment with greater capture/Payments - Retrieve/request.json +++ b/postman/collection-dir/braintree/Flow Testcases/Variation Cases/Scenario 4 - Create a payment with greater capture/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/braintree/Health check/.meta.json b/postman/collection-dir/braintree/Health check/.meta.json index 66ee7e50cab..579f9fd541c 100644 --- a/postman/collection-dir/braintree/Health check/.meta.json +++ b/postman/collection-dir/braintree/Health check/.meta.json @@ -1,5 +1,3 @@ { - "childrenOrder": [ - "New Request" - ] + "childrenOrder": ["New Request"] } diff --git a/postman/collection-dir/braintree/Health check/New Request/.event.meta.json b/postman/collection-dir/braintree/Health check/New Request/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/braintree/Health check/New Request/.event.meta.json +++ b/postman/collection-dir/braintree/Health check/New Request/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/braintree/Health check/New Request/event.test.js b/postman/collection-dir/braintree/Health check/New Request/event.test.js index 325a8c8a479..b490b8be090 100644 --- a/postman/collection-dir/braintree/Health check/New Request/event.test.js +++ b/postman/collection-dir/braintree/Health check/New Request/event.test.js @@ -1,4 +1,4 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - Status code is 2xx", function () { - pm.response.to.be.success; -}); \ No newline at end of file + pm.response.to.be.success; +}); diff --git a/postman/collection-dir/braintree/Health check/New Request/request.json b/postman/collection-dir/braintree/Health check/New Request/request.json index 4cc8d4b1a96..e40e9396178 100644 --- a/postman/collection-dir/braintree/Health check/New Request/request.json +++ b/postman/collection-dir/braintree/Health check/New Request/request.json @@ -10,11 +10,7 @@ ], "url": { "raw": "{{baseUrl}}/health", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "health" - ] + "host": ["{{baseUrl}}"], + "path": ["health"] } } diff --git a/postman/collection-dir/braintree/event.test.js b/postman/collection-dir/braintree/event.test.js index 69037688f22..fb52caec30f 100644 --- a/postman/collection-dir/braintree/event.test.js +++ b/postman/collection-dir/braintree/event.test.js @@ -1,11 +1,13 @@ // 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("[LOG]::payment_id - " + jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log("[LOG]::payment_id - " + jsonData.payment_id); } -console.log("[LOG]::x-request-id - " + pm.response.headers.get('x-request-id')); \ No newline at end of file +console.log("[LOG]::x-request-id - " + pm.response.headers.get("x-request-id")); diff --git a/postman/collection-dir/checkout/.event.json b/postman/collection-dir/checkout/.event.json index f2f883112b2..e6e48ad0feb 100644 --- a/postman/collection-dir/checkout/.event.json +++ b/postman/collection-dir/checkout/.event.json @@ -4,9 +4,7 @@ "listen": "prerequest", "script": { "type": "text/javascript", - "exec": [ - "" - ] + "exec": [""] } }, { diff --git a/postman/collection-dir/checkout/.event.meta.json b/postman/collection-dir/checkout/.event.meta.json new file mode 100644 index 00000000000..eb871bbcb9b --- /dev/null +++ b/postman/collection-dir/checkout/.event.meta.json @@ -0,0 +1,3 @@ +{ + "eventOrder": ["event.prerequest.js", "event.test.js"] +} diff --git a/postman/collection-dir/checkout/.meta.json b/postman/collection-dir/checkout/.meta.json index 91b6a65c5bc..d513035ce2d 100644 --- a/postman/collection-dir/checkout/.meta.json +++ b/postman/collection-dir/checkout/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Health check", - "Flow Testcases" - ] + "childrenOrder": ["Health check", "Flow Testcases"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/.meta.json b/postman/collection-dir/checkout/Flow Testcases/.meta.json index 1bbce843680..023989e1e49 100644 --- a/postman/collection-dir/checkout/Flow Testcases/.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/.meta.json @@ -1,7 +1,3 @@ { - "childrenOrder": [ - "QuickStart", - "Happy Cases", - "Variation Cases" - ] + "childrenOrder": ["QuickStart", "Happy Cases", "Variation Cases"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js index f78f0945681..cb7a76331cd 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js @@ -1,56 +1,78 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("checkout"); + pm.expect(jsonData.connector).to.eql("checkout"); }); // //Validate the amount @@ -60,16 +82,21 @@ pm.test("[POST]::/payments - connector", function () { // }); // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "6540" for "amount_received" -if (jsonData?.amount_received){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'amount - 6540'", function() { - pm.expect(jsonData.amount_received).to.eql(6540); - } ) -} - +if (jsonData?.amount_received) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'amount - 6540'", + function () { + pm.expect(jsonData.amount_received).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json index 47f08f9f372..144a35f773a 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json @@ -76,12 +76,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js index 2f50b68512c..28c01bde38a 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js @@ -1,65 +1,91 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "6540" for "amount_received" -if (jsonData?.amount_received){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'amount - 6540'", function() { - pm.expect(jsonData.amount_received).to.eql(6540); - } ) -} +if (jsonData?.amount_received) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'amount - 6540'", + function () { + pm.expect(jsonData.amount_received).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/3DS Payment/.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/3DS Payment/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/3DS Payment/.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/3DS Payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/3DS Payment/Payments - Create/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/3DS Payment/Payments - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/3DS Payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/3DS Payment/Payments - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/3DS Payment/Payments - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/3DS Payment/Payments - Create/event.test.js index 01cc1bf1b80..cc832cbf309 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/3DS Payment/Payments - Create/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/3DS Payment/Payments - Create/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "connector error" for "error type" if (jsonData?.status) { -pm.test("[POST]::/payments/:id/cancel - Content check if value for 'jsonData.status' matches 'requires_customer_action'", function() { - pm.expect(jsonData.status).to.eql("requires_customer_action"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/cancel - Content check if value for 'jsonData.status' matches 'requires_customer_action'", + function () { + pm.expect(jsonData.status).to.eql("requires_customer_action"); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/3DS Payment/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/3DS Payment/Payments - Create/request.json index 197580ddffa..f5f3112ab99 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/3DS Payment/Payments - Create/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/3DS Payment/Payments - Create/request.json @@ -80,12 +80,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/3DS Payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/3DS Payment/Payments - Retrieve/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/3DS Payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/3DS Payment/Payments - Retrieve/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/3DS Payment/Payments - Retrieve/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/3DS Payment/Payments - Retrieve/event.test.js index 4dd072b2222..d0a02af7436 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/3DS Payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/3DS Payment/Payments - Retrieve/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // 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.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/3DS Payment/Payments - Retrieve/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/3DS Payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/3DS Payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/3DS Payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Cancel/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Cancel/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Cancel/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Cancel/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Cancel/event.test.js index 2d80c5903d2..2c8e84e3008 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Cancel/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Cancel/event.test.js @@ -1,40 +1,61 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/cancel - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/cancel - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/cancel - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "connector error" for "error type" if (jsonData?.status) { -pm.test("[POST]::/payments/:id/cancel - Content check if value for 'jsonData.status' matches 'cancelled'", function() { - pm.expect(jsonData.status).to.eql("cancelled"); -})}; + pm.test( + "[POST]::/payments/:id/cancel - Content check if value for 'jsonData.status' matches 'cancelled'", + function () { + pm.expect(jsonData.status).to.eql("cancelled"); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Cancel/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Cancel/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Capture/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Capture/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Capture/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Capture/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Capture/event.test.js index ef2bddc93d2..e6f49ae7357 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Capture/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Capture/event.test.js @@ -1,48 +1,69 @@ // 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/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "connector error" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; - - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Capture/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Capture/request.json index 127549802b0..e67be321142 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Capture/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Create/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Create/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Create/event.test.js index 62142d52dca..a6947db94c0 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Create/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Create/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Create/request.json index b28dec99902..2c085d1319b 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Create/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Create/request.json @@ -80,12 +80,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Retrieve/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Retrieve/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Retrieve/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Retrieve/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Retrieve/event.test.js index 4dd072b2222..d0a02af7436 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Retrieve/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // 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.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Retrieve/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Retrieve/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Payments - Capture/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Payments - Capture/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Payments - Capture/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Payments - Capture/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Payments - Capture/event.test.js index ef2bddc93d2..e6f49ae7357 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Payments - Capture/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Payments - Capture/event.test.js @@ -1,48 +1,69 @@ // 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/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "connector error" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; - - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Payments - Capture/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Payments - Capture/request.json index 127549802b0..e67be321142 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Payments - Capture/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Payments - Create/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Payments - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Payments - Create/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Payments - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Payments - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Payments - Create/event.test.js index 62142d52dca..a6947db94c0 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Payments - Create/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Payments - Create/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Payments - Create/request.json index b28dec99902..2c085d1319b 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Payments - Create/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Payments - Create/request.json @@ -80,12 +80,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Refunds - Create/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Refunds - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Refunds - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Refunds - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Refunds - Create/event.test.js index fa6c4ec364b..533313e8b9b 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Refunds - Create/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Refunds - Create/event.test.js @@ -1,20 +1,27 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/refunds - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); + 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) {} // Response body should have value "connector error" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Refunds - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Refunds - Create/request.json index ff371b247db..491b7d68feb 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Refunds - Create/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Capture/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Capture/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Capture/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Capture/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Capture/event.test.js index ef2bddc93d2..e6f49ae7357 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Capture/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Capture/event.test.js @@ -1,48 +1,69 @@ // 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/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "connector error" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; - - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Capture/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Capture/request.json index 127549802b0..e67be321142 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Capture/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Create/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Create/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Create/event.test.js index 62142d52dca..a6947db94c0 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Create/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Create/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Create/request.json index b28dec99902..2c085d1319b 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Create/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Create/request.json @@ -80,12 +80,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Retrieve-copy/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Retrieve-copy/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Retrieve-copy/event.test.js index e8f76cbfba1..5e5839fa293 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Retrieve-copy/event.test.js @@ -1,27 +1,35 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // Set response object as internal variable let jsonData = {}; -try { jsonData = pm.response.json(); } catch (e) { } +try { + jsonData = pm.response.json(); +} catch (e) {} -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // 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.", + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Retrieve-copy/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Retrieve-copy/request.json index d10988d49b1..38ea8b2b84e 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true&expand_captures=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Retrieve/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Retrieve/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Retrieve/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Retrieve/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Retrieve/event.test.js index 4dd072b2222..d0a02af7436 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Retrieve/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // 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.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Retrieve/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Retrieve/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Capture - 1/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Capture - 1/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Capture - 1/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Capture - 1/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Capture - 1/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Capture - 1/event.test.js index ef2bddc93d2..e6f49ae7357 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Capture - 1/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Capture - 1/event.test.js @@ -1,48 +1,69 @@ // 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/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "connector error" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; - - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Capture - 1/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Capture - 1/request.json index 127549802b0..e67be321142 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Capture - 1/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Capture - 1/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Capture - 2/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Capture - 2/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Capture - 2/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Capture - 2/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Capture - 2/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Capture - 2/event.test.js index ef2bddc93d2..e6f49ae7357 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Capture - 2/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Capture - 2/event.test.js @@ -1,48 +1,69 @@ // 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/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "connector error" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; - - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Capture - 2/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Capture - 2/request.json index 127549802b0..e67be321142 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Capture - 2/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Capture - 2/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Capture - 3/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Capture - 3/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Capture - 3/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Capture - 3/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Capture - 3/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Capture - 3/event.test.js index ef2bddc93d2..e6f49ae7357 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Capture - 3/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Capture - 3/event.test.js @@ -1,48 +1,69 @@ // 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/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "connector error" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; - - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Capture - 3/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Capture - 3/request.json index 127549802b0..e67be321142 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Capture - 3/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Capture - 3/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Create/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Create/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Create/event.test.js index 62142d52dca..a6947db94c0 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Create/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Create/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Create/request.json index b28dec99902..2c085d1319b 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Create/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Create/request.json @@ -80,12 +80,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Retrieve/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Retrieve/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Retrieve/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Retrieve/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Retrieve/event.test.js index 4dd072b2222..d0a02af7436 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Retrieve/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // 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.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Retrieve/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Retrieve/request.json index d10988d49b1..38ea8b2b84e 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Retrieve/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true&expand_captures=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Refunds - Create/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Refunds - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Refunds - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Refunds - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Refunds - Create/event.test.js index cedf277ff76..35aec4acab0 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Refunds - Create/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Refunds - Create/event.test.js @@ -1,38 +1,55 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/refunds - 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("checkout"); + pm.expect(jsonData.connector).to.eql("checkout"); }); // Response body should have value "6000" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6000'", function() { - pm.expect(jsonData.amount).to.eql(6000); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6000'", + function () { + pm.expect(jsonData.amount).to.eql(6000); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Refunds - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Refunds - Create/request.json index 9e0bc932afb..96cd9f45b0f 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Refunds - Create/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Refunds - Retrieve/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Refunds - Retrieve/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Refunds - Retrieve/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Refunds - Retrieve/event.test.js index c3a4fada611..9ae4ae1aaca 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Refunds - Retrieve/event.test.js @@ -1,38 +1,55 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/refunds - 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("checkout"); + pm.expect(jsonData.connector).to.eql("checkout"); }); // Response body should have value "6000" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6000'", function() { - pm.expect(jsonData.amount).to.eql(6000); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6000'", + function () { + pm.expect(jsonData.amount).to.eql(6000); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Refunds - Retrieve/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Refunds - Retrieve/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js index acefa34d8bd..8a41b0ef7e5 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js @@ -1,79 +1,109 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id/confirm - 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("checkout"); + pm.expect(jsonData.connector).to.eql("checkout"); }); - // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "null" for "amount_received" -if (jsonData?.amount_received){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", function() { - pm.expect(jsonData.amount_received).to.eql(6540); - } ) -} +if (jsonData?.amount_received) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", + function () { + pm.expect(jsonData.amount_received).to.eql(6540); + }, + ); +} // 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 'amount - 0'", function() { - pm.expect(jsonData.amount_capturable).to.eql(0); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 0'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(0); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json index 81f4c05a3c3..98eb4829e4b 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js index f24648126a2..0981c872f67 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js @@ -1,71 +1,101 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; - + 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 value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "null" for "amount_received" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", function() { - pm.expect(jsonData.amount_received).to.eql(null); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", + function () { + pm.expect(jsonData.amount_received).to.eql(null); + }, + ); +} // Response body should have value "6540" for "amount_capturable" -if (jsonData?.amount_capturable){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", function() { - pm.expect(jsonData.amount_capturable).to.eql(6540); - } ) -} +if (jsonData?.amount_capturable) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json index b560256741c..a6a8150c240 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json @@ -76,12 +76,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js index 00e201e77c6..7ff756df442 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js @@ -1,75 +1,106 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("checkout"); + pm.expect(jsonData.connector).to.eql("checkout"); }); // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "null" for "amount_received" -if (jsonData?.amount_received){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", function() { - pm.expect(jsonData.amount_received).to.eql(6540); - } ) -} +if (jsonData?.amount_received) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", + function () { + pm.expect(jsonData.amount_received).to.eql(6540); + }, + ); +} // 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 'amount - 0'", function() { - pm.expect(jsonData.amount_capturable).to.eql(0); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 0'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(0); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js index 08a408e339d..2fd89553c9c 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js @@ -1,79 +1,109 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id/confirm - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments:id/confirm - 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("checkout"); + pm.expect(jsonData.connector).to.eql("checkout"); }); - // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "null" for "amount_received" -if (jsonData?.amount_received){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", function() { - pm.expect(jsonData.amount_received).to.eql(6540); - } ) -} +if (jsonData?.amount_received) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", + function () { + pm.expect(jsonData.amount_received).to.eql(6540); + }, + ); +} // 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 'amount - 0'", function() { - pm.expect(jsonData.amount_capturable).to.eql(0); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 0'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(0); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json index 1ee725eb03a..dd704a5de76 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "card", "payment_method_data": { "card": { @@ -32,14 +53,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js index c9e203b9254..04de14459b5 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js @@ -1,71 +1,101 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "null" for "amount_received" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", function() { - pm.expect(jsonData.amount_received).to.eql(null); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", + function () { + pm.expect(jsonData.amount_received).to.eql(null); + }, + ); +} // Response body should have value "6540" for "amount_capturable" -if (jsonData?.amount_capturable){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", function() { - pm.expect(jsonData.amount_capturable).to.eql(6540); - } ) -} - +if (jsonData?.amount_capturable) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json index b28abd0c309..e3b1e235042 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json @@ -67,12 +67,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js index d0c2daefbe3..7ff756df442 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js @@ -1,77 +1,106 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("checkout"); + pm.expect(jsonData.connector).to.eql("checkout"); }); - // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "null" for "amount_received" -if (jsonData?.amount_received){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", function() { - pm.expect(jsonData.amount_received).to.eql(6540); - } ) -} +if (jsonData?.amount_received) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", + function () { + pm.expect(jsonData.amount_received).to.eql(6540); + }, + ); +} // 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 'amount - 0'", function() { - pm.expect(jsonData.amount_capturable).to.eql(0); - } ) -} - +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 0'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(0); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Capture/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Capture/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Capture/event.test.js index 15decca3553..fc1ed092f8b 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Capture/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Capture/event.test.js @@ -1,79 +1,109 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/capture - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); - -// Validate if response has JSON Body +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.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} - +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]:://payments/:id/capture - 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"); + }, + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("checkout"); + pm.expect(jsonData.connector).to.eql("checkout"); }); // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "6000" for "amount_received" if (jsonData?.amount_received) { -pm.test("[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", function() { - pm.expect(jsonData.amount_received).to.eql(6000); -})}; + pm.test( + "[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", + function () { + pm.expect(jsonData.amount_received).to.eql(6000); + }, + ); +} // Response body should have value "6540" for "amount_capturable" -if (jsonData?.amount_capturable){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", function() { - pm.expect(jsonData.amount_capturable).to.eql(540); - } ) -} - - - +if (jsonData?.amount_capturable) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(540); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Capture/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Capture/request.json index 8975575ca40..9fe257ed85e 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Capture/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Confirm/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Confirm/event.test.js index 92a9ad6cc84..8ecccaf3c6c 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Confirm/event.test.js @@ -1,81 +1,109 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.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.", + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("checkout"); + pm.expect(jsonData.connector).to.eql("checkout"); }); // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "null" for "amount_received" -if (jsonData?.amount_received){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", function() { - pm.expect(jsonData.amount_received).to.eql(null); - } ) -} +if (jsonData?.amount_received) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", + function () { + pm.expect(jsonData.amount_received).to.eql(null); + }, + ); +} // 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 'amount - 0'", function() { - pm.expect(jsonData.amount_capturable).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 0'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Confirm/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Confirm/request.json index b7a4aa5998f..1c3a9e08ac3 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Confirm/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Create/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Create/event.test.js index a00b7a7ada8..46d22efaaae 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Create/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Create/event.test.js @@ -1,72 +1,101 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_confirmation" 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_confirmation"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "null" for "amount_received" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", function() { - pm.expect(jsonData.amount_received).to.eql(null); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", + function () { + pm.expect(jsonData.amount_received).to.eql(null); + }, + ); +} // Response body should have value "6540" for "amount_capturable" -if (jsonData?.amount_capturable){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", function() { - pm.expect(jsonData.amount_capturable).to.eql(6540); - } ) -} - - +if (jsonData?.amount_capturable) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Create/request.json index de5aa29f7b0..50cb0663b40 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Create/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Create/request.json @@ -76,12 +76,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Retrieve/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Retrieve/event.test.js index 5250d7a9f6d..cea10167ebc 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Retrieve/event.test.js @@ -1,75 +1,106 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("checkout"); + pm.expect(jsonData.connector).to.eql("checkout"); }); // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "6000" for "amount_received" if (jsonData?.amount_received) { -pm.test("[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", function() { - pm.expect(jsonData.amount_received).to.eql(6000); -})}; + pm.test( + "[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", + function () { + pm.expect(jsonData.amount_received).to.eql(6000); + }, + ); +} // Response body should have value "6540" for "amount_capturable" -if (jsonData?.amount_capturable){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", function() { - pm.expect(jsonData.amount_capturable).to.eql(540); - } ) -} \ No newline at end of file +if (jsonData?.amount_capturable) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(540); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Retrieve/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Capture/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Capture/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Capture/event.test.js index ea873a6ea22..8e975a4ddd9 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Capture/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Capture/event.test.js @@ -1,77 +1,109 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/capture - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} - +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]:://payments/:id/capture - 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"); + }, + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("checkout"); + pm.expect(jsonData.connector).to.eql("checkout"); }); // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "6000" for "amount_received" if (jsonData?.amount_received) { -pm.test("[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", function() { - pm.expect(jsonData.amount_received).to.eql(6540); -})}; + pm.test( + "[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", + function () { + pm.expect(jsonData.amount_received).to.eql(6540); + }, + ); +} // Response body should have value "6540" for "amount_capturable" -if (jsonData?.amount_capturable){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", function() { - pm.expect(jsonData.amount_capturable).to.eql(0); - } ) -} - +if (jsonData?.amount_capturable) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(0); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Capture/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Capture/request.json index 8efb99d3c90..cceb2b55f0a 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Capture/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Create/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Create/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Create/event.test.js index 9ac6844ba89..aabeabac3dd 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Create/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Create/event.test.js @@ -1,78 +1,106 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("checkout"); + pm.expect(jsonData.connector).to.eql("checkout"); }); // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "null" for "amount_received" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", function() { - pm.expect(jsonData.amount_received).to.eql(null); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", + function () { + pm.expect(jsonData.amount_received).to.eql(null); + }, + ); +} // Response body should have value "6540" for "amount_capturable" -if (jsonData?.amount_capturable){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", function() { - pm.expect(jsonData.amount_capturable).to.eql(6540); - } ) -} - - +if (jsonData?.amount_capturable) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Create/request.json index c4f2248a4f4..5b606850fd2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Create/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Create/request.json @@ -76,12 +76,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Retrieve/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Retrieve/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Retrieve/event.test.js index dc269c755f0..0a960e2d3f1 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Retrieve/event.test.js @@ -1,75 +1,106 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("checkout"); + pm.expect(jsonData.connector).to.eql("checkout"); }); // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "6000" for "amount_received" if (jsonData?.amount_received) { -pm.test("[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", function() { - pm.expect(jsonData.amount_received).to.eql(6540); -})}; + pm.test( + "[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", + function () { + pm.expect(jsonData.amount_received).to.eql(6540); + }, + ); +} // Response body should have value "6540" for "amount_capturable" -if (jsonData?.amount_capturable){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", function() { - pm.expect(jsonData.amount_capturable).to.eql(0); - } ) -} \ No newline at end of file +if (jsonData?.amount_capturable) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(0); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Retrieve/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Retrieve/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Capture/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Capture/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Capture/event.test.js index 601c6ce78f5..fc1ed092f8b 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Capture/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Capture/event.test.js @@ -1,77 +1,109 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/capture - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} - +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]:://payments/:id/capture - 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"); + }, + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("checkout"); + pm.expect(jsonData.connector).to.eql("checkout"); }); // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "6000" for "amount_received" if (jsonData?.amount_received) { -pm.test("[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", function() { - pm.expect(jsonData.amount_received).to.eql(6000); -})}; + pm.test( + "[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", + function () { + pm.expect(jsonData.amount_received).to.eql(6000); + }, + ); +} // Response body should have value "6540" for "amount_capturable" -if (jsonData?.amount_capturable){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", function() { - pm.expect(jsonData.amount_capturable).to.eql(540); - } ) -} - +if (jsonData?.amount_capturable) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(540); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Capture/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Capture/request.json index 8975575ca40..9fe257ed85e 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Capture/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Create/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Create/event.test.js index 9ac6844ba89..aabeabac3dd 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Create/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Create/event.test.js @@ -1,78 +1,106 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("checkout"); + pm.expect(jsonData.connector).to.eql("checkout"); }); // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "null" for "amount_received" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", function() { - pm.expect(jsonData.amount_received).to.eql(null); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", + function () { + pm.expect(jsonData.amount_received).to.eql(null); + }, + ); +} // Response body should have value "6540" for "amount_capturable" -if (jsonData?.amount_capturable){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", function() { - pm.expect(jsonData.amount_capturable).to.eql(6540); - } ) -} - - +if (jsonData?.amount_capturable) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Create/request.json index c4f2248a4f4..5b606850fd2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Create/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Create/request.json @@ -76,12 +76,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Retrieve/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Retrieve/event.test.js index 5250d7a9f6d..cea10167ebc 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Retrieve/event.test.js @@ -1,75 +1,106 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("checkout"); + pm.expect(jsonData.connector).to.eql("checkout"); }); // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "6000" for "amount_received" if (jsonData?.amount_received) { -pm.test("[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", function() { - pm.expect(jsonData.amount_received).to.eql(6000); -})}; + pm.test( + "[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", + function () { + pm.expect(jsonData.amount_received).to.eql(6000); + }, + ); +} // Response body should have value "6540" for "amount_capturable" -if (jsonData?.amount_capturable){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", function() { - pm.expect(jsonData.amount_capturable).to.eql(540); - } ) -} \ No newline at end of file +if (jsonData?.amount_capturable) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(540); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Retrieve/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Cancel/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Cancel/event.test.js index 9632bd19048..dcf3f191643 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Cancel/event.test.js @@ -1,43 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/cancel - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type 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(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "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"); -})}; - - - + pm.test( + "[POST]::/payments/:id/cancel - Content check if value for 'status' matches 'cancelled'", + function () { + pm.expect(jsonData.status).to.eql("cancelled"); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Cancel/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Cancel/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Create/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Create/event.test.js index 3e0f3b2cde0..aabeabac3dd 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Create/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Create/event.test.js @@ -1,75 +1,106 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("checkout"); + pm.expect(jsonData.connector).to.eql("checkout"); }); // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "null" for "amount_received" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", function() { - pm.expect(jsonData.amount_received).to.eql(null); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", + function () { + pm.expect(jsonData.amount_received).to.eql(null); + }, + ); +} // Response body should have value "6540" for "amount_capturable" -if (jsonData?.amount_capturable){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", function() { - pm.expect(jsonData.amount_capturable).to.eql(6540); - } ) -} +if (jsonData?.amount_capturable) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Create/request.json index c4f2248a4f4..5b606850fd2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Create/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Create/request.json @@ -76,12 +76,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Retrieve/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Retrieve/event.test.js index f4e0ab9b2aa..5e52e13a59e 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "cancelled" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'", function() { - pm.expect(jsonData.status).to.eql("cancelled"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'", + function () { + pm.expect(jsonData.status).to.eql("cancelled"); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Retrieve/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Payments - Create/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Payments - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Payments - Create/event.test.js index 8d78b21aedc..2f020d7ff20 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Payments - Create/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Payments - Create/event.test.js @@ -1,75 +1,106 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("checkout"); + pm.expect(jsonData.connector).to.eql("checkout"); }); // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "null" for "amount_received" -if (jsonData?.amount_received){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", function() { - pm.expect(jsonData.amount_received).to.eql(6540); - } ) -} +if (jsonData?.amount_received) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", + function () { + pm.expect(jsonData.amount_received).to.eql(6540); + }, + ); +} // 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 'amount - 6540'", function() { - pm.expect(jsonData.amount_capturable).to.eql(0); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(0); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Payments - Create/request.json index 47f08f9f372..144a35f773a 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Payments - Create/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Payments - Create/request.json @@ -76,12 +76,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Payments - Retrieve/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Payments - Retrieve/event.test.js index c48c48fa4d3..8ae9f99c986 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Payments - Retrieve/event.test.js @@ -1,76 +1,106 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("checkout"); + pm.expect(jsonData.connector).to.eql("checkout"); }); // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "6000" for "amount_received" if (jsonData?.amount_received) { -pm.test("[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", function() { - pm.expect(jsonData.amount_received).to.eql(6540); -})}; + pm.test( + "[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", + function () { + pm.expect(jsonData.amount_received).to.eql(6540); + }, + ); +} // Response body should have value "6540" for "amount_capturable" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", function() { - pm.expect(jsonData.amount_capturable).to.eql(0); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(0); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Payments - Retrieve/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Refunds - Create/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Refunds - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Refunds - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Refunds - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Refunds - Create/event.test.js index 73ade1d2c0b..d5aacc3f766 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Refunds - Create/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Refunds - Create/event.test.js @@ -1,38 +1,55 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/refunds - 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("checkout"); + pm.expect(jsonData.connector).to.eql("checkout"); }); // Response body should have value "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Refunds - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Refunds - Create/request.json index 5e306df7a55..5f4c58816d5 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Refunds - Create/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Refunds - Retrieve/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Refunds - Retrieve/event.test.js index ec6e8e09dff..b1869747fc1 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Refunds - Retrieve/event.test.js @@ -1,38 +1,55 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/refunds - 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("checkout"); + pm.expect(jsonData.connector).to.eql("checkout"); }); // Response body should have value "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Refunds - Retrieve/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Refunds - Retrieve/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Create/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Create/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Create/event.test.js index ace10277d3c..2f020d7ff20 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Create/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Create/event.test.js @@ -1,77 +1,106 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("checkout"); + pm.expect(jsonData.connector).to.eql("checkout"); }); // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "null" for "amount_received" -if (jsonData?.amount_received){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", function() { - pm.expect(jsonData.amount_received).to.eql(6540); - } ) -} +if (jsonData?.amount_received) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", + function () { + pm.expect(jsonData.amount_received).to.eql(6540); + }, + ); +} // 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 'amount - 6540'", function() { - pm.expect(jsonData.amount_capturable).to.eql(0); - } ) -} - - +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(0); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Create/request.json index 47f08f9f372..144a35f773a 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Create/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Create/request.json @@ -76,12 +76,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Retrieve-copy/event.test.js index 01c5b744eac..4974bba662f 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Retrieve-copy/event.test.js @@ -1,58 +1,76 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "refunds" -pm.test("[POST]::/payments - Content check if 'refunds' exists", function() { - pm.expect((typeof jsonData.refunds !== "undefined")).to.be.true; +pm.test("[POST]::/payments - Content check if 'refunds' exists", function () { + pm.expect(typeof jsonData.refunds !== "undefined").to.be.true; }); - - - diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Retrieve-copy/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Retrieve/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Retrieve/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Retrieve/event.test.js index c48c48fa4d3..8ae9f99c986 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Retrieve/event.test.js @@ -1,76 +1,106 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("checkout"); + pm.expect(jsonData.connector).to.eql("checkout"); }); // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "6000" for "amount_received" if (jsonData?.amount_received) { -pm.test("[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", function() { - pm.expect(jsonData.amount_received).to.eql(6540); -})}; + pm.test( + "[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", + function () { + pm.expect(jsonData.amount_received).to.eql(6540); + }, + ); +} // Response body should have value "6540" for "amount_capturable" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", function() { - pm.expect(jsonData.amount_capturable).to.eql(0); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(0); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Retrieve/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Retrieve/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Create-copy/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Create-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Create-copy/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Create-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Create-copy/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Create-copy/event.test.js index d28f25fa46d..56ea9efbac0 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Create-copy/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Create-copy/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "1000" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '1000'", function() { - pm.expect(jsonData.amount).to.eql(1000); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '1000'", + function () { + pm.expect(jsonData.amount).to.eql(1000); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Create-copy/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Create-copy/request.json index b56057fad5d..caed7818578 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Create-copy/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Create-copy/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Create/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Create/event.test.js index b42095b6352..c549d5d0c09 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Create/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Create/event.test.js @@ -1,39 +1,55 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '540'", function() { - pm.expect(jsonData.amount).to.eql(540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '540'", + function () { + pm.expect(jsonData.amount).to.eql(540); + }, + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("checkout"); + pm.expect(jsonData.connector).to.eql("checkout"); }); - diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Create/request.json index d18aaf8befd..9fe125ce8ea 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Create/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Retrieve-copy/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Retrieve-copy/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Retrieve-copy/event.test.js index bfe3137afb0..f0351c05701 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Retrieve-copy/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Retrieve-copy/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '1000'", function() { - pm.expect(jsonData.amount).to.eql(1000); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '1000'", + function () { + pm.expect(jsonData.amount).to.eql(1000); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Retrieve-copy/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Retrieve-copy/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Retrieve-copy/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Retrieve/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Retrieve/event.test.js index 7bff0a3c12c..920a7c47f36 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Retrieve/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '540'", function() { - pm.expect(jsonData.amount).to.eql(540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '540'", + function () { + pm.expect(jsonData.amount).to.eql(540); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Retrieve/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Retrieve/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/checkout/Flow Testcases/QuickStart/API Key - Create/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/QuickStart/API Key - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/QuickStart/API Key - Create/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/QuickStart/API Key - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/QuickStart/API Key - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/QuickStart/API Key - Create/event.test.js index bc42e83a761..4e27c5a5025 100644 --- a/postman/collection-dir/checkout/Flow Testcases/QuickStart/API Key - Create/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/QuickStart/API Key - Create/event.test.js @@ -1,32 +1,46 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/api_keys/:merchant_id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/api_keys/:merchant_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/api_keys/:merchant_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; try { jsonData = pm.response.json(); -} catch(e) { -} +} catch (e) {} // pm.collectionVariables - Set api_key_id as variable for jsonData.key_id if (jsonData?.key_id) { - pm.collectionVariables.set("api_key_id", jsonData.key_id); - console.log("- use {{api_key_id}} as collection variable for value", jsonData.key_id); + pm.collectionVariables.set("api_key_id", jsonData.key_id); + console.log( + "- use {{api_key_id}} as collection variable for value", + jsonData.key_id, + ); } else { - console.log('INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value", jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/QuickStart/API Key - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/QuickStart/API Key - Create/request.json index 29c2490d1bc..2210d14da0e 100644 --- a/postman/collection-dir/checkout/Flow Testcases/QuickStart/API Key - Create/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/QuickStart/API Key - Create/request.json @@ -35,13 +35,8 @@ }, "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js index 538b393c084..7de0d5beb31 100644 --- a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js @@ -1,37 +1,56 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - 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]::/accounts - 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", + ); }); // 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 merchant_id as variable for jsonData.merchant_id if (jsonData?.merchant_id) { - pm.collectionVariables.set("merchant_id", jsonData.merchant_id); - console.log("- use {{merchant_id}} as collection variable for value",jsonData.merchant_id); + pm.collectionVariables.set("merchant_id", jsonData.merchant_id); + console.log( + "- use {{merchant_id}} as collection variable for value", + jsonData.merchant_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value",jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} // pm.collectionVariables - Set publishable_key as variable for jsonData.publishable_key if (jsonData?.publishable_key) { - pm.collectionVariables.set("publishable_key", jsonData.publishable_key); - console.log("- use {{publishable_key}} as collection variable for value",jsonData.publishable_key); + pm.collectionVariables.set("publishable_key", jsonData.publishable_key); + console.log( + "- use {{publishable_key}} as collection variable for value", + jsonData.publishable_key, + ); } else { - console.log('INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.", + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Merchant Account - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Merchant Account - Create/request.json index ffeea3410a4..dcbf46ee538 100644 --- a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Merchant Account - Create/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Merchant Account - Create/request.json @@ -84,12 +84,8 @@ }, "url": { "raw": "{{baseUrl}}/accounts", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "accounts" - ] + "host": ["{{baseUrl}}"], + "path": ["accounts"] }, "description": "Create a new account for a merchant. The merchant could be a seller or retailer or client who likes to receive and send payments." } diff --git a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js index b831702461e..88e92d8d84a 100644 --- a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js @@ -1,21 +1,39 @@ -// Validate status 2xx -pm.test("[POST]::/account/:account_id/connectors - 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.be.success; + }, +); // Validate if response header has matching content-type -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"); -}); +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){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id if (jsonData?.merchant_connector_id) { - pm.collectionVariables.set("merchant_connector_id", jsonData.merchant_connector_id); - console.log("- use {{merchant_connector_id}} as collection variable for value",jsonData.merchant_connector_id); + pm.collectionVariables.set( + "merchant_connector_id", + jsonData.merchant_connector_id, + ); + console.log( + "- use {{merchant_connector_id}} as collection variable for value", + jsonData.merchant_connector_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.", + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payment Connector - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payment Connector - Create/request.json index 9500716c12c..0f14659a5e8 100644 --- a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payment Connector - Create/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payment Connector - Create/request.json @@ -56,10 +56,7 @@ "payment_method_types": [ { "payment_method_type": "credit", - "card_networks": [ - "Visa", - "Mastercard" - ], + "card_networks": ["Visa", "Mastercard"], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, @@ -67,10 +64,7 @@ }, { "payment_method_type": "debit", - "card_networks": [ - "Visa", - "Mastercard" - ], + "card_networks": ["Visa", "Mastercard"], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, @@ -100,14 +94,8 @@ }, "url": { "raw": "{{baseUrl}}/account/:account_id/connectors", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payments - Create/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payments - Create/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payments - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payments - Create/event.test.js index 62142d52dca..a6947db94c0 100644 --- a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payments - Create/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payments - Create/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payments - Create/request.json index 872fac0738c..07ffc4eedef 100644 --- a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payments - Create/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js index 4dd072b2222..d0a02af7436 100644 --- a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // 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.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payments - Retrieve/request.json b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payments - Retrieve/request.json index c71774083b2..ef0b213739d 100644 --- a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payments - Retrieve/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Refunds - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Refunds - Create/event.test.js index 73ade1d2c0b..d5aacc3f766 100644 --- a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Refunds - Create/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Refunds - Create/event.test.js @@ -1,38 +1,55 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/refunds - 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("checkout"); + pm.expect(jsonData.connector).to.eql("checkout"); }); // Response body should have value "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Refunds - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Refunds - Create/request.json index 5e306df7a55..5f4c58816d5 100644 --- a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Refunds - Create/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js index ec6e8e09dff..b1869747fc1 100644 --- a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js @@ -1,38 +1,55 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/refunds - 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("checkout"); + pm.expect(jsonData.connector).to.eql("checkout"); }); // Response body should have value "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Refunds - Retrieve/request.json b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Refunds - Retrieve/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js index af64cd39dbd..7d93117ebfe 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js @@ -1,60 +1,86 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 "invalid_request" 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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} // Response body should have value "Invalid Expiry Year" for "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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json index ad281c58256..9cbdbc8e22f 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js index e0b96c50232..b3c1c852b44 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js @@ -1,62 +1,86 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); - // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 "invalid_request" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments - Content check if value for 'error.type' matches 'connector'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} // Response body should have value "Invalid Expiry Month" for "message" if (jsonData?.error?.message) { -pm.test("[POST]::/payments - Content check if value for 'error.message' matches 'Invalid Expiry Month'", function() { - pm.expect(jsonData.error.message).to.eql("Invalid Expiry Month"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.message' matches 'Invalid Expiry Month'", + function () { + pm.expect(jsonData.error.message).to.eql("Invalid Expiry Month"); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json index 03e71d6c7ea..6e9db26a339 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js index c1867f278d6..5f4175a4467 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js @@ -1,50 +1,71 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "failed" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'failed'", function() { - pm.expect(jsonData.status).to.eql("failed"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'failed'", + function () { + pm.expect(jsonData.status).to.eql("failed"); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json index 2d0e17e60e8..418f77270d9 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json @@ -75,12 +75,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js index 9a858d21f0e..dd68e63d9a3 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js @@ -1,61 +1,86 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 "invalid_request" 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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} // Response body should have value "Invalid card_cvc length" for "message" if (jsonData?.error?.message) { -pm.test("[POST]::/payments - Content check if value for 'error.message' matches 'Invalid card_cvc length'", function() { - pm.expect(jsonData.error.message).to.eql("Invalid card_cvc length"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.message' matches 'Invalid card_cvc length'", + function () { + pm.expect(jsonData.error.message).to.eql("Invalid card_cvc length"); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json index bd5526d6f86..0b35b7a4e92 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json index 90b19864ee1..f2bee31ef66 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Confirm" - ] + "childrenOrder": ["Payments - Create", "Payments - Confirm"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js index 2c8f4b5ecad..e03c186a82e 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js @@ -1,64 +1,94 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); -}); - - +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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} // Response body should have value "A payment token or payment method data is required" for "message" if (jsonData?.error?.message) { -pm.test("[POST]::/payments - Content check if value for 'error.message' matches 'connector_error'", function() { - pm.expect(jsonData.error.message).to.eql("A payment token or payment method data is required"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.message' matches 'connector_error'", + function () { + pm.expect(jsonData.error.message).to.eql( + "A payment token or payment method data is required", + ); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json index 81f4c05a3c3..98eb4829e4b 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json index b28abd0c309..e3b1e235042 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json @@ -67,12 +67,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js index fa97098610f..2b35f439a6f 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js @@ -1,64 +1,94 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} // Response body should have value "amount_to_capture is greater than amount" for "message" if (jsonData?.error?.message) { -pm.test("[POST]::/payments - Content check if value for 'error.message' matches 'connector_error'", function() { - pm.expect(jsonData.error.message).to.eql("amount_to_capture is greater than amount"); -})}; - - + pm.test( + "[POST]::/payments - Content check if value for 'error.message' matches 'connector_error'", + function () { + pm.expect(jsonData.error.message).to.eql( + "amount_to_capture is greater than amount", + ); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json index 766a8330d6e..6c934a9132c 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js index 4d0c9f06c60..3014b0e840f 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js @@ -1,83 +1,116 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("checkout"); + pm.expect(jsonData.connector).to.eql("checkout"); }); // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "null" for "amount_received" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", function() { - pm.expect(jsonData.amount_received).to.eql(null); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", + function () { + pm.expect(jsonData.amount_received).to.eql(null); + }, + ); +} // Response body should have value "6540" for "amount_capturable" -if (jsonData?.amount_capturable){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", function() { - pm.expect(jsonData.amount_capturable).to.eql(6540); - } ) -} - +if (jsonData?.amount_capturable) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json index c4f2248a4f4..5b606850fd2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json @@ -76,12 +76,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js index 6b03e0b9ee6..34beacf976b 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" 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"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json index cafd3a6808e..6df7c0a1943 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Capture" - ] + "childrenOrder": ["Payments - Create", "Payments - Capture"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js index bef472192c6..46bf201d1ce 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js @@ -1,57 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - + 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"); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json index 766a8330d6e..6c934a9132c 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json index 47f08f9f372..144a35f773a 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json @@ -76,12 +76,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json index afba25ab6d6..5ff1a7cb4e8 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Cancel" - ] + "childrenOrder": ["Payments - Create", "Payments - Cancel"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js index d7879c70d87..0f869a6dfb8 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js @@ -1,50 +1,69 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/cancel - Status code is 4xx", function () { - pm.response.to.be.error; + 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/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/cancel - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; - - - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json index 06284e30aed..09987daa71e 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Payments - Create/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Payments - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Payments - Create/event.test.js index 0da7de67336..2f020d7ff20 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Payments - Create/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Payments - Create/event.test.js @@ -1,76 +1,106 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("checkout"); + pm.expect(jsonData.connector).to.eql("checkout"); }); // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "null" for "amount_received" -if (jsonData?.amount_received){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", function() { - pm.expect(jsonData.amount_received).to.eql(6540); - } ) -} +if (jsonData?.amount_received) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", + function () { + pm.expect(jsonData.amount_received).to.eql(6540); + }, + ); +} // 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 'amount - 6540'", function() { - pm.expect(jsonData.amount_capturable).to.eql(0); - } ) -} - +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(0); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Payments - Create/request.json index 47f08f9f372..144a35f773a 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Payments - Create/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Payments - Create/request.json @@ -76,12 +76,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Payments - Retrieve/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Payments - Retrieve/event.test.js index 98a62846c79..e42e72dfb7a 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Payments - Retrieve/event.test.js @@ -1,77 +1,106 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("checkout"); + pm.expect(jsonData.connector).to.eql("checkout"); }); // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "6000" for "amount_received" if (jsonData?.amount_received) { -pm.test("[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", function() { - pm.expect(jsonData.amount_received).to.eql(6540); -})}; + pm.test( + "[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", + function () { + pm.expect(jsonData.amount_received).to.eql(6540); + }, + ); +} // Response body should have value "6540" for "amount_capturable" -if (jsonData?.amount_capturable){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", function() { - pm.expect(jsonData.amount_capturable).to.eql(0); - } ) -} \ No newline at end of file +if (jsonData?.amount_capturable) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(0); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Payments - Retrieve/request.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Refunds - Create/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Refunds - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Refunds - Create/event.test.js index fa7d49cce14..00f93b844c5 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Refunds - Create/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Refunds - Create/event.test.js @@ -1,38 +1,60 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/refunds - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + 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; -}); +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"); -})}; + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} // Response body should have value "Refund amount exceeds the payment amount" for "message" if (jsonData?.error?.message) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'error.message' matches 'Refund amount exceeds the payment amount'", function() { - pm.expect(jsonData.error.message).to.eql("Refund amount exceeds the payment amount"); -})}; + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'error.message' matches 'Refund amount exceeds the payment amount'", + function () { + pm.expect(jsonData.error.message).to.eql( + "Refund amount exceeds the payment amount", + ); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Refunds - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Refunds - Create/request.json index 326319e8fdf..10de81bed08 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Refunds - Create/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Payments - Create/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Payments - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Payments - Create/event.test.js index 65232a76373..55dc35b9128 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Payments - Create/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Payments - Create/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; - - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Payments - Create/request.json index 758498447dd..45feadeb3c3 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Payments - Create/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Payments - Retrieve/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Payments - Retrieve/event.test.js index 42bf3e0ac45..fdb8a946f3d 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Payments - Retrieve/request.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Refunds - Create/.event.meta.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Refunds - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Refunds - Create/event.test.js index 30888b5cc0c..d3c4451760d 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Refunds - Create/event.test.js +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Refunds - Create/event.test.js @@ -1,32 +1,48 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/refunds - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + 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; -}); +pm.test( + "[POST]::/payments/:id/confirm - Content check if 'error' exists", + function () { + pm.expect(typeof jsonData.error !== "undefined").to.be.true; + }, +); // Response body should have value "invalid_request" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; + pm.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"); + }, + ); +} diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Refunds - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Refunds - Create/request.json index d18aaf8befd..9fe125ce8ea 100644 --- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Refunds - Create/request.json +++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/checkout/Health check/.meta.json b/postman/collection-dir/checkout/Health check/.meta.json index 66ee7e50cab..579f9fd541c 100644 --- a/postman/collection-dir/checkout/Health check/.meta.json +++ b/postman/collection-dir/checkout/Health check/.meta.json @@ -1,5 +1,3 @@ { - "childrenOrder": [ - "New Request" - ] + "childrenOrder": ["New Request"] } diff --git a/postman/collection-dir/checkout/Health check/New Request/.event.meta.json b/postman/collection-dir/checkout/Health check/New Request/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/checkout/Health check/New Request/.event.meta.json +++ b/postman/collection-dir/checkout/Health check/New Request/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/checkout/Health check/New Request/event.test.js b/postman/collection-dir/checkout/Health check/New Request/event.test.js index 325a8c8a479..b490b8be090 100644 --- a/postman/collection-dir/checkout/Health check/New Request/event.test.js +++ b/postman/collection-dir/checkout/Health check/New Request/event.test.js @@ -1,4 +1,4 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - Status code is 2xx", function () { - pm.response.to.be.success; -}); \ No newline at end of file + pm.response.to.be.success; +}); diff --git a/postman/collection-dir/checkout/Health check/New Request/request.json b/postman/collection-dir/checkout/Health check/New Request/request.json index 4cc8d4b1a96..e40e9396178 100644 --- a/postman/collection-dir/checkout/Health check/New Request/request.json +++ b/postman/collection-dir/checkout/Health check/New Request/request.json @@ -10,11 +10,7 @@ ], "url": { "raw": "{{baseUrl}}/health", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "health" - ] + "host": ["{{baseUrl}}"], + "path": ["health"] } } diff --git a/postman/collection-dir/forte/.event.meta.json b/postman/collection-dir/forte/.event.meta.json index 2df9d47d936..eb871bbcb9b 100644 --- a/postman/collection-dir/forte/.event.meta.json +++ b/postman/collection-dir/forte/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.prerequest.js", - "event.test.js" - ] + "eventOrder": ["event.prerequest.js", "event.test.js"] } diff --git a/postman/collection-dir/forte/.meta.json b/postman/collection-dir/forte/.meta.json index 91b6a65c5bc..d513035ce2d 100644 --- a/postman/collection-dir/forte/.meta.json +++ b/postman/collection-dir/forte/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Health check", - "Flow Testcases" - ] + "childrenOrder": ["Health check", "Flow Testcases"] } diff --git a/postman/collection-dir/forte/Flow Testcases/.meta.json b/postman/collection-dir/forte/Flow Testcases/.meta.json index 1bbce843680..023989e1e49 100644 --- a/postman/collection-dir/forte/Flow Testcases/.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/.meta.json @@ -1,7 +1,3 @@ { - "childrenOrder": [ - "QuickStart", - "Happy Cases", - "Variation Cases" - ] + "childrenOrder": ["QuickStart", "Happy Cases", "Variation Cases"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js index 7bd53fe946b..16c37817f0b 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json index 45dea50bba0..642f9d9caf5 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json @@ -79,12 +79,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js index 5f6bcb6027f..83ba283f472 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js index dec48e36875..37ee4bfbceb 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js index 5698484c741..55dc35b9128 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json index 9dcf43c6740..2c7ace2ed59 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json @@ -79,12 +79,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js index 2056e33b7b7..03b39a354a3 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js index 71869299026..df082881525 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id/confirm - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id/confirm - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json index bb2b0cdc1b0..402aa25fef8 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "card", "payment_method_data": { "card": { @@ -32,14 +53,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json index d18669862ee..0ff55c553af 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json @@ -69,12 +69,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js index 2056e33b7b7..03b39a354a3 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js index 9c68e502eee..fa6deebe16a 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js @@ -1,68 +1,94 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/capture - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); - -// Validate if response has JSON Body +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.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 "processing" for "status" if (jsonData?.status) { -pm.test("[POST]:://payments/:id/capture - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; + pm.test( + "[POST]:://payments/:id/capture - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "6000" for "amount_received" if (jsonData?.amount_received) { -pm.test("[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", function() { - pm.expect(jsonData.amount_received).to.eql(6000); -})}; - - - - + pm.test( + "[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", + function () { + pm.expect(jsonData.amount_received).to.eql(6000); + }, + ); +} diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json index 8975575ca40..9fe257ed85e 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js index b0e69cad2c2..d683186aa00 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json index 54120e2a3ee..2d3cda4b007 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json @@ -79,12 +79,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js index 8e711a8c8d6..9d98bf32bfb 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json index 6f4d51c5945..61fcdaec2d2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js index 9632bd19048..dcf3f191643 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js @@ -1,43 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/cancel - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type 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(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "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"); -})}; - - - + pm.test( + "[POST]::/payments/:id/cancel - Content check if value for 'status' matches 'cancelled'", + function () { + pm.expect(jsonData.status).to.eql("cancelled"); + }, + ); +} diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js index d8a332a994e..55dc35b9128 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json index 9dcf43c6740..2c7ace2ed59 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json @@ -79,12 +79,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js index f4e0ab9b2aa..5e52e13a59e 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "cancelled" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'", function() { - pm.expect(jsonData.status).to.eql("cancelled"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'", + function () { + pm.expect(jsonData.status).to.eql("cancelled"); + }, + ); +} diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Payments - Create/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Payments - Create/event.test.js b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Payments - Create/event.test.js index a97ee1b165d..ac83e544d5d 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Payments - Create/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Payments - Create/event.test.js @@ -1,65 +1,97 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} // Response body should have value "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Payments - Create/request.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Payments - Create/request.json index 5f2ff572e53..a735ee48661 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Payments - Create/request.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Payments - Create/request.json @@ -96,12 +96,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Payments - Retrieve-copy/event.test.js index fd79923f9ae..572987e36a2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Payments - Retrieve-copy/event.test.js @@ -1,61 +1,87 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Payments - Retrieve-copy/request.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Payments - Retrieve/event.test.js b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Payments - Retrieve/event.test.js index fd79923f9ae..572987e36a2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Payments - Retrieve/event.test.js @@ -1,61 +1,87 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Payments - Retrieve/request.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Recurring Payments - Create/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Recurring Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Recurring Payments - Create/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Recurring Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Recurring Payments - Create/event.test.js b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Recurring Payments - Create/event.test.js index bdf8d2a3f7d..ce36d5ed1d6 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Recurring Payments - Create/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Recurring Payments - Create/event.test.js @@ -1,65 +1,95 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); // Response body should have "payment_method_data" -pm.test("[POST]::/payments - Content check if 'payment_method_data' exists", function() { - pm.expect((typeof jsonData.payment_method_data !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'payment_method_data' exists", + function () { + pm.expect(typeof jsonData.payment_method_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Recurring Payments - Create/request.json b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Recurring Payments - Create/request.json index 355ce58f203..835ba4dc6ef 100644 --- a/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Recurring Payments - Create/request.json +++ b/postman/collection-dir/forte/Flow Testcases/Happy Cases/Scenario6-Create a mandate and recurring payment/Recurring Payments - Create/request.json @@ -71,12 +71,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/forte/Flow Testcases/QuickStart/API Key - Create/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/QuickStart/API Key - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/QuickStart/API Key - Create/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/QuickStart/API Key - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/QuickStart/API Key - Create/event.test.js b/postman/collection-dir/forte/Flow Testcases/QuickStart/API Key - Create/event.test.js index bc42e83a761..4e27c5a5025 100644 --- a/postman/collection-dir/forte/Flow Testcases/QuickStart/API Key - Create/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/QuickStart/API Key - Create/event.test.js @@ -1,32 +1,46 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/api_keys/:merchant_id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/api_keys/:merchant_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/api_keys/:merchant_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; try { jsonData = pm.response.json(); -} catch(e) { -} +} catch (e) {} // pm.collectionVariables - Set api_key_id as variable for jsonData.key_id if (jsonData?.key_id) { - pm.collectionVariables.set("api_key_id", jsonData.key_id); - console.log("- use {{api_key_id}} as collection variable for value", jsonData.key_id); + pm.collectionVariables.set("api_key_id", jsonData.key_id); + console.log( + "- use {{api_key_id}} as collection variable for value", + jsonData.key_id, + ); } else { - console.log('INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value", jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} diff --git a/postman/collection-dir/forte/Flow Testcases/QuickStart/API Key - Create/request.json b/postman/collection-dir/forte/Flow Testcases/QuickStart/API Key - Create/request.json index 29c2490d1bc..2210d14da0e 100644 --- a/postman/collection-dir/forte/Flow Testcases/QuickStart/API Key - Create/request.json +++ b/postman/collection-dir/forte/Flow Testcases/QuickStart/API Key - Create/request.json @@ -35,13 +35,8 @@ }, "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/forte/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js b/postman/collection-dir/forte/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js index 538b393c084..7de0d5beb31 100644 --- a/postman/collection-dir/forte/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js @@ -1,37 +1,56 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - 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]::/accounts - 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", + ); }); // 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 merchant_id as variable for jsonData.merchant_id if (jsonData?.merchant_id) { - pm.collectionVariables.set("merchant_id", jsonData.merchant_id); - console.log("- use {{merchant_id}} as collection variable for value",jsonData.merchant_id); + pm.collectionVariables.set("merchant_id", jsonData.merchant_id); + console.log( + "- use {{merchant_id}} as collection variable for value", + jsonData.merchant_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value",jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} // pm.collectionVariables - Set publishable_key as variable for jsonData.publishable_key if (jsonData?.publishable_key) { - pm.collectionVariables.set("publishable_key", jsonData.publishable_key); - console.log("- use {{publishable_key}} as collection variable for value",jsonData.publishable_key); + pm.collectionVariables.set("publishable_key", jsonData.publishable_key); + console.log( + "- use {{publishable_key}} as collection variable for value", + jsonData.publishable_key, + ); } else { - console.log('INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.", + ); +} diff --git a/postman/collection-dir/forte/Flow Testcases/QuickStart/Merchant Account - Create/request.json b/postman/collection-dir/forte/Flow Testcases/QuickStart/Merchant Account - Create/request.json index aa84e7e1c3f..1d8364c8a3f 100644 --- a/postman/collection-dir/forte/Flow Testcases/QuickStart/Merchant Account - Create/request.json +++ b/postman/collection-dir/forte/Flow Testcases/QuickStart/Merchant Account - Create/request.json @@ -84,12 +84,8 @@ }, "url": { "raw": "{{baseUrl}}/accounts", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "accounts" - ] + "host": ["{{baseUrl}}"], + "path": ["accounts"] }, "description": "Create a new account for a merchant. The merchant could be a seller or retailer or client who likes to receive and send payments." } diff --git a/postman/collection-dir/forte/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js b/postman/collection-dir/forte/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js index b831702461e..88e92d8d84a 100644 --- a/postman/collection-dir/forte/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js @@ -1,21 +1,39 @@ -// Validate status 2xx -pm.test("[POST]::/account/:account_id/connectors - 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.be.success; + }, +); // Validate if response header has matching content-type -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"); -}); +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){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id if (jsonData?.merchant_connector_id) { - pm.collectionVariables.set("merchant_connector_id", jsonData.merchant_connector_id); - console.log("- use {{merchant_connector_id}} as collection variable for value",jsonData.merchant_connector_id); + pm.collectionVariables.set( + "merchant_connector_id", + jsonData.merchant_connector_id, + ); + console.log( + "- use {{merchant_connector_id}} as collection variable for value", + jsonData.merchant_connector_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.", + ); +} diff --git a/postman/collection-dir/forte/Flow Testcases/QuickStart/Payment Connector - Create/request.json b/postman/collection-dir/forte/Flow Testcases/QuickStart/Payment Connector - Create/request.json index a94baa8cfef..0008e4996fd 100644 --- a/postman/collection-dir/forte/Flow Testcases/QuickStart/Payment Connector - Create/request.json +++ b/postman/collection-dir/forte/Flow Testcases/QuickStart/Payment Connector - Create/request.json @@ -57,10 +57,7 @@ "payment_method_types": [ { "payment_method_type": "credit", - "card_networks": [ - "Visa", - "Mastercard" - ], + "card_networks": ["Visa", "Mastercard"], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, @@ -68,10 +65,7 @@ }, { "payment_method_type": "debit", - "card_networks": [ - "Visa", - "Mastercard" - ], + "card_networks": ["Visa", "Mastercard"], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, @@ -86,10 +80,7 @@ { "type": "CARD", "parameters": { - "allowed_auth_methods": [ - "PAN_ONLY", - "CRYPTOGRAM_3DS" - ], + "allowed_auth_methods": ["PAN_ONLY", "CRYPTOGRAM_3DS"], "allowed_card_networks": [ "AMEX", "DISCOVER", @@ -117,14 +108,8 @@ }, "url": { "raw": "{{baseUrl}}/account/:account_id/connectors", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/forte/Flow Testcases/QuickStart/Payments - Create/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/QuickStart/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/QuickStart/Payments - Create/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/QuickStart/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/QuickStart/Payments - Create/event.test.js b/postman/collection-dir/forte/Flow Testcases/QuickStart/Payments - Create/event.test.js index 62142d52dca..a6947db94c0 100644 --- a/postman/collection-dir/forte/Flow Testcases/QuickStart/Payments - Create/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/QuickStart/Payments - Create/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/forte/Flow Testcases/QuickStart/Payments - Create/request.json b/postman/collection-dir/forte/Flow Testcases/QuickStart/Payments - Create/request.json index 38c58c9a0a9..05fde18c2d9 100644 --- a/postman/collection-dir/forte/Flow Testcases/QuickStart/Payments - Create/request.json +++ b/postman/collection-dir/forte/Flow Testcases/QuickStart/Payments - Create/request.json @@ -79,12 +79,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/forte/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js b/postman/collection-dir/forte/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js index 4dd072b2222..d0a02af7436 100644 --- a/postman/collection-dir/forte/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // 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.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/forte/Flow Testcases/QuickStart/Payments - Retrieve/request.json b/postman/collection-dir/forte/Flow Testcases/QuickStart/Payments - Retrieve/request.json index c71774083b2..ef0b213739d 100644 --- a/postman/collection-dir/forte/Flow Testcases/QuickStart/Payments - Retrieve/request.json +++ b/postman/collection-dir/forte/Flow Testcases/QuickStart/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js index 6c48697032e..15a759e4d78 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js @@ -1,54 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 "invalid_request" 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"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json index 3fecc2dc02e..837d163c004 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json @@ -79,12 +79,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js index 18804c43147..068c6369d7d 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js @@ -1,56 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); - // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 "invalid_request " 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"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json index 5b0d3fcbef5..ac8b20c5a51 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json @@ -79,12 +79,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js index c2a8eec14f9..c56d15aaee8 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js @@ -1,55 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 "Json deserialize error" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments - Content check if value for 'error.type' matches 'Json deserialize error'", function() { - pm.expect(jsonData.error.type).to.eql("Json deserialize error"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'Json deserialize error'", + function () { + pm.expect(jsonData.error.type).to.eql("Json deserialize error"); + }, + ); +} diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json index 03d94032457..57cd41a7218 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json @@ -75,12 +75,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js index f221e865a1a..db75f274f9a 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js @@ -1,55 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 "invalid_request" 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"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json index 8d687ae4d92..86fd5b1bf01 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json @@ -79,12 +79,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json index 90b19864ee1..f2bee31ef66 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Confirm" - ] + "childrenOrder": ["Payments - Create", "Payments - Confirm"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js index 1e8ba8cc3a6..e8d6b2216c5 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js @@ -1,58 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); -}); - - +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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json index b28abd0c309..e3b1e235042 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json @@ -67,12 +67,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js index c3e7afc6760..46bf201d1ce 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js @@ -1,59 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json index 766a8330d6e..6c934a9132c 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js index b0e69cad2c2..d683186aa00 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json index 54120e2a3ee..2d3cda4b007 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json @@ -79,12 +79,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js index 6b03e0b9ee6..34beacf976b 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" 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"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json index cafd3a6808e..6df7c0a1943 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Capture" - ] + "childrenOrder": ["Payments - Create", "Payments - Capture"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js index c3e7afc6760..46bf201d1ce 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js @@ -1,59 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json index 766a8330d6e..6c934a9132c 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js index cd0c4d65e21..16c37817f0b 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json index 45dea50bba0..642f9d9caf5 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json @@ -79,12 +79,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json index afba25ab6d6..5ff1a7cb4e8 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Cancel" - ] + "childrenOrder": ["Payments - Create", "Payments - Cancel"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js index d7879c70d87..0f869a6dfb8 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js @@ -1,50 +1,69 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/cancel - Status code is 4xx", function () { - pm.response.to.be.error; + 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/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/cancel - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; - - - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js index cd0c4d65e21..16c37817f0b 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json index 45dea50bba0..642f9d9caf5 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json @@ -79,12 +79,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario6-Create a recurring payment with greater mandate amount/Payments - Create/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario6-Create a recurring payment with greater mandate amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario6-Create a recurring payment with greater mandate amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario6-Create a recurring payment with greater mandate amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario6-Create a recurring payment with greater mandate amount/Payments - Create/event.test.js b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario6-Create a recurring payment with greater mandate amount/Payments - Create/event.test.js index a97ee1b165d..ac83e544d5d 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario6-Create a recurring payment with greater mandate amount/Payments - Create/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario6-Create a recurring payment with greater mandate amount/Payments - Create/event.test.js @@ -1,65 +1,97 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} // Response body should have value "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario6-Create a recurring payment with greater mandate amount/Payments - Create/request.json b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario6-Create a recurring payment with greater mandate amount/Payments - Create/request.json index 5bb03275941..52be363a049 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario6-Create a recurring payment with greater mandate amount/Payments - Create/request.json +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario6-Create a recurring payment with greater mandate amount/Payments - Create/request.json @@ -95,12 +95,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario6-Create a recurring payment with greater mandate amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario6-Create a recurring payment with greater mandate amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario6-Create a recurring payment with greater mandate amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario6-Create a recurring payment with greater mandate amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario6-Create a recurring payment with greater mandate amount/Payments - Retrieve/event.test.js b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario6-Create a recurring payment with greater mandate amount/Payments - Retrieve/event.test.js index fd79923f9ae..572987e36a2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario6-Create a recurring payment with greater mandate amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario6-Create a recurring payment with greater mandate amount/Payments - Retrieve/event.test.js @@ -1,61 +1,87 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario6-Create a recurring payment with greater mandate amount/Payments - Retrieve/request.json b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario6-Create a recurring payment with greater mandate amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario6-Create a recurring payment with greater mandate amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario6-Create a recurring payment with greater mandate amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario6-Create a recurring payment with greater mandate amount/Recurring Payments - Create/.event.meta.json b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario6-Create a recurring payment with greater mandate amount/Recurring Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario6-Create a recurring payment with greater mandate amount/Recurring Payments - Create/.event.meta.json +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario6-Create a recurring payment with greater mandate amount/Recurring Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario6-Create a recurring payment with greater mandate amount/Recurring Payments - Create/event.test.js b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario6-Create a recurring payment with greater mandate amount/Recurring Payments - Create/event.test.js index 22617f827cf..e862404c2b2 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario6-Create a recurring payment with greater mandate amount/Recurring Payments - Create/event.test.js +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario6-Create a recurring payment with greater mandate amount/Recurring Payments - Create/event.test.js @@ -1,56 +1,79 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/confirm - Content check if 'error' exists", + function () { + pm.expect(typeof jsonData.error !== "undefined").to.be.true; + }, +); // Response body should have value "invalid_request" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; - - + pm.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"); + }, + ); +} diff --git a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario6-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario6-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json index d2c4a106d65..8fc4831ccc3 100644 --- a/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario6-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json +++ b/postman/collection-dir/forte/Flow Testcases/Variation Cases/Scenario6-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json @@ -69,12 +69,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/forte/Health check/.meta.json b/postman/collection-dir/forte/Health check/.meta.json index 66ee7e50cab..579f9fd541c 100644 --- a/postman/collection-dir/forte/Health check/.meta.json +++ b/postman/collection-dir/forte/Health check/.meta.json @@ -1,5 +1,3 @@ { - "childrenOrder": [ - "New Request" - ] + "childrenOrder": ["New Request"] } diff --git a/postman/collection-dir/forte/Health check/New Request/.event.meta.json b/postman/collection-dir/forte/Health check/New Request/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/forte/Health check/New Request/.event.meta.json +++ b/postman/collection-dir/forte/Health check/New Request/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/forte/Health check/New Request/event.test.js b/postman/collection-dir/forte/Health check/New Request/event.test.js index 325a8c8a479..b490b8be090 100644 --- a/postman/collection-dir/forte/Health check/New Request/event.test.js +++ b/postman/collection-dir/forte/Health check/New Request/event.test.js @@ -1,4 +1,4 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - Status code is 2xx", function () { - pm.response.to.be.success; -}); \ No newline at end of file + pm.response.to.be.success; +}); diff --git a/postman/collection-dir/forte/Health check/New Request/request.json b/postman/collection-dir/forte/Health check/New Request/request.json index 4cc8d4b1a96..e40e9396178 100644 --- a/postman/collection-dir/forte/Health check/New Request/request.json +++ b/postman/collection-dir/forte/Health check/New Request/request.json @@ -10,11 +10,7 @@ ], "url": { "raw": "{{baseUrl}}/health", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "health" - ] + "host": ["{{baseUrl}}"], + "path": ["health"] } } diff --git a/postman/collection-dir/globalpay/.event.meta.json b/postman/collection-dir/globalpay/.event.meta.json index 2df9d47d936..eb871bbcb9b 100644 --- a/postman/collection-dir/globalpay/.event.meta.json +++ b/postman/collection-dir/globalpay/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.prerequest.js", - "event.test.js" - ] + "eventOrder": ["event.prerequest.js", "event.test.js"] } diff --git a/postman/collection-dir/globalpay/.meta.json b/postman/collection-dir/globalpay/.meta.json index 91b6a65c5bc..d513035ce2d 100644 --- a/postman/collection-dir/globalpay/.meta.json +++ b/postman/collection-dir/globalpay/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Health check", - "Flow Testcases" - ] + "childrenOrder": ["Health check", "Flow Testcases"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/.meta.json b/postman/collection-dir/globalpay/Flow Testcases/.meta.json index 1bbce843680..023989e1e49 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/.meta.json @@ -1,7 +1,3 @@ { - "childrenOrder": [ - "QuickStart", - "Happy Cases", - "Variation Cases" - ] + "childrenOrder": ["QuickStart", "Happy Cases", "Variation Cases"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js index 7cc23d8f89b..ff221d7f77a 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js @@ -1,54 +1,76 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Validate connector pm.test("[POST]::/payments - connector is globalpay", function () { - pm.expect(jsonData.connector).to.eql("globalpay"); + pm.expect(jsonData.connector).to.eql("globalpay"); }); diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json index f174724300c..d50cffc47e5 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js index c5bae16750d..c48d8e2d054 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json index 2443d2c76ae..c8433a1c6ab 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js index 01c5b744eac..4974bba662f 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js @@ -1,58 +1,76 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "refunds" -pm.test("[POST]::/payments - Content check if 'refunds' exists", function() { - pm.expect((typeof jsonData.refunds !== "undefined")).to.be.true; +pm.test("[POST]::/payments - Content check if 'refunds' exists", function () { + pm.expect(typeof jsonData.refunds !== "undefined").to.be.true; }); - - - diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js index d28f25fa46d..56ea9efbac0 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "1000" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '1000'", function() { - pm.expect(jsonData.amount).to.eql(1000); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '1000'", + function () { + pm.expect(jsonData.amount).to.eql(1000); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json index b56057fad5d..caed7818578 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js index 04650f547a2..c1dd16a4551 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '540'", function() { - pm.expect(jsonData.amount).to.eql(540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '540'", + function () { + pm.expect(jsonData.amount).to.eql(540); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json index d18aaf8befd..9fe125ce8ea 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js index bfe3137afb0..f0351c05701 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '1000'", function() { - pm.expect(jsonData.amount).to.eql(1000); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '1000'", + function () { + pm.expect(jsonData.amount).to.eql(1000); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js index 7bff0a3c12c..920a7c47f36 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '540'", function() { - pm.expect(jsonData.amount).to.eql(540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '540'", + function () { + pm.expect(jsonData.amount).to.eql(540); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/event.test.js index c2ec23a52bf..3cc84a8d9f9 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "ideal" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'ideal'", function() { - pm.expect(jsonData.payment_method_type).to.eql("ideal"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'ideal'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("ideal"); + }, + ); +} // Response body should have value "globalpay" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'globalpay'", function() { - pm.expect(jsonData.connector).to.eql("globalpay"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'globalpay'", + function () { + pm.expect(jsonData.connector).to.eql("globalpay"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/request.json index 6c44ab9d4e0..10b88b51748 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_redirect", "payment_method_type": "ideal", "payment_method_data": { @@ -36,14 +57,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/request.json index 87d07a6016b..0b0c56d2660 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/event.prerequest.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/event.prerequest.js index e9aab96b6d8..0bcc9583532 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/event.prerequest.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/event.prerequest.js @@ -1 +1 @@ -setTimeout(function() {}, 300); \ No newline at end of file +setTimeout(function () {}, 300); diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/event.test.js index 63c22b5e6bf..277e6ab2c32 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "sofort" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'sofort'", function() { - pm.expect(jsonData.payment_method_type).to.eql("sofort"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'sofort'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("sofort"); + }, + ); +} // Response body should have value "globalpay" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'globalpay'", function() { - pm.expect(jsonData.connector).to.eql("globalpay"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'globalpay'", + function () { + pm.expect(jsonData.connector).to.eql("globalpay"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/request.json index 1b3aca65658..d8c127799e0 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_redirect", "payment_method_type": "sofort", "payment_method_data": { @@ -36,14 +57,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/request.json index 87d07a6016b..0b0c56d2660 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/event.prerequest.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/event.prerequest.js index e9aab96b6d8..0bcc9583532 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/event.prerequest.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/event.prerequest.js @@ -1 +1 @@ -setTimeout(function() {}, 300); \ No newline at end of file +setTimeout(function () {}, 300); diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/event.test.js index 4c7564e917d..c9b23ff3d84 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "eps" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'eps'", function() { - pm.expect(jsonData.payment_method_type).to.eql("eps"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'eps'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("eps"); + }, + ); +} // Response body should have value "stripe" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'globalpay'", function() { - pm.expect(jsonData.connector).to.eql("globalpay"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'globalpay'", + function () { + pm.expect(jsonData.connector).to.eql("globalpay"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/request.json index f44bcb6c8e2..50007994eaf 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_redirect", "payment_method_type": "eps", "payment_method_data": { @@ -36,14 +57,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/request.json index 93a459d90b3..f423db21150 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/event.prerequest.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/event.prerequest.js index e9aab96b6d8..0bcc9583532 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/event.prerequest.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/event.prerequest.js @@ -1 +1 @@ -setTimeout(function() {}, 300); \ No newline at end of file +setTimeout(function () {}, 300); diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/event.test.js index 455bd4d4806..29e99a87fbf 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "giropay" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'giropay'", function() { - pm.expect(jsonData.payment_method_type).to.eql("giropay"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'giropay'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("giropay"); + }, + ); +} // Response body should have value "globalpay" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'globalpay'", function() { - pm.expect(jsonData.connector).to.eql("globalpay"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'globalpay'", + function () { + pm.expect(jsonData.connector).to.eql("globalpay"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/request.json index 70123c3aba7..caf10ddd35d 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_redirect", "payment_method_type": "giropay", "payment_method_data": { @@ -36,14 +57,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/request.json index 87d07a6016b..0b0c56d2660 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/event.prerequest.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/event.prerequest.js index e9aab96b6d8..0bcc9583532 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/event.prerequest.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/event.prerequest.js @@ -1 +1 @@ -setTimeout(function() {}, 300); \ No newline at end of file +setTimeout(function () {}, 300); diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Confirm/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Confirm/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Confirm/event.test.js index 455bd4d4806..29e99a87fbf 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Confirm/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "giropay" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'giropay'", function() { - pm.expect(jsonData.payment_method_type).to.eql("giropay"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'giropay'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("giropay"); + }, + ); +} // Response body should have value "globalpay" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'globalpay'", function() { - pm.expect(jsonData.connector).to.eql("globalpay"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'globalpay'", + function () { + pm.expect(jsonData.connector).to.eql("globalpay"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Confirm/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Confirm/request.json index 70123c3aba7..caf10ddd35d 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Confirm/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_redirect", "payment_method_type": "giropay", "payment_method_data": { @@ -36,14 +57,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Create/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Create/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Create/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Create/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Create/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Create/request.json index 87d07a6016b..0b0c56d2660 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Create/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Retrieve/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Retrieve/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Retrieve/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Retrieve/event.prerequest.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Retrieve/event.prerequest.js index e9aab96b6d8..0bcc9583532 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Retrieve/event.prerequest.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Retrieve/event.prerequest.js @@ -1 +1 @@ -setTimeout(function() {}, 300); \ No newline at end of file +setTimeout(function () {}, 300); diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Retrieve/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Retrieve/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Retrieve/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario18-Wallet-Paypal/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js index bb50904fd89..f92fba3d044 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js index 5698484c741..55dc35b9128 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json index 7186bddbe07..119353069bd 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js index 03ccae1adb0..aced67dbfb7 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js index 5d9e5785e6e..6d812bc75fe 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id/confirm - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id/confirm - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json index bb2b0cdc1b0..402aa25fef8 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "card", "payment_method_data": { "card": { @@ -32,14 +53,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json index b28abd0c309..e3b1e235042 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json @@ -67,12 +67,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js index 03ccae1adb0..aced67dbfb7 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js index 1e2875ec9f6..2d7dbc507fb 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js @@ -1,68 +1,94 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/capture - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); - -// Validate if response has JSON Body +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.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} - +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]:://payments/:id/capture - 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 "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "6000" for "amount_received" if (jsonData?.amount_received) { -pm.test("[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", function() { - pm.expect(jsonData.amount_received).to.eql(6000); -})}; - - - - + pm.test( + "[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", + function () { + pm.expect(jsonData.amount_received).to.eql(6000); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json index 8975575ca40..9fe257ed85e 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js index b0e69cad2c2..d683186aa00 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json index 94a707d54b4..6936932761c 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js index 1a0942b5f88..5c7196baa4f 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js index 9632bd19048..dcf3f191643 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js @@ -1,43 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/cancel - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type 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(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "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"); -})}; - - - + pm.test( + "[POST]::/payments/:id/cancel - Content check if value for 'status' matches 'cancelled'", + function () { + pm.expect(jsonData.status).to.eql("cancelled"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js index b0e69cad2c2..d683186aa00 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json index b2e17347e24..db513b70bf6 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json @@ -78,12 +78,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js index f4e0ab9b2aa..5e52e13a59e 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "cancelled" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'", function() { - pm.expect(jsonData.status).to.eql("cancelled"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'", + function () { + pm.expect(jsonData.status).to.eql("cancelled"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json index 2443d2c76ae..c8433a1c6ab 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js index 1c34027de1d..f89b9b86fef 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json index 5e306df7a55..5f4c58816d5 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js index 07a9529b82e..6cb4312a60a 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/API Key - Create/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/API Key - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/API Key - Create/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/API Key - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/API Key - Create/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/API Key - Create/event.test.js index bc42e83a761..4e27c5a5025 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/API Key - Create/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/API Key - Create/event.test.js @@ -1,32 +1,46 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/api_keys/:merchant_id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/api_keys/:merchant_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/api_keys/:merchant_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; try { jsonData = pm.response.json(); -} catch(e) { -} +} catch (e) {} // pm.collectionVariables - Set api_key_id as variable for jsonData.key_id if (jsonData?.key_id) { - pm.collectionVariables.set("api_key_id", jsonData.key_id); - console.log("- use {{api_key_id}} as collection variable for value", jsonData.key_id); + pm.collectionVariables.set("api_key_id", jsonData.key_id); + console.log( + "- use {{api_key_id}} as collection variable for value", + jsonData.key_id, + ); } else { - console.log('INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value", jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/API Key - Create/request.json b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/API Key - Create/request.json index 29c2490d1bc..2210d14da0e 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/API Key - Create/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/API Key - Create/request.json @@ -35,13 +35,8 @@ }, "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js index 538b393c084..7de0d5beb31 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js @@ -1,37 +1,56 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - 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]::/accounts - 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", + ); }); // 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 merchant_id as variable for jsonData.merchant_id if (jsonData?.merchant_id) { - pm.collectionVariables.set("merchant_id", jsonData.merchant_id); - console.log("- use {{merchant_id}} as collection variable for value",jsonData.merchant_id); + pm.collectionVariables.set("merchant_id", jsonData.merchant_id); + console.log( + "- use {{merchant_id}} as collection variable for value", + jsonData.merchant_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value",jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} // pm.collectionVariables - Set publishable_key as variable for jsonData.publishable_key if (jsonData?.publishable_key) { - pm.collectionVariables.set("publishable_key", jsonData.publishable_key); - console.log("- use {{publishable_key}} as collection variable for value",jsonData.publishable_key); + pm.collectionVariables.set("publishable_key", jsonData.publishable_key); + console.log( + "- use {{publishable_key}} as collection variable for value", + jsonData.publishable_key, + ); } else { - console.log('INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.", + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Merchant Account - Create/request.json b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Merchant Account - Create/request.json index ffeea3410a4..dcbf46ee538 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Merchant Account - Create/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Merchant Account - Create/request.json @@ -84,12 +84,8 @@ }, "url": { "raw": "{{baseUrl}}/accounts", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "accounts" - ] + "host": ["{{baseUrl}}"], + "path": ["accounts"] }, "description": "Create a new account for a merchant. The merchant could be a seller or retailer or client who likes to receive and send payments." } diff --git a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js index b831702461e..88e92d8d84a 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js @@ -1,21 +1,39 @@ -// Validate status 2xx -pm.test("[POST]::/account/:account_id/connectors - 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.be.success; + }, +); // Validate if response header has matching content-type -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"); -}); +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){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id if (jsonData?.merchant_connector_id) { - pm.collectionVariables.set("merchant_connector_id", jsonData.merchant_connector_id); - console.log("- use {{merchant_connector_id}} as collection variable for value",jsonData.merchant_connector_id); + pm.collectionVariables.set( + "merchant_connector_id", + jsonData.merchant_connector_id, + ); + console.log( + "- use {{merchant_connector_id}} as collection variable for value", + jsonData.merchant_connector_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.", + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payment Connector - Create/request.json b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payment Connector - Create/request.json index e43b03a35c1..16969f0b4ed 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payment Connector - Create/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payment Connector - Create/request.json @@ -55,10 +55,7 @@ "payment_method_types": [ { "payment_method_type": "credit", - "card_networks": [ - "Visa", - "Mastercard" - ], + "card_networks": ["Visa", "Mastercard"], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, @@ -66,10 +63,7 @@ }, { "payment_method_type": "debit", - "card_networks": [ - "Visa", - "Mastercard" - ], + "card_networks": ["Visa", "Mastercard"], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, @@ -170,14 +164,8 @@ }, "url": { "raw": "{{baseUrl}}/account/:account_id/connectors", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payments - Create/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payments - Create/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payments - Create/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payments - Create/event.test.js index 62142d52dca..a6947db94c0 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payments - Create/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payments - Create/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payments - Create/request.json b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payments - Create/request.json index c9a4f6ec36e..967dc41cb6e 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payments - Create/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js index 4dd072b2222..d0a02af7436 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // 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.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payments - Retrieve/request.json b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payments - Retrieve/request.json index c71774083b2..ef0b213739d 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payments - Retrieve/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Refunds - Create/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Refunds - Create/event.test.js index c862e8e68a7..dbc930608cb 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Refunds - Create/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Refunds - Create/event.test.js @@ -1,21 +1,30 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Refunds - Create/request.json b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Refunds - Create/request.json index 4dbca4d01f2..0c13281ee15 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Refunds - Create/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js index b1e1f12ba50..bbd8e544e2c 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js @@ -1,22 +1,30 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); - // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Refunds - Retrieve/request.json b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Refunds - Retrieve/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/QuickStart/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js index 9e10877de29..3b3c73e62a2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js @@ -1,60 +1,86 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 "invalid_request" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments - Content check if value for 'error.type' matches 'connector'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} //Response body should have "error_message" representing invalid card exp month if (jsonData?.error?.type) { -pm.test("[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'", function() { - pm.expect(jsonData.error.message).to.eql("Invalid Expiry Year"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'", + function () { + pm.expect(jsonData.error.message).to.eql("Invalid Expiry Year"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json index ad281c58256..9cbdbc8e22f 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js index 7eec2edcf36..964d8b9f2f8 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js @@ -1,62 +1,86 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); - // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 "invalid_request" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments - Content check if value for 'error.type' matches 'connector'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} //Response body should have "error_message" representing invalid card exp month if (jsonData?.error?.type) { -pm.test("[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'", function() { - pm.expect(jsonData.error.message).to.eql("Card Expired"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'", + function () { + pm.expect(jsonData.error.message).to.eql("Card Expired"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json index c312a293762..3b42eba71c3 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js index 55d0dbe9071..7ce12a812a7 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js @@ -1,60 +1,87 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector_error'", function() { - pm.expect(jsonData.error.type).to.eql("connector"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'", + function () { + pm.expect(jsonData.error.type).to.eql("connector"); + }, + ); +} if (jsonData?.error?.type) { -pm.test("[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'", function() { - pm.expect(jsonData.error.message).to.eql("INVALID_REQUEST_DATA: Transaction not supported Please contact support "); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'", + function () { + pm.expect(jsonData.error.message).to.eql( + "INVALID_REQUEST_DATA: Transaction not supported Please contact support ", + ); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json index 3ba55fc3b86..6f5b5782e41 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json @@ -75,12 +75,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js index 77da2fc344a..2f7039269ef 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js @@ -1,61 +1,86 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} //Response body should have "error_message" representing invalid card exp month if (jsonData?.error?.type) { -pm.test("[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'", function() { - pm.expect(jsonData.error.message).to.eql("Invalid card_cvc length"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'", + function () { + pm.expect(jsonData.error.message).to.eql("Invalid card_cvc length"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json index 77bf2c3a336..29b16d2acbf 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json index 90b19864ee1..f2bee31ef66 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Confirm" - ] + "childrenOrder": ["Payments - Create", "Payments - Confirm"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js index 1e8ba8cc3a6..e8d6b2216c5 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js @@ -1,58 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); -}); - - +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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json index b28abd0c309..e3b1e235042 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json @@ -67,12 +67,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js index c3e7afc6760..46bf201d1ce 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js @@ -1,59 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json index 766a8330d6e..6c934a9132c 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js index b0e69cad2c2..d683186aa00 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json index 94a707d54b4..6936932761c 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js index 6b03e0b9ee6..34beacf976b 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" 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"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json index cafd3a6808e..6df7c0a1943 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Capture" - ] + "childrenOrder": ["Payments - Create", "Payments - Capture"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js index c3e7afc6760..46bf201d1ce 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js @@ -1,59 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json index 766a8330d6e..6c934a9132c 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json index 2443d2c76ae..c8433a1c6ab 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json index afba25ab6d6..5ff1a7cb4e8 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Cancel" - ] + "childrenOrder": ["Payments - Create", "Payments - Cancel"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js index d7879c70d87..0f869a6dfb8 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js @@ -1,50 +1,69 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/cancel - Status code is 4xx", function () { - pm.response.to.be.error; + 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/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/cancel - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; - - - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json index 2443d2c76ae..c8433a1c6ab 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json index 2443d2c76ae..c8433a1c6ab 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js index 9537daf6187..776dbd70712 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js @@ -1,33 +1,48 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/refunds - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + 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; -}); +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"); -})}; - + 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"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json index 326319e8fdf..10de81bed08 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js index 65232a76373..55dc35b9128 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; - - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json index 7186bddbe07..119353069bd 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js index 42bf3e0ac45..fdb8a946f3d 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js index 30888b5cc0c..d3c4451760d 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js @@ -1,32 +1,48 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/refunds - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + 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; -}); +pm.test( + "[POST]::/payments/:id/confirm - Content check if 'error' exists", + function () { + pm.expect(typeof jsonData.error !== "undefined").to.be.true; + }, +); // Response body should have value "invalid_request" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; + pm.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"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json index d18aaf8befd..9fe125ce8ea 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/event.test.js index b9d305e4fc4..1b37dc2c7d1 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/event.test.js @@ -1,65 +1,97 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/request.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/request.json index d0887ba7661..57d625e7c39 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/request.json @@ -94,12 +94,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/event.test.js index b94e329999b..db584da2266 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/event.test.js @@ -1,61 +1,87 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/request.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/.event.meta.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/.event.meta.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/event.test.js b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/event.test.js index 22617f827cf..e862404c2b2 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/event.test.js +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/event.test.js @@ -1,56 +1,79 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/confirm - Content check if 'error' exists", + function () { + pm.expect(typeof jsonData.error !== "undefined").to.be.true; + }, +); // Response body should have value "invalid_request" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; - - + pm.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"); + }, + ); +} diff --git a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json index d2c4a106d65..8fc4831ccc3 100644 --- a/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json +++ b/postman/collection-dir/globalpay/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json @@ -69,12 +69,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/globalpay/Health check/.meta.json b/postman/collection-dir/globalpay/Health check/.meta.json index 66ee7e50cab..579f9fd541c 100644 --- a/postman/collection-dir/globalpay/Health check/.meta.json +++ b/postman/collection-dir/globalpay/Health check/.meta.json @@ -1,5 +1,3 @@ { - "childrenOrder": [ - "New Request" - ] + "childrenOrder": ["New Request"] } diff --git a/postman/collection-dir/globalpay/Health check/New Request/.event.meta.json b/postman/collection-dir/globalpay/Health check/New Request/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/globalpay/Health check/New Request/.event.meta.json +++ b/postman/collection-dir/globalpay/Health check/New Request/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/globalpay/Health check/New Request/event.test.js b/postman/collection-dir/globalpay/Health check/New Request/event.test.js index 325a8c8a479..b490b8be090 100644 --- a/postman/collection-dir/globalpay/Health check/New Request/event.test.js +++ b/postman/collection-dir/globalpay/Health check/New Request/event.test.js @@ -1,4 +1,4 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - Status code is 2xx", function () { - pm.response.to.be.success; -}); \ No newline at end of file + pm.response.to.be.success; +}); diff --git a/postman/collection-dir/globalpay/Health check/New Request/request.json b/postman/collection-dir/globalpay/Health check/New Request/request.json index 4cc8d4b1a96..e40e9396178 100644 --- a/postman/collection-dir/globalpay/Health check/New Request/request.json +++ b/postman/collection-dir/globalpay/Health check/New Request/request.json @@ -10,11 +10,7 @@ ], "url": { "raw": "{{baseUrl}}/health", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "health" - ] + "host": ["{{baseUrl}}"], + "path": ["health"] } } diff --git a/postman/collection-dir/globalpay/event.test.js b/postman/collection-dir/globalpay/event.test.js index 69037688f22..fb52caec30f 100644 --- a/postman/collection-dir/globalpay/event.test.js +++ b/postman/collection-dir/globalpay/event.test.js @@ -1,11 +1,13 @@ // 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("[LOG]::payment_id - " + jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log("[LOG]::payment_id - " + jsonData.payment_id); } -console.log("[LOG]::x-request-id - " + pm.response.headers.get('x-request-id')); \ No newline at end of file +console.log("[LOG]::x-request-id - " + pm.response.headers.get("x-request-id")); diff --git a/postman/collection-dir/hyperswitch/.event.meta.json b/postman/collection-dir/hyperswitch/.event.meta.json index 2df9d47d936..eb871bbcb9b 100644 --- a/postman/collection-dir/hyperswitch/.event.meta.json +++ b/postman/collection-dir/hyperswitch/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.prerequest.js", - "event.test.js" - ] + "eventOrder": ["event.prerequest.js", "event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/API Key/Create API Key/.event.meta.json b/postman/collection-dir/hyperswitch/API Key/Create API Key/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/API Key/Create API Key/.event.meta.json +++ b/postman/collection-dir/hyperswitch/API Key/Create API Key/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/API Key/Create API Key/event.test.js b/postman/collection-dir/hyperswitch/API Key/Create API Key/event.test.js index bc42e83a761..4e27c5a5025 100644 --- a/postman/collection-dir/hyperswitch/API Key/Create API Key/event.test.js +++ b/postman/collection-dir/hyperswitch/API Key/Create API Key/event.test.js @@ -1,32 +1,46 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/api_keys/:merchant_id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/api_keys/:merchant_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/api_keys/:merchant_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; try { jsonData = pm.response.json(); -} catch(e) { -} +} catch (e) {} // pm.collectionVariables - Set api_key_id as variable for jsonData.key_id if (jsonData?.key_id) { - pm.collectionVariables.set("api_key_id", jsonData.key_id); - console.log("- use {{api_key_id}} as collection variable for value", jsonData.key_id); + pm.collectionVariables.set("api_key_id", jsonData.key_id); + console.log( + "- use {{api_key_id}} as collection variable for value", + jsonData.key_id, + ); } else { - console.log('INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value", jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/API Key/Create API Key/request.json b/postman/collection-dir/hyperswitch/API Key/Create API Key/request.json index 29c2490d1bc..2210d14da0e 100644 --- a/postman/collection-dir/hyperswitch/API Key/Create API Key/request.json +++ b/postman/collection-dir/hyperswitch/API Key/Create API Key/request.json @@ -35,13 +35,8 @@ }, "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/hyperswitch/API Key/Delete API Key/.event.meta.json b/postman/collection-dir/hyperswitch/API Key/Delete API Key/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/API Key/Delete API Key/.event.meta.json +++ b/postman/collection-dir/hyperswitch/API Key/Delete API Key/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/API Key/Delete API Key/event.test.js b/postman/collection-dir/hyperswitch/API Key/Delete API Key/event.test.js index 183b46ea167..bed2232f1a3 100644 --- a/postman/collection-dir/hyperswitch/API Key/Delete API Key/event.test.js +++ b/postman/collection-dir/hyperswitch/API Key/Delete API Key/event.test.js @@ -1,9 +1,17 @@ -// Validate status 2xx -pm.test("[DELETE]::/api_keys/:merchant_id/:api-key - Status code is 2xx", function () { - pm.response.to.be.success; -}); +// Validate status 2xx +pm.test( + "[DELETE]::/api_keys/:merchant_id/:api-key - Status code is 2xx", + function () { + pm.response.to.be.success; + }, +); // Validate if response header has matching content-type -pm.test("[DELETE]::/api_keys/:merchant_id/:api-key - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); \ No newline at end of file +pm.test( + "[DELETE]::/api_keys/:merchant_id/:api-key - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); diff --git a/postman/collection-dir/hyperswitch/API Key/Delete API Key/request.json b/postman/collection-dir/hyperswitch/API Key/Delete API Key/request.json index a83d12a2beb..d3631013d83 100644 --- a/postman/collection-dir/hyperswitch/API Key/Delete API Key/request.json +++ b/postman/collection-dir/hyperswitch/API Key/Delete API Key/request.json @@ -27,14 +27,8 @@ ], "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id/:api-key", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id", - ":api-key" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id", ":api-key"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/hyperswitch/API Key/List API Keys/.event.meta.json b/postman/collection-dir/hyperswitch/API Key/List API Keys/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/API Key/List API Keys/.event.meta.json +++ b/postman/collection-dir/hyperswitch/API Key/List API Keys/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/API Key/List API Keys/event.test.js b/postman/collection-dir/hyperswitch/API Key/List API Keys/event.test.js index add47315344..c6cbb8742e2 100644 --- a/postman/collection-dir/hyperswitch/API Key/List API Keys/event.test.js +++ b/postman/collection-dir/hyperswitch/API Key/List API Keys/event.test.js @@ -1,33 +1,46 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/api_keys/:merchant_id/list - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[GET]::/api_keys/:merchant_id/list - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); - +pm.test( + "[GET]::/api_keys/:merchant_id/list - 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) { -} +} catch (e) {} // pm.collectionVariables - Set api_key_id as variable for jsonData.key_id if (jsonData?.key_id) { - pm.collectionVariables.set("api_key_id", jsonData.key_id); - console.log("- use {{api_key_id}} as collection variable for value", jsonData.key_id); + pm.collectionVariables.set("api_key_id", jsonData.key_id); + console.log( + "- use {{api_key_id}} as collection variable for value", + jsonData.key_id, + ); } else { - console.log('INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value", jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/API Key/List API Keys/request.json b/postman/collection-dir/hyperswitch/API Key/List API Keys/request.json index 86d12e8c741..739586859df 100644 --- a/postman/collection-dir/hyperswitch/API Key/List API Keys/request.json +++ b/postman/collection-dir/hyperswitch/API Key/List API Keys/request.json @@ -27,14 +27,8 @@ ], "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id/list", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id", - "list" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id", "list"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/hyperswitch/API Key/Retrieve API Key/.event.meta.json b/postman/collection-dir/hyperswitch/API Key/Retrieve API Key/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/API Key/Retrieve API Key/.event.meta.json +++ b/postman/collection-dir/hyperswitch/API Key/Retrieve API Key/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/API Key/Retrieve API Key/event.test.js b/postman/collection-dir/hyperswitch/API Key/Retrieve API Key/event.test.js index 257285a03a8..bef13cc3577 100644 --- a/postman/collection-dir/hyperswitch/API Key/Retrieve API Key/event.test.js +++ b/postman/collection-dir/hyperswitch/API Key/Retrieve API Key/event.test.js @@ -1,33 +1,49 @@ -// Validate status 2xx -pm.test("[GET]::/api_keys/:merchant_id/:api_key_id - Status code is 2xx", function () { - pm.response.to.be.success; -}); +// Validate status 2xx +pm.test( + "[GET]::/api_keys/:merchant_id/:api_key_id - Status code is 2xx", + function () { + pm.response.to.be.success; + }, +); // Validate if response header has matching content-type -pm.test("[GET]::/api_keys/:merchant_id/:api_key_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); - +pm.test( + "[GET]::/api_keys/:merchant_id/:api_key_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) { -} +} catch (e) {} // pm.collectionVariables - Set api_key_id as variable for jsonData.key_id if (jsonData?.key_id) { - pm.collectionVariables.set("api_key_id", jsonData.key_id); - console.log("- use {{api_key_id}} as collection variable for value", jsonData.key_id); + pm.collectionVariables.set("api_key_id", jsonData.key_id); + console.log( + "- use {{api_key_id}} as collection variable for value", + jsonData.key_id, + ); } else { - console.log('INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value", jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/API Key/Retrieve API Key/request.json b/postman/collection-dir/hyperswitch/API Key/Retrieve API Key/request.json index 958049e9087..6d9d97d776b 100644 --- a/postman/collection-dir/hyperswitch/API Key/Retrieve API Key/request.json +++ b/postman/collection-dir/hyperswitch/API Key/Retrieve API Key/request.json @@ -27,14 +27,8 @@ ], "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id/:api_key_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id", - ":api_key_id" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id", ":api_key_id"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/hyperswitch/API Key/Update API Key/.event.meta.json b/postman/collection-dir/hyperswitch/API Key/Update API Key/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/API Key/Update API Key/.event.meta.json +++ b/postman/collection-dir/hyperswitch/API Key/Update API Key/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/API Key/Update API Key/event.test.js b/postman/collection-dir/hyperswitch/API Key/Update API Key/event.test.js index ba0a326d90f..fd6ed957bdf 100644 --- a/postman/collection-dir/hyperswitch/API Key/Update API Key/event.test.js +++ b/postman/collection-dir/hyperswitch/API Key/Update API Key/event.test.js @@ -1,33 +1,49 @@ -// Validate status 2xx -pm.test("[POST]::/api_keys/:merchant_id/:api_key_id - Status code is 2xx", function () { - pm.response.to.be.success; -}); +// Validate status 2xx +pm.test( + "[POST]::/api_keys/:merchant_id/:api_key_id - Status code is 2xx", + function () { + pm.response.to.be.success; + }, +); // Validate if response header has matching content-type -pm.test("[POST]::/api_keys/:merchant_id/:api_key_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); - +pm.test( + "[POST]::/api_keys/:merchant_id/:api_key_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) { -} +} catch (e) {} // pm.collectionVariables - Set api_key_id as variable for jsonData.key_id if (jsonData?.key_id) { - pm.collectionVariables.set("api_key_id", jsonData.key_id); - console.log("- use {{api_key_id}} as collection variable for value", jsonData.key_id); + pm.collectionVariables.set("api_key_id", jsonData.key_id); + console.log( + "- use {{api_key_id}} as collection variable for value", + jsonData.key_id, + ); } else { - console.log('INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value", jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/API Key/Update API Key/request.json b/postman/collection-dir/hyperswitch/API Key/Update API Key/request.json index af2f450969b..ba0f58b55e8 100644 --- a/postman/collection-dir/hyperswitch/API Key/Update API Key/request.json +++ b/postman/collection-dir/hyperswitch/API Key/Update API Key/request.json @@ -35,14 +35,8 @@ }, "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id/:api_key_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id", - ":api_key_id" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id", ":api_key_id"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/hyperswitch/Customers/Create Customer/.event.meta.json b/postman/collection-dir/hyperswitch/Customers/Create Customer/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Customers/Create Customer/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Customers/Create Customer/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Customers/Create Customer/event.test.js b/postman/collection-dir/hyperswitch/Customers/Create Customer/event.test.js index e05989041ee..4ee1d3e8b2b 100644 --- a/postman/collection-dir/hyperswitch/Customers/Create Customer/event.test.js +++ b/postman/collection-dir/hyperswitch/Customers/Create Customer/event.test.js @@ -1,38 +1,53 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/customers - 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]::/customers - 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]::/customers - 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 "customer_id" -pm.test("[POST]::/customers - Content check if 'customer_id' exists", function() { - pm.expect((typeof jsonData.customer_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/customers - Content check if 'customer_id' exists", + function () { + pm.expect(typeof jsonData.customer_id !== "undefined").to.be.true; + }, +); // Response body should have a minimum length of "1" for "customer_id" if (jsonData?.customer_id) { -pm.test("[POST]::/customers - Content check if value of 'customer_id' has a minimum length of '1'", function() { - pm.expect(jsonData.customer_id.length).is.at.least(1); -})}; - + pm.test( + "[POST]::/customers - Content check if value of 'customer_id' has a minimum length of '1'", + function () { + pm.expect(jsonData.customer_id.length).is.at.least(1); + }, + ); +} // pm.collectionVariables - Set customer_id as variable for jsonData.customer_id if (jsonData?.customer_id) { - pm.collectionVariables.set("customer_id", jsonData.customer_id); - console.log("- use {{customer_id}} as collection variable for value",jsonData.customer_id); + pm.collectionVariables.set("customer_id", jsonData.customer_id); + console.log( + "- use {{customer_id}} as collection variable for value", + jsonData.customer_id, + ); } else { - console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/Customers/Create Customer/request.json b/postman/collection-dir/hyperswitch/Customers/Create Customer/request.json index 18a4500c8e8..be27f693d9c 100644 --- a/postman/collection-dir/hyperswitch/Customers/Create Customer/request.json +++ b/postman/collection-dir/hyperswitch/Customers/Create Customer/request.json @@ -32,12 +32,8 @@ }, "url": { "raw": "{{baseUrl}}/customers", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "customers" - ] + "host": ["{{baseUrl}}"], + "path": ["customers"] }, "description": "Create a customer object and store the customer details to be reused for future payments. Incase the customer already exists in the system, this API will respond with the customer details." } diff --git a/postman/collection-dir/hyperswitch/Customers/Delete Customer/.event.meta.json b/postman/collection-dir/hyperswitch/Customers/Delete Customer/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Customers/Delete Customer/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Customers/Delete Customer/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Customers/Delete Customer/event.test.js b/postman/collection-dir/hyperswitch/Customers/Delete Customer/event.test.js index c6231f7be46..c1aa6604dd9 100644 --- a/postman/collection-dir/hyperswitch/Customers/Delete Customer/event.test.js +++ b/postman/collection-dir/hyperswitch/Customers/Delete Customer/event.test.js @@ -1,14 +1,19 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[DELETE]::/customers/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[DELETE]::/customers/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[DELETE]::/customers/: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 +// Validate if response has JSON Body pm.test("[DELETE]::/customers/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); diff --git a/postman/collection-dir/hyperswitch/Customers/Delete Customer/request.json b/postman/collection-dir/hyperswitch/Customers/Delete Customer/request.json index 75a0d4ebae9..5396d9672f6 100644 --- a/postman/collection-dir/hyperswitch/Customers/Delete Customer/request.json +++ b/postman/collection-dir/hyperswitch/Customers/Delete Customer/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/customers/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "customers", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["customers", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/Customers/Ephemeral Key/.event.meta.json b/postman/collection-dir/hyperswitch/Customers/Ephemeral Key/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Customers/Ephemeral Key/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Customers/Ephemeral Key/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Customers/Ephemeral Key/event.test.js b/postman/collection-dir/hyperswitch/Customers/Ephemeral Key/event.test.js index 8f3941c4117..854d248cbb5 100644 --- a/postman/collection-dir/hyperswitch/Customers/Ephemeral Key/event.test.js +++ b/postman/collection-dir/hyperswitch/Customers/Ephemeral Key/event.test.js @@ -1,9 +1,14 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/ephemeral_keys - 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]::/ephemeral_keys - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); \ No newline at end of file +pm.test( + "[POST]::/ephemeral_keys - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); diff --git a/postman/collection-dir/hyperswitch/Customers/Ephemeral Key/request.json b/postman/collection-dir/hyperswitch/Customers/Ephemeral Key/request.json index a360d72edaf..7ea8a49c306 100644 --- a/postman/collection-dir/hyperswitch/Customers/Ephemeral Key/request.json +++ b/postman/collection-dir/hyperswitch/Customers/Ephemeral Key/request.json @@ -14,11 +14,7 @@ }, "url": { "raw": "{{baseUrl}}/ephemeral_keys", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "ephemeral_keys" - ] + "host": ["{{baseUrl}}"], + "path": ["ephemeral_keys"] } } diff --git a/postman/collection-dir/hyperswitch/Customers/Retrieve Customer/.event.meta.json b/postman/collection-dir/hyperswitch/Customers/Retrieve Customer/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Customers/Retrieve Customer/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Customers/Retrieve Customer/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Customers/Retrieve Customer/event.test.js b/postman/collection-dir/hyperswitch/Customers/Retrieve Customer/event.test.js index 821f8c7321e..9358ea597a2 100644 --- a/postman/collection-dir/hyperswitch/Customers/Retrieve Customer/event.test.js +++ b/postman/collection-dir/hyperswitch/Customers/Retrieve Customer/event.test.js @@ -1,16 +1,19 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/customers/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[GET]::/customers/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[GET]::/customers/: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 +// Validate if response has JSON Body pm.test("[GET]::/customers/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - - diff --git a/postman/collection-dir/hyperswitch/Customers/Retrieve Customer/request.json b/postman/collection-dir/hyperswitch/Customers/Retrieve Customer/request.json index 754fca88377..61a3c66a267 100644 --- a/postman/collection-dir/hyperswitch/Customers/Retrieve Customer/request.json +++ b/postman/collection-dir/hyperswitch/Customers/Retrieve Customer/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/customers/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "customers", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["customers", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/Customers/Update Customer/.event.meta.json b/postman/collection-dir/hyperswitch/Customers/Update Customer/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Customers/Update Customer/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Customers/Update Customer/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Customers/Update Customer/event.test.js b/postman/collection-dir/hyperswitch/Customers/Update Customer/event.test.js index bdec4764056..745585252bf 100644 --- a/postman/collection-dir/hyperswitch/Customers/Update Customer/event.test.js +++ b/postman/collection-dir/hyperswitch/Customers/Update Customer/event.test.js @@ -1,15 +1,19 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/customers/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/customers/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/customers/: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 +// Validate if response has JSON Body pm.test("[POST]::/customers/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - diff --git a/postman/collection-dir/hyperswitch/Customers/Update Customer/request.json b/postman/collection-dir/hyperswitch/Customers/Update Customer/request.json index b1319899764..e85716eedc0 100644 --- a/postman/collection-dir/hyperswitch/Customers/Update Customer/request.json +++ b/postman/collection-dir/hyperswitch/Customers/Update Customer/request.json @@ -31,13 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/customers/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "customers", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["customers", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/Hackathon/.meta.json b/postman/collection-dir/hyperswitch/Hackathon/.meta.json index 1bbce843680..023989e1e49 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/.meta.json @@ -1,7 +1,3 @@ { - "childrenOrder": [ - "QuickStart", - "Happy Cases", - "Variation Cases" - ] + "childrenOrder": ["QuickStart", "Happy Cases", "Variation Cases"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario1-Create payment with confirm true/.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario1-Create payment with confirm true/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario1-Create payment with confirm true/.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario1-Create payment with confirm true/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js index 72f142cc731..c48d8e2d054 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json index 0d6523e82ba..f58c425653c 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js index c5bae16750d..c48d8e2d054 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json index 0d6523e82ba..f58c425653c 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js index 01c5b744eac..4974bba662f 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js @@ -1,58 +1,76 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "refunds" -pm.test("[POST]::/payments - Content check if 'refunds' exists", function() { - pm.expect((typeof jsonData.refunds !== "undefined")).to.be.true; +pm.test("[POST]::/payments - Content check if 'refunds' exists", function () { + pm.expect(typeof jsonData.refunds !== "undefined").to.be.true; }); - - - diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js index d28f25fa46d..56ea9efbac0 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "1000" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '1000'", function() { - pm.expect(jsonData.amount).to.eql(1000); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '1000'", + function () { + pm.expect(jsonData.amount).to.eql(1000); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json index b56057fad5d..caed7818578 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js index 04650f547a2..c1dd16a4551 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '540'", function() { - pm.expect(jsonData.amount).to.eql(540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '540'", + function () { + pm.expect(jsonData.amount).to.eql(540); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json index d18aaf8befd..9fe125ce8ea 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js index bfe3137afb0..f0351c05701 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '1000'", function() { - pm.expect(jsonData.amount).to.eql(1000); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '1000'", + function () { + pm.expect(jsonData.amount).to.eql(1000); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js index 7bff0a3c12c..920a7c47f36 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '540'", function() { - pm.expect(jsonData.amount).to.eql(540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '540'", + function () { + pm.expect(jsonData.amount).to.eql(540); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/event.test.js index b9d305e4fc4..1b37dc2c7d1 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/event.test.js @@ -1,65 +1,97 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/request.json index 75e10b05085..ed87e6ed332 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/request.json @@ -94,12 +94,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/event.test.js index b94e329999b..db584da2266 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/event.test.js @@ -1,61 +1,87 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/event.test.js index b94e329999b..db584da2266 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/event.test.js @@ -1,61 +1,87 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/event.test.js index 0868d67db09..e2ddde7136f 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/event.test.js @@ -1,65 +1,95 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); // Response body should have "payment_method_data" -pm.test("[POST]::/payments - Content check if 'payment_method_data' exists", function() { - pm.expect((typeof jsonData.payment_method_data !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'payment_method_data' exists", + function () { + pm.expect(typeof jsonData.payment_method_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/request.json index f6038bfc21b..a791a4916fe 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/request.json @@ -57,12 +57,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/event.test.js index b9d305e4fc4..1b37dc2c7d1 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/event.test.js @@ -1,65 +1,97 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/request.json index 84b93dbf9a2..d5cb30f4c1b 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/request.json @@ -82,12 +82,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/event.test.js index b94e329999b..db584da2266 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/event.test.js @@ -1,61 +1,87 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/event.test.js index b94e329999b..db584da2266 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/event.test.js @@ -1,61 +1,87 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/event.test.js index d6f055f4ddd..ef2a8b7e7ac 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/event.test.js @@ -1,70 +1,105 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); // Response body should have "payment_method_data" -pm.test("[POST]::/payments - Content check if 'payment_method_data' exists", function() { - pm.expect((typeof jsonData.payment_method_data !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'payment_method_data' exists", + function () { + pm.expect(typeof jsonData.payment_method_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/request.json index 913d0b09205..27adea29d04 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/request.json @@ -57,12 +57,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/event.test.js index 1c34027de1d..f89b9b86fef 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/request.json index 5e306df7a55..5f4c58816d5 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/event.test.js index 07a9529b82e..6cb4312a60a 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Confirm/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Confirm/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Confirm/event.test.js index 85c1dc81eed..e6e0b8ac8ba 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Confirm/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "klarna" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'klarna'", function() { - pm.expect(jsonData.payment_method_type).to.eql("klarna"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'klarna'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("klarna"); + }, + ); +} // Response body should have value "stripe" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", function() { - pm.expect(jsonData.connector).to.eql("stripe"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", + function () { + pm.expect(jsonData.connector).to.eql("stripe"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Confirm/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Confirm/request.json index 43543e1f7cb..35ad6c587cc 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Confirm/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "pay_later", "payment_method_type": "klarna", "payment_experience": "redirect_to_url", @@ -34,14 +55,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Create/request.json index 64a4f8f0440..64df182d1e7 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Create/request.json @@ -47,12 +47,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Retrieve/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Retrieve/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Retrieve/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Retrieve/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario12-BNPL-klarna/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario13-BNPL-afterpay/Payments - Confirm/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario13-BNPL-afterpay/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario13-BNPL-afterpay/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario13-BNPL-afterpay/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario13-BNPL-afterpay/Payments - Confirm/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario13-BNPL-afterpay/Payments - Confirm/event.test.js index 9d71774581a..75a51d5cc80 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario13-BNPL-afterpay/Payments - Confirm/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario13-BNPL-afterpay/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "afterpay_clearpay" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'afterpay_clearpay'", function() { - pm.expect(jsonData.payment_method_type).to.eql("afterpay_clearpay"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'afterpay_clearpay'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("afterpay_clearpay"); + }, + ); +} // Response body should have value "stripe" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", function() { - pm.expect(jsonData.connector).to.eql("stripe"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", + function () { + pm.expect(jsonData.connector).to.eql("stripe"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario13-BNPL-afterpay/Payments - Confirm/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario13-BNPL-afterpay/Payments - Confirm/request.json index add4f4e624a..d8dcd689ab8 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario13-BNPL-afterpay/Payments - Confirm/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario13-BNPL-afterpay/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "pay_later", "payment_method_type": "afterpay_clearpay", "payment_experience": "redirect_to_url", @@ -33,14 +54,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario13-BNPL-afterpay/Payments - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario13-BNPL-afterpay/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario13-BNPL-afterpay/Payments - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario13-BNPL-afterpay/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario13-BNPL-afterpay/Payments - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario13-BNPL-afterpay/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario13-BNPL-afterpay/Payments - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario13-BNPL-afterpay/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario13-BNPL-afterpay/Payments - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario13-BNPL-afterpay/Payments - Create/request.json index 07b3cb1655d..5ecc4fd01c7 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario13-BNPL-afterpay/Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario13-BNPL-afterpay/Payments - Create/request.json @@ -82,12 +82,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario13-BNPL-afterpay/Payments - Retrieve/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario13-BNPL-afterpay/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario13-BNPL-afterpay/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario13-BNPL-afterpay/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario13-BNPL-afterpay/Payments - Retrieve/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario13-BNPL-afterpay/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario13-BNPL-afterpay/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario13-BNPL-afterpay/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario13-BNPL-afterpay/Payments - Retrieve/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario13-BNPL-afterpay/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario13-BNPL-afterpay/Payments - Retrieve/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario13-BNPL-afterpay/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario14-BNPL-affirm/Payments - Confirm/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario14-BNPL-affirm/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario14-BNPL-affirm/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario14-BNPL-affirm/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario14-BNPL-affirm/Payments - Confirm/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario14-BNPL-affirm/Payments - Confirm/event.test.js index 58f7b26c284..c50860153eb 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario14-BNPL-affirm/Payments - Confirm/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario14-BNPL-affirm/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "affirm" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'affirm'", function() { - pm.expect(jsonData.payment_method_type).to.eql("affirm"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'affirm'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("affirm"); + }, + ); +} // Response body should have value "stripe" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", function() { - pm.expect(jsonData.connector).to.eql("stripe"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", + function () { + pm.expect(jsonData.connector).to.eql("stripe"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario14-BNPL-affirm/Payments - Confirm/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario14-BNPL-affirm/Payments - Confirm/request.json index 6c33f8cf2e2..8cdf35d9385 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario14-BNPL-affirm/Payments - Confirm/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario14-BNPL-affirm/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "pay_later", "payment_method_type": "affirm", "payment_experience": "redirect_to_url", @@ -34,14 +55,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario14-BNPL-affirm/Payments - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario14-BNPL-affirm/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario14-BNPL-affirm/Payments - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario14-BNPL-affirm/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario14-BNPL-affirm/Payments - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario14-BNPL-affirm/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario14-BNPL-affirm/Payments - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario14-BNPL-affirm/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario14-BNPL-affirm/Payments - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario14-BNPL-affirm/Payments - Create/request.json index 765651bf169..3675475c083 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario14-BNPL-affirm/Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario14-BNPL-affirm/Payments - Create/request.json @@ -82,12 +82,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario14-BNPL-affirm/Payments - Retrieve/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario14-BNPL-affirm/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario14-BNPL-affirm/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario14-BNPL-affirm/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario14-BNPL-affirm/Payments - Retrieve/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario14-BNPL-affirm/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario14-BNPL-affirm/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario14-BNPL-affirm/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario14-BNPL-affirm/Payments - Retrieve/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario14-BNPL-affirm/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario14-BNPL-affirm/Payments - Retrieve/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario14-BNPL-affirm/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/event.test.js index 3e966f325dd..de4c44cb8e2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "ideal" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'ideal'", function() { - pm.expect(jsonData.payment_method_type).to.eql("ideal"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'ideal'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("ideal"); + }, + ); +} // Response body should have value "stripe" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", function() { - pm.expect(jsonData.connector).to.eql("stripe"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", + function () { + pm.expect(jsonData.connector).to.eql("stripe"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/request.json index 6c44ab9d4e0..10b88b51748 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_redirect", "payment_method_type": "ideal", "payment_method_data": { @@ -36,14 +57,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/request.json index 87d07a6016b..0b0c56d2660 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/event.test.js index 23db3632024..aa8d32b0cf2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "sofort" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'sofort'", function() { - pm.expect(jsonData.payment_method_type).to.eql("sofort"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'sofort'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("sofort"); + }, + ); +} // Response body should have value "stripe" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", function() { - pm.expect(jsonData.connector).to.eql("stripe"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", + function () { + pm.expect(jsonData.connector).to.eql("stripe"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/request.json index 1b3aca65658..d8c127799e0 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_redirect", "payment_method_type": "sofort", "payment_method_data": { @@ -36,14 +57,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/request.json index 87d07a6016b..0b0c56d2660 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/event.test.js index 1047304bdb0..9ac75842b5c 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "eps" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'eps'", function() { - pm.expect(jsonData.payment_method_type).to.eql("eps"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'eps'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("eps"); + }, + ); +} // Response body should have value "stripe" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", function() { - pm.expect(jsonData.connector).to.eql("stripe"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", + function () { + pm.expect(jsonData.connector).to.eql("stripe"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/request.json index 66d9d486368..451d1c7e9ae 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_redirect", "payment_method_type": "eps", "payment_method_data": { @@ -36,14 +57,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/request.json index 87d07a6016b..0b0c56d2660 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/event.test.js index 4baa4bae4ff..16173a9960d 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "giropay" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'giropay'", function() { - pm.expect(jsonData.payment_method_type).to.eql("giropay"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'giropay'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("giropay"); + }, + ); +} // Response body should have value "stripe" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", function() { - pm.expect(jsonData.connector).to.eql("stripe"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", + function () { + pm.expect(jsonData.connector).to.eql("stripe"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/request.json index 70123c3aba7..caf10ddd35d 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_redirect", "payment_method_type": "giropay", "payment_method_data": { @@ -36,14 +57,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/request.json index 87d07a6016b..0b0c56d2660 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach Copy 2/Payments - Confirm/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach Copy 2/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach Copy 2/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach Copy 2/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach Copy 2/Payments - Confirm/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach Copy 2/Payments - Confirm/event.test.js index 613ddad8289..5f6f2941136 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach Copy 2/Payments - Confirm/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach Copy 2/Payments - Confirm/event.test.js @@ -1,77 +1,114 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // Response body should have "next_action.type" -pm.test("[POST]::/payments - Content check if 'next_action.type' exists", function() { - pm.expect((typeof jsonData.next_action.type !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'next_action.type' exists", + function () { + pm.expect(typeof jsonData.next_action.type !== "undefined").to.be.true; + }, +); // Response body should have value "ach" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'ach'", function() { - pm.expect(jsonData.payment_method_type).to.eql("ach"); -})}; + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'ach'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("ach"); + }, + ); +} // Response body should have value "display_bank_transfer_information" for "next_action.type" if (jsonData?.next_action.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'display_bank_transfer_information'", function() { - pm.expect(jsonData.next_action.type).to.eql("display_bank_transfer_information"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'display_bank_transfer_information'", + function () { + pm.expect(jsonData.next_action.type).to.eql( + "display_bank_transfer_information", + ); + }, + ); +} // Response body should have value "stripe" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", function() { - pm.expect(jsonData.connector).to.eql("stripe"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", + function () { + pm.expect(jsonData.connector).to.eql("stripe"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach Copy 2/Payments - Confirm/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach Copy 2/Payments - Confirm/request.json index 2e474fe80c7..dc54c5716d4 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach Copy 2/Payments - Confirm/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach Copy 2/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_transfer", "payment_method_type": "ach", "payment_method_data": { @@ -33,14 +54,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach Copy 2/Payments - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach Copy 2/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach Copy 2/Payments - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach Copy 2/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach Copy 2/Payments - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach Copy 2/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach Copy 2/Payments - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach Copy 2/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach Copy 2/Payments - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach Copy 2/Payments - Create/request.json index ff8097a532e..7c134199443 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach Copy 2/Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach Copy 2/Payments - Create/request.json @@ -43,12 +43,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach Copy 2/Payments - Retrieve/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach Copy 2/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach Copy 2/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach Copy 2/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach Copy 2/Payments - Retrieve/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach Copy 2/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach Copy 2/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach Copy 2/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach Copy 2/Payments - Retrieve/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach Copy 2/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach Copy 2/Payments - Retrieve/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach Copy 2/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Confirm/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Confirm/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Confirm/event.test.js index 613ddad8289..5f6f2941136 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Confirm/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Confirm/event.test.js @@ -1,77 +1,114 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // Response body should have "next_action.type" -pm.test("[POST]::/payments - Content check if 'next_action.type' exists", function() { - pm.expect((typeof jsonData.next_action.type !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'next_action.type' exists", + function () { + pm.expect(typeof jsonData.next_action.type !== "undefined").to.be.true; + }, +); // Response body should have value "ach" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'ach'", function() { - pm.expect(jsonData.payment_method_type).to.eql("ach"); -})}; + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'ach'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("ach"); + }, + ); +} // Response body should have value "display_bank_transfer_information" for "next_action.type" if (jsonData?.next_action.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'display_bank_transfer_information'", function() { - pm.expect(jsonData.next_action.type).to.eql("display_bank_transfer_information"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'display_bank_transfer_information'", + function () { + pm.expect(jsonData.next_action.type).to.eql( + "display_bank_transfer_information", + ); + }, + ); +} // Response body should have value "stripe" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", function() { - pm.expect(jsonData.connector).to.eql("stripe"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", + function () { + pm.expect(jsonData.connector).to.eql("stripe"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Confirm/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Confirm/request.json index 2e474fe80c7..dc54c5716d4 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Confirm/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_transfer", "payment_method_type": "ach", "payment_method_data": { @@ -33,14 +54,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Create/request.json index ff8097a532e..7c134199443 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Create/request.json @@ -43,12 +43,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Retrieve/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Retrieve/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Retrieve/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Retrieve/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js index bb50904fd89..f92fba3d044 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js index 5698484c741..55dc35b9128 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json index c127e87b06d..3e1f1231ff8 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js index 03ccae1adb0..aced67dbfb7 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js index 5d9e5785e6e..6d812bc75fe 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id/confirm - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id/confirm - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json index bb2b0cdc1b0..402aa25fef8 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "card", "payment_method_data": { "card": { @@ -32,14 +53,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json index b41aa02e5d0..2f7bdae8a6a 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json @@ -67,12 +67,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js index 03ccae1adb0..aced67dbfb7 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js index 1e2875ec9f6..2d7dbc507fb 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js @@ -1,68 +1,94 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/capture - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); - -// Validate if response has JSON Body +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.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} - +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]:://payments/:id/capture - 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 "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "6000" for "amount_received" if (jsonData?.amount_received) { -pm.test("[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", function() { - pm.expect(jsonData.amount_received).to.eql(6000); -})}; - - - - + pm.test( + "[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", + function () { + pm.expect(jsonData.amount_received).to.eql(6000); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json index 8975575ca40..9fe257ed85e 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js index b0e69cad2c2..d683186aa00 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json index f1ff4cb5692..4deef11deb5 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js index 1a0942b5f88..5c7196baa4f 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js index 9632bd19048..dcf3f191643 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js @@ -1,43 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/cancel - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type 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(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "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"); -})}; - - - + pm.test( + "[POST]::/payments/:id/cancel - Content check if value for 'status' matches 'cancelled'", + function () { + pm.expect(jsonData.status).to.eql("cancelled"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js index b0e69cad2c2..d683186aa00 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json index f1ff4cb5692..4deef11deb5 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js index f4e0ab9b2aa..5e52e13a59e 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "cancelled" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'", function() { - pm.expect(jsonData.status).to.eql("cancelled"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'", + function () { + pm.expect(jsonData.status).to.eql("cancelled"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario6-Create 3DS payment/.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario6-Create 3DS payment/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario6-Create 3DS payment/.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario6-Create 3DS payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js index 1388cde7c89..39cbb3ee90e 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js @@ -1,54 +1,80 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", function() { - pm.expect(jsonData.status).to.eql("requires_customer_action"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", + function () { + pm.expect(jsonData.status).to.eql("requires_customer_action"); + }, + ); +} // Response body should have "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; -}); +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; + }, +); diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json index 475c18a9c92..730d42ebac9 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js index 08ad2d6a233..02ab01502c1 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + 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"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js index edf87c9ccdf..1fa0afa6402 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js @@ -1,57 +1,83 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments/:id/confirm - Content check if 'next_action.redirect_to_url' exists", function() { - pm.expect((typeof jsonData.next_action.redirect_to_url !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments/:id/confirm - Content check if 'next_action.redirect_to_url' exists", + function () { + pm.expect(typeof jsonData.next_action.redirect_to_url !== "undefined").to.be + .true; + }, +); diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js index 5698484c741..55dc35b9128 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json index 1153185f62c..72c0cf1fd9b 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json index 0d6523e82ba..f58c425653c 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js index 1c34027de1d..f89b9b86fef 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json index 5e306df7a55..5f4c58816d5 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js index 07a9529b82e..6cb4312a60a 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/API Key - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/API Key - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/API Key - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/API Key - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/API Key - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/API Key - Create/event.test.js index bc42e83a761..4e27c5a5025 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/API Key - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/API Key - Create/event.test.js @@ -1,32 +1,46 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/api_keys/:merchant_id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/api_keys/:merchant_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/api_keys/:merchant_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; try { jsonData = pm.response.json(); -} catch(e) { -} +} catch (e) {} // pm.collectionVariables - Set api_key_id as variable for jsonData.key_id if (jsonData?.key_id) { - pm.collectionVariables.set("api_key_id", jsonData.key_id); - console.log("- use {{api_key_id}} as collection variable for value", jsonData.key_id); + pm.collectionVariables.set("api_key_id", jsonData.key_id); + console.log( + "- use {{api_key_id}} as collection variable for value", + jsonData.key_id, + ); } else { - console.log('INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value", jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/API Key - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/API Key - Create/request.json index 29c2490d1bc..2210d14da0e 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/API Key - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/API Key - Create/request.json @@ -35,13 +35,8 @@ }, "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Merchant Account - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Merchant Account - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Merchant Account - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Merchant Account - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Merchant Account - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Merchant Account - Create/event.test.js index 538b393c084..7de0d5beb31 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Merchant Account - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Merchant Account - Create/event.test.js @@ -1,37 +1,56 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - 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]::/accounts - 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", + ); }); // 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 merchant_id as variable for jsonData.merchant_id if (jsonData?.merchant_id) { - pm.collectionVariables.set("merchant_id", jsonData.merchant_id); - console.log("- use {{merchant_id}} as collection variable for value",jsonData.merchant_id); + pm.collectionVariables.set("merchant_id", jsonData.merchant_id); + console.log( + "- use {{merchant_id}} as collection variable for value", + jsonData.merchant_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value",jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} // pm.collectionVariables - Set publishable_key as variable for jsonData.publishable_key if (jsonData?.publishable_key) { - pm.collectionVariables.set("publishable_key", jsonData.publishable_key); - console.log("- use {{publishable_key}} as collection variable for value",jsonData.publishable_key); + pm.collectionVariables.set("publishable_key", jsonData.publishable_key); + console.log( + "- use {{publishable_key}} as collection variable for value", + jsonData.publishable_key, + ); } else { - console.log('INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Merchant Account - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Merchant Account - Create/request.json index 8037d7d50da..f6761137a17 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Merchant Account - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Merchant Account - Create/request.json @@ -68,7 +68,7 @@ "payment_created_enabled": true, "payment_succeeded_enabled": true, "payment_failed_enabled": true - }, + }, "sub_merchants_enabled": false, "metadata": { "city": "NY", @@ -78,12 +78,8 @@ }, "url": { "raw": "{{baseUrl}}/accounts", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "accounts" - ] + "host": ["{{baseUrl}}"], + "path": ["accounts"] }, "description": "Create a new account for a merchant. The merchant could be a seller or retailer or client who likes to receive and send payments." } diff --git a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payment Connector - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payment Connector - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payment Connector - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payment Connector - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payment Connector - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payment Connector - Create/event.test.js index b831702461e..88e92d8d84a 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payment Connector - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payment Connector - Create/event.test.js @@ -1,21 +1,39 @@ -// Validate status 2xx -pm.test("[POST]::/account/:account_id/connectors - 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.be.success; + }, +); // Validate if response header has matching content-type -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"); -}); +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){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id if (jsonData?.merchant_connector_id) { - pm.collectionVariables.set("merchant_connector_id", jsonData.merchant_connector_id); - console.log("- use {{merchant_connector_id}} as collection variable for value",jsonData.merchant_connector_id); + pm.collectionVariables.set( + "merchant_connector_id", + jsonData.merchant_connector_id, + ); + console.log( + "- use {{merchant_connector_id}} as collection variable for value", + jsonData.merchant_connector_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payment Connector - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payment Connector - Create/request.json index ad6f4c717bb..7eab2000165 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payment Connector - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payment Connector - Create/request.json @@ -257,10 +257,7 @@ { "type": "CARD", "parameters": { - "allowed_auth_methods": [ - "PAN_ONLY", - "CRYPTOGRAM_3DS" - ], + "allowed_auth_methods": ["PAN_ONLY", "CRYPTOGRAM_3DS"], "allowed_card_networks": [ "AMEX", "DISCOVER", @@ -294,15 +291,8 @@ }, "payment_request_data": { "label": "applepay pvt.ltd", - "supported_networks": [ - "visa", - "masterCard", - "amex", - "discover" - ], - "merchant_capabilities": [ - "supports3DS" - ] + "supported_networks": ["visa", "masterCard", "amex", "discover"], + "merchant_capabilities": ["supports3DS"] } } } @@ -310,14 +300,8 @@ }, "url": { "raw": "{{baseUrl}}/account/:account_id/connectors", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payments - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payments - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payments - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payments - Create/event.test.js index 62142d52dca..a6947db94c0 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payments - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payments - Create/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payments - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payments - Create/request.json index ca9740f5273..2225c6096e3 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payments - Retrieve/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payments - Retrieve/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payments - Retrieve/event.test.js index 4dd072b2222..d0a02af7436 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payments - Retrieve/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // 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.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payments - Retrieve/request.json b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payments - Retrieve/request.json index c71774083b2..ef0b213739d 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payments - Retrieve/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Refunds - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Refunds - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Refunds - Create/event.test.js index c862e8e68a7..dbc930608cb 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Refunds - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Refunds - Create/event.test.js @@ -1,21 +1,30 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Refunds - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Refunds - Create/request.json index 4dbca4d01f2..0c13281ee15 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Refunds - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Refunds - Retrieve/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Refunds - Retrieve/event.test.js index b1e1f12ba50..bbd8e544e2c 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Refunds - Retrieve/event.test.js @@ -1,22 +1,30 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); - // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Refunds - Retrieve/request.json b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Refunds - Retrieve/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/QuickStart/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js index 2a63db39e24..c9a72ccbadc 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js @@ -1,54 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector'", function() { - pm.expect(jsonData.error.type).to.eql("connector"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector'", + function () { + pm.expect(jsonData.error.type).to.eql("connector"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json index 41ac0c553fb..02e431466aa 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js index 5176794254a..c9a72ccbadc 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js @@ -1,56 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); - // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector'", function() { - pm.expect(jsonData.error.type).to.eql("connector"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector'", + function () { + pm.expect(jsonData.error.type).to.eql("connector"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json index 29aca608a8a..52c73bea743 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js index 0e6401222ff..52680771c31 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js @@ -1,55 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector_error'", function() { - pm.expect(jsonData.error.type).to.eql("connector_error"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'", + function () { + pm.expect(jsonData.error.type).to.eql("connector_error"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json index 0a16b975817..c7ad4cb2749 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json @@ -75,12 +75,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js index 630c4f25cae..3976f7f496a 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js @@ -1,55 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector'", function() { - pm.expect(jsonData.error.type).to.eql("connector"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector'", + function () { + pm.expect(jsonData.error.type).to.eql("connector"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json index 068426b0f35..9fa8e3bbe12 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json index 90b19864ee1..f2bee31ef66 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Confirm" - ] + "childrenOrder": ["Payments - Create", "Payments - Confirm"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js index 1e8ba8cc3a6..e8d6b2216c5 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js @@ -1,58 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); -}); - - +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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json index b41aa02e5d0..2f7bdae8a6a 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json @@ -67,12 +67,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js index c3e7afc6760..46bf201d1ce 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js @@ -1,59 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json index 766a8330d6e..6c934a9132c 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js index b0e69cad2c2..d683186aa00 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json index f1ff4cb5692..4deef11deb5 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js index 6b03e0b9ee6..34beacf976b 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" 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"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json index cafd3a6808e..6df7c0a1943 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Capture" - ] + "childrenOrder": ["Payments - Create", "Payments - Capture"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js index c3e7afc6760..46bf201d1ce 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js @@ -1,59 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json index 766a8330d6e..6c934a9132c 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json index 0d6523e82ba..f58c425653c 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json index afba25ab6d6..5ff1a7cb4e8 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Cancel" - ] + "childrenOrder": ["Payments - Create", "Payments - Cancel"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js index d7879c70d87..0f869a6dfb8 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js @@ -1,50 +1,69 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/cancel - Status code is 4xx", function () { - pm.response.to.be.error; + 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/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/cancel - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; - - - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json index 0d6523e82ba..f58c425653c 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/event.test.js index f125e2a7885..46bf201d1ce 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/event.test.js @@ -1,61 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + 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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/request.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/request.json index 14ac5f8bb4a..2b31ac6d784 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/event.test.js index c289d7d25fb..39cbb3ee90e 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/event.test.js @@ -1,55 +1,80 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", function() { - pm.expect(jsonData.status).to.eql("requires_customer_action"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", + function () { + pm.expect(jsonData.status).to.eql("requires_customer_action"); + }, + ); +} // Response body should have "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; -}); - +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; + }, +); diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json index 69d9a41d5ab..9c2ddbffb6d 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/event.test.js index 1f59e2b00ac..02ab01502c1 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/request.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json index 0d6523e82ba..f58c425653c 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js index 9537daf6187..776dbd70712 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js @@ -1,33 +1,48 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/refunds - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + 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; -}); +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"); -})}; - + 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"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json index 326319e8fdf..10de81bed08 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js index 65232a76373..55dc35b9128 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; - - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json index c127e87b06d..3e1f1231ff8 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js index 42bf3e0ac45..fdb8a946f3d 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js index 30888b5cc0c..d3c4451760d 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js @@ -1,32 +1,48 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/refunds - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + 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; -}); +pm.test( + "[POST]::/payments/:id/confirm - Content check if 'error' exists", + function () { + pm.expect(typeof jsonData.error !== "undefined").to.be.true; + }, +); // Response body should have value "invalid_request" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; + pm.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"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json index d18aaf8befd..9fe125ce8ea 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/event.test.js index b9d305e4fc4..1b37dc2c7d1 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/event.test.js @@ -1,65 +1,97 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/request.json index 75e10b05085..ed87e6ed332 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/request.json @@ -94,12 +94,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/event.test.js index b94e329999b..db584da2266 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/event.test.js @@ -1,61 +1,87 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/request.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/event.test.js b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/event.test.js index 22617f827cf..e862404c2b2 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/event.test.js @@ -1,56 +1,79 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/confirm - Content check if 'error' exists", + function () { + pm.expect(typeof jsonData.error !== "undefined").to.be.true; + }, +); // Response body should have value "invalid_request" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; - - + pm.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"); + }, + ); +} diff --git a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json index 6161bc624d8..299eb1685b7 100644 --- a/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/Hackathon/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json @@ -69,12 +69,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Health check/.meta.json b/postman/collection-dir/hyperswitch/Health check/.meta.json index 66ee7e50cab..579f9fd541c 100644 --- a/postman/collection-dir/hyperswitch/Health check/.meta.json +++ b/postman/collection-dir/hyperswitch/Health check/.meta.json @@ -1,5 +1,3 @@ { - "childrenOrder": [ - "New Request" - ] + "childrenOrder": ["New Request"] } diff --git a/postman/collection-dir/hyperswitch/Health check/New Request/.event.meta.json b/postman/collection-dir/hyperswitch/Health check/New Request/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Health check/New Request/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Health check/New Request/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Health check/New Request/event.test.js b/postman/collection-dir/hyperswitch/Health check/New Request/event.test.js index 325a8c8a479..b490b8be090 100644 --- a/postman/collection-dir/hyperswitch/Health check/New Request/event.test.js +++ b/postman/collection-dir/hyperswitch/Health check/New Request/event.test.js @@ -1,4 +1,4 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - Status code is 2xx", function () { - pm.response.to.be.success; -}); \ No newline at end of file + pm.response.to.be.success; +}); diff --git a/postman/collection-dir/hyperswitch/Health check/New Request/request.json b/postman/collection-dir/hyperswitch/Health check/New Request/request.json index 4cc8d4b1a96..e40e9396178 100644 --- a/postman/collection-dir/hyperswitch/Health check/New Request/request.json +++ b/postman/collection-dir/hyperswitch/Health check/New Request/request.json @@ -10,11 +10,7 @@ ], "url": { "raw": "{{baseUrl}}/health", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "health" - ] + "host": ["{{baseUrl}}"], + "path": ["health"] } } diff --git a/postman/collection-dir/hyperswitch/MerchantAccounts/Merchant Account - Create/.event.meta.json b/postman/collection-dir/hyperswitch/MerchantAccounts/Merchant Account - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/MerchantAccounts/Merchant Account - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/MerchantAccounts/Merchant Account - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/MerchantAccounts/Merchant Account - Create/event.test.js b/postman/collection-dir/hyperswitch/MerchantAccounts/Merchant Account - Create/event.test.js index 538b393c084..7de0d5beb31 100644 --- a/postman/collection-dir/hyperswitch/MerchantAccounts/Merchant Account - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/MerchantAccounts/Merchant Account - Create/event.test.js @@ -1,37 +1,56 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - 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]::/accounts - 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", + ); }); // 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 merchant_id as variable for jsonData.merchant_id if (jsonData?.merchant_id) { - pm.collectionVariables.set("merchant_id", jsonData.merchant_id); - console.log("- use {{merchant_id}} as collection variable for value",jsonData.merchant_id); + pm.collectionVariables.set("merchant_id", jsonData.merchant_id); + console.log( + "- use {{merchant_id}} as collection variable for value", + jsonData.merchant_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value",jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} // pm.collectionVariables - Set publishable_key as variable for jsonData.publishable_key if (jsonData?.publishable_key) { - pm.collectionVariables.set("publishable_key", jsonData.publishable_key); - console.log("- use {{publishable_key}} as collection variable for value",jsonData.publishable_key); + pm.collectionVariables.set("publishable_key", jsonData.publishable_key); + console.log( + "- use {{publishable_key}} as collection variable for value", + jsonData.publishable_key, + ); } else { - console.log('INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/MerchantAccounts/Merchant Account - Create/request.json b/postman/collection-dir/hyperswitch/MerchantAccounts/Merchant Account - Create/request.json index b035b29e2e7..be3e1144ef4 100644 --- a/postman/collection-dir/hyperswitch/MerchantAccounts/Merchant Account - Create/request.json +++ b/postman/collection-dir/hyperswitch/MerchantAccounts/Merchant Account - Create/request.json @@ -78,12 +78,8 @@ }, "url": { "raw": "{{baseUrl}}/accounts", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "accounts" - ] + "host": ["{{baseUrl}}"], + "path": ["accounts"] }, "description": "Create a new account for a merchant. The merchant could be a seller or retailer or client who likes to receive and send payments." } diff --git a/postman/collection-dir/hyperswitch/MerchantAccounts/Merchant Account - Retrieve/.event.meta.json b/postman/collection-dir/hyperswitch/MerchantAccounts/Merchant Account - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/MerchantAccounts/Merchant Account - Retrieve/.event.meta.json +++ b/postman/collection-dir/hyperswitch/MerchantAccounts/Merchant Account - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/MerchantAccounts/Merchant Account - Retrieve/event.test.js b/postman/collection-dir/hyperswitch/MerchantAccounts/Merchant Account - Retrieve/event.test.js index 39ee1a1d9de..7694684a177 100644 --- a/postman/collection-dir/hyperswitch/MerchantAccounts/Merchant Account - Retrieve/event.test.js +++ b/postman/collection-dir/hyperswitch/MerchantAccounts/Merchant Account - Retrieve/event.test.js @@ -1,29 +1,43 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/accounts/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/accounts/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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 api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value",jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} // pm.collectionVariables - Set publishable_key as variable for jsonData.publishable_key if (jsonData?.publishable_key) { - pm.collectionVariables.set("publishable_key", jsonData.publishable_key); - console.log("- use {{publishable_key}} as collection variable for value",jsonData.publishable_key); + pm.collectionVariables.set("publishable_key", jsonData.publishable_key); + console.log( + "- use {{publishable_key}} as collection variable for value", + jsonData.publishable_key, + ); } else { - console.log('INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/MerchantAccounts/Merchant Account - Retrieve/request.json b/postman/collection-dir/hyperswitch/MerchantAccounts/Merchant Account - Retrieve/request.json index 536ad17268f..bf4c8467c28 100644 --- a/postman/collection-dir/hyperswitch/MerchantAccounts/Merchant Account - Retrieve/request.json +++ b/postman/collection-dir/hyperswitch/MerchantAccounts/Merchant Account - Retrieve/request.json @@ -28,13 +28,8 @@ ], "url": { "raw": "{{baseUrl}}/accounts/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "accounts", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["accounts", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/MerchantAccounts/Merchant Account - Update/.event.meta.json b/postman/collection-dir/hyperswitch/MerchantAccounts/Merchant Account - Update/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/MerchantAccounts/Merchant Account - Update/.event.meta.json +++ b/postman/collection-dir/hyperswitch/MerchantAccounts/Merchant Account - Update/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/MerchantAccounts/Merchant Account - Update/event.test.js b/postman/collection-dir/hyperswitch/MerchantAccounts/Merchant Account - Update/event.test.js index e783ad66b4a..ecd9d862b3f 100644 --- a/postman/collection-dir/hyperswitch/MerchantAccounts/Merchant Account - Update/event.test.js +++ b/postman/collection-dir/hyperswitch/MerchantAccounts/Merchant Account - Update/event.test.js @@ -1,31 +1,46 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/accounts/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/accounts/:id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value",jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} // pm.collectionVariables - Set publishable_key as variable for jsonData.publishable_key if (jsonData?.publishable_key) { - pm.collectionVariables.set("publishable_key", jsonData.publishable_key); - console.log("- use {{publishable_key}} as collection variable for value",jsonData.publishable_key); + pm.collectionVariables.set("publishable_key", jsonData.publishable_key); + console.log( + "- use {{publishable_key}} as collection variable for value", + jsonData.publishable_key, + ); } else { - console.log('INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.'); -}; - - + console.log( + "INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/MerchantAccounts/Merchant Account - Update/request.json b/postman/collection-dir/hyperswitch/MerchantAccounts/Merchant Account - Update/request.json index ed52507e58b..93fb2705fb3 100644 --- a/postman/collection-dir/hyperswitch/MerchantAccounts/Merchant Account - Update/request.json +++ b/postman/collection-dir/hyperswitch/MerchantAccounts/Merchant Account - Update/request.json @@ -69,7 +69,7 @@ "payment_succeeded_enabled": true, "payment_failed_enabled": true }, - + "sub_merchants_enabled": false, "parent_merchant_id": "xkkdf909012sdjki2dkh5sdf", "metadata": { @@ -80,13 +80,8 @@ }, "url": { "raw": "{{baseUrl}}/accounts/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "accounts", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["accounts", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/PaymentConnectors/List Connectors by MID/.event.meta.json b/postman/collection-dir/hyperswitch/PaymentConnectors/List Connectors by MID/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/PaymentConnectors/List Connectors by MID/.event.meta.json +++ b/postman/collection-dir/hyperswitch/PaymentConnectors/List Connectors by MID/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/PaymentConnectors/List Connectors by MID/event.test.js b/postman/collection-dir/hyperswitch/PaymentConnectors/List Connectors by MID/event.test.js index f9f4f482ca1..c685ff160bf 100644 --- a/postman/collection-dir/hyperswitch/PaymentConnectors/List Connectors by MID/event.test.js +++ b/postman/collection-dir/hyperswitch/PaymentConnectors/List Connectors by MID/event.test.js @@ -1,9 +1,17 @@ -// Validate status 2xx -pm.test("[GET]::/account/:account_id/connectors - Status code is 2xx", function () { - pm.response.to.be.success; -}); +// Validate status 2xx +pm.test( + "[GET]::/account/:account_id/connectors - Status code is 2xx", + function () { + pm.response.to.be.success; + }, +); // Validate if response header has matching content-type -pm.test("[GET]::/account/:account_id/connectors - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[GET]::/account/:account_id/connectors - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); diff --git a/postman/collection-dir/hyperswitch/PaymentConnectors/List Connectors by MID/request.json b/postman/collection-dir/hyperswitch/PaymentConnectors/List Connectors by MID/request.json index 89aa4e59406..81d0ea5ef1e 100644 --- a/postman/collection-dir/hyperswitch/PaymentConnectors/List Connectors by MID/request.json +++ b/postman/collection-dir/hyperswitch/PaymentConnectors/List Connectors by MID/request.json @@ -23,14 +23,8 @@ ], "url": { "raw": "{{baseUrl}}/account/:account_id/connectors", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/hyperswitch/PaymentConnectors/Merchant Account - Delete/.event.meta.json b/postman/collection-dir/hyperswitch/PaymentConnectors/Merchant Account - Delete/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/PaymentConnectors/Merchant Account - Delete/.event.meta.json +++ b/postman/collection-dir/hyperswitch/PaymentConnectors/Merchant Account - Delete/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/PaymentConnectors/Merchant Account - Delete/event.test.js b/postman/collection-dir/hyperswitch/PaymentConnectors/Merchant Account - Delete/event.test.js index 2432e148b84..596c14630df 100644 --- a/postman/collection-dir/hyperswitch/PaymentConnectors/Merchant Account - Delete/event.test.js +++ b/postman/collection-dir/hyperswitch/PaymentConnectors/Merchant Account - Delete/event.test.js @@ -1,17 +1,42 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[DELETE]::/accounts/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[DELETE]::/accounts/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[DELETE]::/accounts/:id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Response Validation -const schema = {"type":"object","description":"Merchant Account","required":["merchant_id","deleted"],"properties":{"merchant_id":{"type":"string","description":"The identifier for the MerchantAccount object.","maxLength":255,"example":"y3oqhf46pyzuxjbcn2giaqnb44"},"deleted":{"type":"boolean","description":"Indicates the deletion status of the Merchant Account object.","example":true}}} +const schema = { + type: "object", + description: "Merchant Account", + required: ["merchant_id", "deleted"], + properties: { + merchant_id: { + type: "string", + description: "The identifier for the MerchantAccount object.", + maxLength: 255, + example: "y3oqhf46pyzuxjbcn2giaqnb44", + }, + deleted: { + type: "boolean", + description: + "Indicates the deletion status of the Merchant Account object.", + example: true, + }, + }, +}; -// Validate if response matches JSON schema -pm.test("[DELETE]::/accounts/:id - Schema is valid", function() { - pm.response.to.have.jsonSchema(schema,{unknownFormats: ["int32", "int64", "float", "double"]}); +// Validate if response matches JSON schema +pm.test("[DELETE]::/accounts/:id - Schema is valid", function () { + pm.response.to.have.jsonSchema(schema, { + unknownFormats: ["int32", "int64", "float", "double"], + }); }); diff --git a/postman/collection-dir/hyperswitch/PaymentConnectors/Merchant Account - Delete/request.json b/postman/collection-dir/hyperswitch/PaymentConnectors/Merchant Account - Delete/request.json index 17d56a57ea4..a07ea6f0868 100644 --- a/postman/collection-dir/hyperswitch/PaymentConnectors/Merchant Account - Delete/request.json +++ b/postman/collection-dir/hyperswitch/PaymentConnectors/Merchant Account - Delete/request.json @@ -28,13 +28,8 @@ ], "url": { "raw": "{{baseUrl}}/accounts/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "accounts", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["accounts", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Create/.event.meta.json b/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Create/event.test.js b/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Create/event.test.js index 830433e758f..aa1bc4845b7 100644 --- a/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Create/event.test.js @@ -1,21 +1,39 @@ -// Validate status 2xx -pm.test("[POST]::/accounts/:account_id/connectors - Status code is 2xx", function () { - pm.response.to.be.success; -}); +// Validate status 2xx +pm.test( + "[POST]::/accounts/:account_id/connectors - Status code is 2xx", + function () { + pm.response.to.be.success; + }, +); // Validate if response header has matching content-type -pm.test("[POST]::/accounts/:account_id/connectors - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/accounts/: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){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id if (jsonData?.merchant_connector_id) { - pm.collectionVariables.set("merchant_connector_id", jsonData.merchant_connector_id); - console.log("- use {{merchant_connector_id}} as collection variable for value",jsonData.merchant_connector_id); + pm.collectionVariables.set( + "merchant_connector_id", + jsonData.merchant_connector_id, + ); + console.log( + "- use {{merchant_connector_id}} as collection variable for value", + jsonData.merchant_connector_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Create/request.json b/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Create/request.json index 0b3db76a09d..b8531ac7ebd 100644 --- a/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Create/request.json +++ b/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Create/request.json @@ -52,10 +52,7 @@ "payment_method_types": [ { "payment_method_type": "credit", - "card_networks": [ - "Visa", - "Mastercard" - ], + "card_networks": ["Visa", "Mastercard"], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, @@ -63,10 +60,7 @@ }, { "payment_method_type": "debit", - "card_networks": [ - "Visa", - "Mastercard" - ], + "card_networks": ["Visa", "Mastercard"], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, @@ -112,14 +106,8 @@ }, "url": { "raw": "{{baseUrl}}/account/:account_id/connectors", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Delete/.event.meta.json b/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Delete/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Delete/.event.meta.json +++ b/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Delete/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Delete/event.test.js b/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Delete/event.test.js index 9c3be62cfa9..a8f03ce767f 100644 --- a/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Delete/event.test.js +++ b/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Delete/event.test.js @@ -1,21 +1,39 @@ -// Validate status 2xx -pm.test("[DELETE]::/account/:account_id/connectors/:connector_id - Status code is 2xx", function () { - pm.response.to.be.success; -}); +// Validate status 2xx +pm.test( + "[DELETE]::/account/:account_id/connectors/:connector_id - Status code is 2xx", + function () { + pm.response.to.be.success; + }, +); // Validate if response header has matching content-type -pm.test("[DELETE]::/account/:account_id/connectors/:connector_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[DELETE]::/account/:account_id/connectors/:connector_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id if (jsonData?.merchant_connector_id) { - pm.collectionVariables.set("merchant_connector_id", jsonData.merchant_connector_id); - console.log("- use {{merchant_connector_id}} as collection variable for value",jsonData.merchant_connector_id); + pm.collectionVariables.set( + "merchant_connector_id", + jsonData.merchant_connector_id, + ); + console.log( + "- use {{merchant_connector_id}} as collection variable for value", + jsonData.merchant_connector_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Delete/request.json b/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Delete/request.json index 6d7939d6762..9fbf515fcce 100644 --- a/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Delete/request.json +++ b/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Delete/request.json @@ -28,15 +28,8 @@ ], "url": { "raw": "{{baseUrl}}/account/:account_id/connectors/:connector_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors", - ":connector_id" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors", ":connector_id"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Retrieve/.event.meta.json b/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Retrieve/.event.meta.json +++ b/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Retrieve/event.test.js b/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Retrieve/event.test.js index 2928af62175..8125c4e1bb7 100644 --- a/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Retrieve/event.test.js +++ b/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Retrieve/event.test.js @@ -1,21 +1,39 @@ -// Validate status 2xx -pm.test("[GET]::/accounts/:account_id/connectors/:connector_id - Status code is 2xx", function () { - pm.response.to.be.success; -}); +// Validate status 2xx +pm.test( + "[GET]::/accounts/:account_id/connectors/:connector_id - Status code is 2xx", + function () { + pm.response.to.be.success; + }, +); // Validate if response header has matching content-type -pm.test("[GET]::/accounts/:account_id/connectors/:connector_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[GET]::/accounts/:account_id/connectors/:connector_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id if (jsonData?.merchant_connector_id) { - pm.collectionVariables.set("merchant_connector_id", jsonData.merchant_connector_id); - console.log("- use {{merchant_connector_id}} as collection variable for value",jsonData.merchant_connector_id); + pm.collectionVariables.set( + "merchant_connector_id", + jsonData.merchant_connector_id, + ); + console.log( + "- use {{merchant_connector_id}} as collection variable for value", + jsonData.merchant_connector_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Retrieve/request.json b/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Retrieve/request.json index b87e6538125..7536380bcf0 100644 --- a/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Retrieve/request.json +++ b/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Retrieve/request.json @@ -28,15 +28,8 @@ ], "url": { "raw": "{{baseUrl}}/account/:account_id/connectors/:connector_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors", - ":connector_id" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors", ":connector_id"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Update/.event.meta.json b/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Update/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Update/.event.meta.json +++ b/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Update/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Update/event.test.js b/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Update/event.test.js index e589f0df54c..d7259b6a840 100644 --- a/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Update/event.test.js +++ b/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Update/event.test.js @@ -1,21 +1,39 @@ -// Validate status 2xx -pm.test("[POST]::/account/:account_id/connectors/:connector_id - Status code is 2xx", function () { - pm.response.to.be.success; -}); +// Validate status 2xx +pm.test( + "[POST]::/account/:account_id/connectors/:connector_id - Status code is 2xx", + function () { + pm.response.to.be.success; + }, +); // Validate if response header has matching content-type -pm.test("[POST]::/account/:account_id/connectors/:connector_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/connectors/:connector_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id if (jsonData?.merchant_connector_id) { - pm.collectionVariables.set("merchant_connector_id", jsonData.merchant_connector_id); - console.log("- use {{merchant_connector_id}} as collection variable for value",jsonData.merchant_connector_id); + pm.collectionVariables.set( + "merchant_connector_id", + jsonData.merchant_connector_id, + ); + console.log( + "- use {{merchant_connector_id}} as collection variable for value", + jsonData.merchant_connector_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Update/request.json b/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Update/request.json index dcde75af55e..1d77181f262 100644 --- a/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Update/request.json +++ b/postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Update/request.json @@ -51,10 +51,7 @@ "payment_method_types": [ { "payment_method_type": "credit", - "card_networks": [ - "Visa", - "Mastercard" - ], + "card_networks": ["Visa", "Mastercard"], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, @@ -62,10 +59,7 @@ }, { "payment_method_type": "debit", - "card_networks": [ - "Visa", - "Mastercard" - ], + "card_networks": ["Visa", "Mastercard"], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, @@ -111,15 +105,8 @@ }, "url": { "raw": "{{baseUrl}}/account/:account_id/connectors/:connector_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors", - ":connector_id" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors", ":connector_id"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/hyperswitch/PaymentMethods/Delete PaymentMethods/.event.meta.json b/postman/collection-dir/hyperswitch/PaymentMethods/Delete PaymentMethods/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/PaymentMethods/Delete PaymentMethods/.event.meta.json +++ b/postman/collection-dir/hyperswitch/PaymentMethods/Delete PaymentMethods/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/PaymentMethods/Delete PaymentMethods/event.test.js b/postman/collection-dir/hyperswitch/PaymentMethods/Delete PaymentMethods/event.test.js index 5c3b14bf91d..07d475c1ddb 100644 --- a/postman/collection-dir/hyperswitch/PaymentMethods/Delete PaymentMethods/event.test.js +++ b/postman/collection-dir/hyperswitch/PaymentMethods/Delete PaymentMethods/event.test.js @@ -1,10 +1,17 @@ -// Validate status 2xx -pm.test("[POST]::/payment_methods/:id/detach - Status code is 2xx", function () { - pm.response.to.be.success; -}); +// Validate status 2xx +pm.test( + "[POST]::/payment_methods/:id/detach - Status code is 2xx", + function () { + pm.response.to.be.success; + }, +); // Validate if response header has matching content-type -pm.test("[POST]::/payment_methods/:id/detach - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); - +pm.test( + "[POST]::/payment_methods/:id/detach - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); diff --git a/postman/collection-dir/hyperswitch/PaymentMethods/Delete PaymentMethods/request.json b/postman/collection-dir/hyperswitch/PaymentMethods/Delete PaymentMethods/request.json index b43f0ef29ac..b8ce04552a8 100644 --- a/postman/collection-dir/hyperswitch/PaymentMethods/Delete PaymentMethods/request.json +++ b/postman/collection-dir/hyperswitch/PaymentMethods/Delete PaymentMethods/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payment_methods/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payment_methods", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payment_methods", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/PaymentMethods/List payment methods for a Customer/.event.meta.json b/postman/collection-dir/hyperswitch/PaymentMethods/List payment methods for a Customer/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/PaymentMethods/List payment methods for a Customer/.event.meta.json +++ b/postman/collection-dir/hyperswitch/PaymentMethods/List payment methods for a Customer/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/PaymentMethods/List payment methods for a Customer/event.test.js b/postman/collection-dir/hyperswitch/PaymentMethods/List payment methods for a Customer/event.test.js index f844efad42c..43ee143ef56 100644 --- a/postman/collection-dir/hyperswitch/PaymentMethods/List payment methods for a Customer/event.test.js +++ b/postman/collection-dir/hyperswitch/PaymentMethods/List payment methods for a Customer/event.test.js @@ -1,20 +1,38 @@ -// Validate status 2xx -pm.test("[GET]::/payment_methods/:customer_id - Status code is 2xx", function () { - pm.response.to.be.success; -}); +// Validate status 2xx +pm.test( + "[GET]::/payment_methods/: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"); -}); +pm.test( + "[GET]::/payment_methods/:customer_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} if (jsonData?.customer_payment_methods[0]?.payment_token) { - pm.collectionVariables.set("payment_token", jsonData.customer_payment_methods[0].payment_token); - console.log("- use {{payment_token}} as collection variable for value", jsonData.customer_payment_methods[0].payment_token); + pm.collectionVariables.set( + "payment_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.'); -} \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{payment_token}}, as jsonData.customer_payment_methods[0].payment_token is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/PaymentMethods/List payment methods for a Customer/request.json b/postman/collection-dir/hyperswitch/PaymentMethods/List payment methods for a Customer/request.json index 40843aac2a4..6b598069886 100644 --- a/postman/collection-dir/hyperswitch/PaymentMethods/List payment methods for a Customer/request.json +++ b/postman/collection-dir/hyperswitch/PaymentMethods/List payment methods for a Customer/request.json @@ -8,14 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/customers/:customer_id/payment_methods", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "customers", - ":customer_id", - "payment_methods" - ], + "host": ["{{baseUrl}}"], + "path": ["customers", ":customer_id", "payment_methods"], "query": [ { "key": "accepted_country", diff --git a/postman/collection-dir/hyperswitch/PaymentMethods/List payment methods for a Merchant/.event.meta.json b/postman/collection-dir/hyperswitch/PaymentMethods/List payment methods for a Merchant/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/PaymentMethods/List payment methods for a Merchant/.event.meta.json +++ b/postman/collection-dir/hyperswitch/PaymentMethods/List payment methods for a Merchant/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/PaymentMethods/List payment methods for a Merchant/event.test.js b/postman/collection-dir/hyperswitch/PaymentMethods/List payment methods for a Merchant/event.test.js index 36ecedc4476..262b38449b3 100644 --- a/postman/collection-dir/hyperswitch/PaymentMethods/List payment methods for a Merchant/event.test.js +++ b/postman/collection-dir/hyperswitch/PaymentMethods/List payment methods for a Merchant/event.test.js @@ -1,10 +1,17 @@ -// Validate status 2xx -pm.test("[GET]::/payment_methods/:merchant_id - Status code is 2xx", function () { - pm.response.to.be.success; -}); +// Validate status 2xx +pm.test( + "[GET]::/payment_methods/:merchant_id - Status code is 2xx", + function () { + pm.response.to.be.success; + }, +); // Validate if response header has matching content-type -pm.test("[GET]::/payment_methods/:merchant_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); - +pm.test( + "[GET]::/payment_methods/:merchant_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); diff --git a/postman/collection-dir/hyperswitch/PaymentMethods/List payment methods for a Merchant/request.json b/postman/collection-dir/hyperswitch/PaymentMethods/List payment methods for a Merchant/request.json index af5ed2cb03b..2ac57be196a 100644 --- a/postman/collection-dir/hyperswitch/PaymentMethods/List payment methods for a Merchant/request.json +++ b/postman/collection-dir/hyperswitch/PaymentMethods/List payment methods for a Merchant/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/account/payment_methods", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - "payment_methods" - ], + "host": ["{{baseUrl}}"], + "path": ["account", "payment_methods"], "query": [ { "key": "client_secret", diff --git a/postman/collection-dir/hyperswitch/PaymentMethods/PaymentMethods - Create/.event.meta.json b/postman/collection-dir/hyperswitch/PaymentMethods/PaymentMethods - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/PaymentMethods/PaymentMethods - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/PaymentMethods/PaymentMethods - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/PaymentMethods/PaymentMethods - Create/event.test.js b/postman/collection-dir/hyperswitch/PaymentMethods/PaymentMethods - Create/event.test.js index 874935af238..db811e5eb01 100644 --- a/postman/collection-dir/hyperswitch/PaymentMethods/PaymentMethods - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/PaymentMethods/PaymentMethods - Create/event.test.js @@ -1,29 +1,45 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payment_methods - 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]::/payment_methods - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); - +pm.test( + "[POST]::/payment_methods - 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_method_id as variable for jsonData.payment_method_id if (jsonData?.payment_method_id) { - pm.collectionVariables.set("payment_method_id", jsonData.payment_method_id); - console.log("- use {{payment_method_id}} as collection variable for value",jsonData.payment_method_id); + pm.collectionVariables.set("payment_method_id", jsonData.payment_method_id); + console.log( + "- use {{payment_method_id}} as collection variable for value", + jsonData.payment_method_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_method_id}}, as jsonData.payment_method_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_method_id}}, as jsonData.payment_method_id is undefined.", + ); +} if (jsonData?.customer_id) { - pm.collectionVariables.set("customer_id", jsonData.customer_id); - console.log("- use {{customer_id}} as collection variable for value",jsonData.customer_id); + pm.collectionVariables.set("customer_id", jsonData.customer_id); + console.log( + "- use {{customer_id}} as collection variable for value", + jsonData.customer_id, + ); } else { - console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/PaymentMethods/PaymentMethods - Create/request.json b/postman/collection-dir/hyperswitch/PaymentMethods/PaymentMethods - Create/request.json index 1cd306ef554..f9126f5e2e4 100644 --- a/postman/collection-dir/hyperswitch/PaymentMethods/PaymentMethods - Create/request.json +++ b/postman/collection-dir/hyperswitch/PaymentMethods/PaymentMethods - Create/request.json @@ -36,12 +36,8 @@ }, "url": { "raw": "{{baseUrl}}/payment_methods", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payment_methods" - ] + "host": ["{{baseUrl}}"], + "path": ["payment_methods"] }, "description": "To create a payment method against a customer object. In case of cards, this API could be used only by PCI compliant merchants" } diff --git a/postman/collection-dir/hyperswitch/PaymentMethods/PaymentMethods - Update/.event.meta.json b/postman/collection-dir/hyperswitch/PaymentMethods/PaymentMethods - Update/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/PaymentMethods/PaymentMethods - Update/.event.meta.json +++ b/postman/collection-dir/hyperswitch/PaymentMethods/PaymentMethods - Update/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/PaymentMethods/PaymentMethods - Update/event.test.js b/postman/collection-dir/hyperswitch/PaymentMethods/PaymentMethods - Update/event.test.js index 6c2f3a25310..2b3336db40a 100644 --- a/postman/collection-dir/hyperswitch/PaymentMethods/PaymentMethods - Update/event.test.js +++ b/postman/collection-dir/hyperswitch/PaymentMethods/PaymentMethods - Update/event.test.js @@ -1,9 +1,14 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payment_methods/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payment_methods/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payment_methods/:id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); diff --git a/postman/collection-dir/hyperswitch/PaymentMethods/PaymentMethods - Update/request.json b/postman/collection-dir/hyperswitch/PaymentMethods/PaymentMethods - Update/request.json index 526c03f9845..af4b07aeb45 100644 --- a/postman/collection-dir/hyperswitch/PaymentMethods/PaymentMethods - Update/request.json +++ b/postman/collection-dir/hyperswitch/PaymentMethods/PaymentMethods - Update/request.json @@ -32,13 +32,8 @@ }, "url": { "raw": "{{baseUrl}}/payment_methods/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payment_methods", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payment_methods", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/PaymentMethods/Payments - Create/.event.meta.json b/postman/collection-dir/hyperswitch/PaymentMethods/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/PaymentMethods/Payments - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/PaymentMethods/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/PaymentMethods/Payments - Create/event.test.js b/postman/collection-dir/hyperswitch/PaymentMethods/Payments - Create/event.test.js index 5c88ff02531..aac7a8add21 100644 --- a/postman/collection-dir/hyperswitch/PaymentMethods/Payments - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/PaymentMethods/Payments - Create/event.test.js @@ -1,50 +1,73 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} if (jsonData?.customer_id) { - pm.collectionVariables.set("customer_id", jsonData.customer_id); - console.log("- use {{customer_id}} as collection variable for value",jsonData.customer_id); + pm.collectionVariables.set("customer_id", jsonData.customer_id); + console.log( + "- use {{customer_id}} as collection variable for value", + jsonData.customer_id, + ); } else { - console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/PaymentMethods/Payments - Create/request.json b/postman/collection-dir/hyperswitch/PaymentMethods/Payments - Create/request.json index a7d4a2e3cfd..20007308fe7 100644 --- a/postman/collection-dir/hyperswitch/PaymentMethods/Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/PaymentMethods/Payments - Create/request.json @@ -89,12 +89,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Payments/Payment-List/.event.meta.json b/postman/collection-dir/hyperswitch/Payments/Payment-List/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Payments/Payment-List/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Payments/Payment-List/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Payments/Payment-List/event.test.js b/postman/collection-dir/hyperswitch/Payments/Payment-List/event.test.js index b47c080f1a3..9bb828db9eb 100644 --- a/postman/collection-dir/hyperswitch/Payments/Payment-List/event.test.js +++ b/postman/collection-dir/hyperswitch/Payments/Payment-List/event.test.js @@ -1,9 +1,14 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/list - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[GET]::/payments/list - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); \ No newline at end of file +pm.test( + "[GET]::/payments/list - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); diff --git a/postman/collection-dir/hyperswitch/Payments/Payment-List/request.json b/postman/collection-dir/hyperswitch/Payments/Payment-List/request.json index 75f7e7df97b..a190f6de393 100644 --- a/postman/collection-dir/hyperswitch/Payments/Payment-List/request.json +++ b/postman/collection-dir/hyperswitch/Payments/Payment-List/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/list", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - "list" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", "list"], "query": [ { "key": "customer_id", diff --git a/postman/collection-dir/hyperswitch/Payments/Payments - Cancel/.event.meta.json b/postman/collection-dir/hyperswitch/Payments/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Payments/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Payments/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Payments/Payments - Cancel/event.test.js b/postman/collection-dir/hyperswitch/Payments/Payments - Cancel/event.test.js index 7216e47333a..55ce161f4f6 100644 --- a/postman/collection-dir/hyperswitch/Payments/Payments - Cancel/event.test.js +++ b/postman/collection-dir/hyperswitch/Payments/Payments - Cancel/event.test.js @@ -1,16 +1,19 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/cancel - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/cancel - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/cancel - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - - diff --git a/postman/collection-dir/hyperswitch/Payments/Payments - Cancel/request.json b/postman/collection-dir/hyperswitch/Payments/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/hyperswitch/Payments/Payments - Cancel/request.json +++ b/postman/collection-dir/hyperswitch/Payments/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/Payments/Payments - Capture/.event.meta.json b/postman/collection-dir/hyperswitch/Payments/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Payments/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Payments/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Payments/Payments - Capture/event.test.js b/postman/collection-dir/hyperswitch/Payments/Payments - Capture/event.test.js index 193e6ef45e6..98d40ad2eff 100644 --- a/postman/collection-dir/hyperswitch/Payments/Payments - Capture/event.test.js +++ b/postman/collection-dir/hyperswitch/Payments/Payments - Capture/event.test.js @@ -1,45 +1,64 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/capture - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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.", + ); +} diff --git a/postman/collection-dir/hyperswitch/Payments/Payments - Capture/request.json b/postman/collection-dir/hyperswitch/Payments/Payments - Capture/request.json index 8efb99d3c90..cceb2b55f0a 100644 --- a/postman/collection-dir/hyperswitch/Payments/Payments - Capture/request.json +++ b/postman/collection-dir/hyperswitch/Payments/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/Payments/Payments - Confirm/.event.meta.json b/postman/collection-dir/hyperswitch/Payments/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Payments/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Payments/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Payments/Payments - Confirm/event.test.js b/postman/collection-dir/hyperswitch/Payments/Payments - Confirm/event.test.js index 48bdfd0c8c9..aa33b02d173 100644 --- a/postman/collection-dir/hyperswitch/Payments/Payments - Confirm/event.test.js +++ b/postman/collection-dir/hyperswitch/Payments/Payments - Confirm/event.test.js @@ -1,46 +1,64 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/Payments/Payments - Confirm/request.json b/postman/collection-dir/hyperswitch/Payments/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/hyperswitch/Payments/Payments - Confirm/request.json +++ b/postman/collection-dir/hyperswitch/Payments/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/Payments/Payments - Create Copy/.event.meta.json b/postman/collection-dir/hyperswitch/Payments/Payments - Create Copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Payments/Payments - Create Copy/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Payments/Payments - Create Copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Payments/Payments - Create Copy/event.test.js b/postman/collection-dir/hyperswitch/Payments/Payments - Create Copy/event.test.js index 007eb135e85..a6947db94c0 100644 --- a/postman/collection-dir/hyperswitch/Payments/Payments - Create Copy/event.test.js +++ b/postman/collection-dir/hyperswitch/Payments/Payments - Create Copy/event.test.js @@ -1,43 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/Payments/Payments - Create Copy/request.json b/postman/collection-dir/hyperswitch/Payments/Payments - Create Copy/request.json index 90c11d5891b..37a587e6e3f 100644 --- a/postman/collection-dir/hyperswitch/Payments/Payments - Create Copy/request.json +++ b/postman/collection-dir/hyperswitch/Payments/Payments - Create Copy/request.json @@ -88,12 +88,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Payments/Payments - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Payments/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Payments/Payments - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Payments/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Payments/Payments - Create/event.test.js b/postman/collection-dir/hyperswitch/Payments/Payments - Create/event.test.js index 007eb135e85..a6947db94c0 100644 --- a/postman/collection-dir/hyperswitch/Payments/Payments - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Payments/Payments - Create/event.test.js @@ -1,43 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/Payments/Payments - Create/request.json b/postman/collection-dir/hyperswitch/Payments/Payments - Create/request.json index 3a38b8b7e09..f3299786f1f 100644 --- a/postman/collection-dir/hyperswitch/Payments/Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/Payments/Payments - Create/request.json @@ -88,12 +88,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Payments/Payments - Retrieve/.event.meta.json b/postman/collection-dir/hyperswitch/Payments/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Payments/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Payments/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Payments/Payments - Retrieve/event.test.js b/postman/collection-dir/hyperswitch/Payments/Payments - Retrieve/event.test.js index 9682fa7eaca..0a8d91f45ff 100644 --- a/postman/collection-dir/hyperswitch/Payments/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/hyperswitch/Payments/Payments - Retrieve/event.test.js @@ -1,43 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/Payments/Payments - Retrieve/request.json b/postman/collection-dir/hyperswitch/Payments/Payments - Retrieve/request.json index c71774083b2..ef0b213739d 100644 --- a/postman/collection-dir/hyperswitch/Payments/Payments - Retrieve/request.json +++ b/postman/collection-dir/hyperswitch/Payments/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/Payments/Payments - Update/.event.meta.json b/postman/collection-dir/hyperswitch/Payments/Payments - Update/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Payments/Payments - Update/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Payments/Payments - Update/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Payments/Payments - Update/event.test.js b/postman/collection-dir/hyperswitch/Payments/Payments - Update/event.test.js index e6041914348..0318f72c621 100644 --- a/postman/collection-dir/hyperswitch/Payments/Payments - Update/event.test.js +++ b/postman/collection-dir/hyperswitch/Payments/Payments - Update/event.test.js @@ -1,45 +1,64 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} - +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/Payments/Payments - Update/request.json b/postman/collection-dir/hyperswitch/Payments/Payments - Update/request.json index ed83efb51e3..63fc220720b 100644 --- a/postman/collection-dir/hyperswitch/Payments/Payments - Update/request.json +++ b/postman/collection-dir/hyperswitch/Payments/Payments - Update/request.json @@ -74,13 +74,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/Payments/Session Token/.event.meta.json b/postman/collection-dir/hyperswitch/Payments/Session Token/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Payments/Session Token/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Payments/Session Token/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Payments/Session Token/event.test.js b/postman/collection-dir/hyperswitch/Payments/Session Token/event.test.js index 555b06a4844..5ae993143f5 100644 --- a/postman/collection-dir/hyperswitch/Payments/Session Token/event.test.js +++ b/postman/collection-dir/hyperswitch/Payments/Session Token/event.test.js @@ -1,9 +1,14 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/session_tokens - 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/session_tokens - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); \ No newline at end of file +pm.test( + "[POST]::/payments/session_tokens - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); diff --git a/postman/collection-dir/hyperswitch/Payments/Session Token/request.json b/postman/collection-dir/hyperswitch/Payments/Session Token/request.json index a07a04f4a67..e372f629aa8 100644 --- a/postman/collection-dir/hyperswitch/Payments/Session Token/request.json +++ b/postman/collection-dir/hyperswitch/Payments/Session Token/request.json @@ -31,12 +31,7 @@ }, "url": { "raw": "{{baseUrl}}/payments/session_tokens", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - "session_tokens" - ] + "host": ["{{baseUrl}}"], + "path": ["payments", "session_tokens"] } } diff --git a/postman/collection-dir/hyperswitch/QuickStart/API Key - Create/.event.meta.json b/postman/collection-dir/hyperswitch/QuickStart/API Key - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/QuickStart/API Key - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/QuickStart/API Key - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/QuickStart/API Key - Create/event.test.js b/postman/collection-dir/hyperswitch/QuickStart/API Key - Create/event.test.js index bc42e83a761..4e27c5a5025 100644 --- a/postman/collection-dir/hyperswitch/QuickStart/API Key - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/QuickStart/API Key - Create/event.test.js @@ -1,32 +1,46 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/api_keys/:merchant_id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/api_keys/:merchant_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/api_keys/:merchant_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; try { jsonData = pm.response.json(); -} catch(e) { -} +} catch (e) {} // pm.collectionVariables - Set api_key_id as variable for jsonData.key_id if (jsonData?.key_id) { - pm.collectionVariables.set("api_key_id", jsonData.key_id); - console.log("- use {{api_key_id}} as collection variable for value", jsonData.key_id); + pm.collectionVariables.set("api_key_id", jsonData.key_id); + console.log( + "- use {{api_key_id}} as collection variable for value", + jsonData.key_id, + ); } else { - console.log('INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value", jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/QuickStart/API Key - Create/request.json b/postman/collection-dir/hyperswitch/QuickStart/API Key - Create/request.json index 29c2490d1bc..2210d14da0e 100644 --- a/postman/collection-dir/hyperswitch/QuickStart/API Key - Create/request.json +++ b/postman/collection-dir/hyperswitch/QuickStart/API Key - Create/request.json @@ -35,13 +35,8 @@ }, "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/hyperswitch/QuickStart/Merchant Account - Create/.event.meta.json b/postman/collection-dir/hyperswitch/QuickStart/Merchant Account - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/QuickStart/Merchant Account - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/QuickStart/Merchant Account - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/QuickStart/Merchant Account - Create/event.test.js b/postman/collection-dir/hyperswitch/QuickStart/Merchant Account - Create/event.test.js index 6f4316a9078..70f5e50bbde 100644 --- a/postman/collection-dir/hyperswitch/QuickStart/Merchant Account - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/QuickStart/Merchant Account - Create/event.test.js @@ -1,24 +1,33 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - 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]::/accounts - 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", + ); }); // 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 merchant_id as variable for jsonData.merchant_id if (jsonData?.merchant_id) { - pm.collectionVariables.set("merchant_id", jsonData.merchant_id); - console.log("- use {{merchant_id}} as collection variable for value",jsonData.merchant_id); + pm.collectionVariables.set("merchant_id", jsonData.merchant_id); + console.log( + "- use {{merchant_id}} as collection variable for value", + jsonData.merchant_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.", + ); +} /* // pm.collectionVariables - Set api_key as variable for jsonData.api_key @@ -32,8 +41,13 @@ if (jsonData?.api_key) { // pm.collectionVariables - Set publishable_key as variable for jsonData.publishable_key if (jsonData?.publishable_key) { - pm.collectionVariables.set("publishable_key", jsonData.publishable_key); - console.log("- use {{publishable_key}} as collection variable for value",jsonData.publishable_key); + pm.collectionVariables.set("publishable_key", jsonData.publishable_key); + console.log( + "- use {{publishable_key}} as collection variable for value", + jsonData.publishable_key, + ); } else { - console.log('INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/QuickStart/Merchant Account - Create/request.json b/postman/collection-dir/hyperswitch/QuickStart/Merchant Account - Create/request.json index b035b29e2e7..be3e1144ef4 100644 --- a/postman/collection-dir/hyperswitch/QuickStart/Merchant Account - Create/request.json +++ b/postman/collection-dir/hyperswitch/QuickStart/Merchant Account - Create/request.json @@ -78,12 +78,8 @@ }, "url": { "raw": "{{baseUrl}}/accounts", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "accounts" - ] + "host": ["{{baseUrl}}"], + "path": ["accounts"] }, "description": "Create a new account for a merchant. The merchant could be a seller or retailer or client who likes to receive and send payments." } diff --git a/postman/collection-dir/hyperswitch/QuickStart/Payment Connector - Create/.event.meta.json b/postman/collection-dir/hyperswitch/QuickStart/Payment Connector - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/QuickStart/Payment Connector - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/QuickStart/Payment Connector - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/QuickStart/Payment Connector - Create/event.test.js b/postman/collection-dir/hyperswitch/QuickStart/Payment Connector - Create/event.test.js index b831702461e..88e92d8d84a 100644 --- a/postman/collection-dir/hyperswitch/QuickStart/Payment Connector - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/QuickStart/Payment Connector - Create/event.test.js @@ -1,21 +1,39 @@ -// Validate status 2xx -pm.test("[POST]::/account/:account_id/connectors - 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.be.success; + }, +); // Validate if response header has matching content-type -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"); -}); +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){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id if (jsonData?.merchant_connector_id) { - pm.collectionVariables.set("merchant_connector_id", jsonData.merchant_connector_id); - console.log("- use {{merchant_connector_id}} as collection variable for value",jsonData.merchant_connector_id); + pm.collectionVariables.set( + "merchant_connector_id", + jsonData.merchant_connector_id, + ); + console.log( + "- use {{merchant_connector_id}} as collection variable for value", + jsonData.merchant_connector_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/QuickStart/Payment Connector - Create/request.json b/postman/collection-dir/hyperswitch/QuickStart/Payment Connector - Create/request.json index ad6f4c717bb..7eab2000165 100644 --- a/postman/collection-dir/hyperswitch/QuickStart/Payment Connector - Create/request.json +++ b/postman/collection-dir/hyperswitch/QuickStart/Payment Connector - Create/request.json @@ -257,10 +257,7 @@ { "type": "CARD", "parameters": { - "allowed_auth_methods": [ - "PAN_ONLY", - "CRYPTOGRAM_3DS" - ], + "allowed_auth_methods": ["PAN_ONLY", "CRYPTOGRAM_3DS"], "allowed_card_networks": [ "AMEX", "DISCOVER", @@ -294,15 +291,8 @@ }, "payment_request_data": { "label": "applepay pvt.ltd", - "supported_networks": [ - "visa", - "masterCard", - "amex", - "discover" - ], - "merchant_capabilities": [ - "supports3DS" - ] + "supported_networks": ["visa", "masterCard", "amex", "discover"], + "merchant_capabilities": ["supports3DS"] } } } @@ -310,14 +300,8 @@ }, "url": { "raw": "{{baseUrl}}/account/:account_id/connectors", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/hyperswitch/QuickStart/Payments - Create/.event.meta.json b/postman/collection-dir/hyperswitch/QuickStart/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/QuickStart/Payments - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/QuickStart/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/QuickStart/Payments - Create/event.test.js b/postman/collection-dir/hyperswitch/QuickStart/Payments - Create/event.test.js index 62142d52dca..a6947db94c0 100644 --- a/postman/collection-dir/hyperswitch/QuickStart/Payments - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/QuickStart/Payments - Create/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/QuickStart/Payments - Create/request.json b/postman/collection-dir/hyperswitch/QuickStart/Payments - Create/request.json index 478e0c669db..5bc31af000d 100644 --- a/postman/collection-dir/hyperswitch/QuickStart/Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/QuickStart/Payments - Create/request.json @@ -88,12 +88,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/QuickStart/Payments - Retrieve/.event.meta.json b/postman/collection-dir/hyperswitch/QuickStart/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/QuickStart/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/hyperswitch/QuickStart/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/QuickStart/Payments - Retrieve/event.test.js b/postman/collection-dir/hyperswitch/QuickStart/Payments - Retrieve/event.test.js index 4dd072b2222..d0a02af7436 100644 --- a/postman/collection-dir/hyperswitch/QuickStart/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/hyperswitch/QuickStart/Payments - Retrieve/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // 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.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/QuickStart/Payments - Retrieve/request.json b/postman/collection-dir/hyperswitch/QuickStart/Payments - Retrieve/request.json index c71774083b2..ef0b213739d 100644 --- a/postman/collection-dir/hyperswitch/QuickStart/Payments - Retrieve/request.json +++ b/postman/collection-dir/hyperswitch/QuickStart/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/QuickStart/Refunds - Create/.event.meta.json b/postman/collection-dir/hyperswitch/QuickStart/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/QuickStart/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/QuickStart/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/QuickStart/Refunds - Create/event.test.js b/postman/collection-dir/hyperswitch/QuickStart/Refunds - Create/event.test.js index c862e8e68a7..dbc930608cb 100644 --- a/postman/collection-dir/hyperswitch/QuickStart/Refunds - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/QuickStart/Refunds - Create/event.test.js @@ -1,21 +1,30 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/QuickStart/Refunds - Create/request.json b/postman/collection-dir/hyperswitch/QuickStart/Refunds - Create/request.json index 4dbca4d01f2..0c13281ee15 100644 --- a/postman/collection-dir/hyperswitch/QuickStart/Refunds - Create/request.json +++ b/postman/collection-dir/hyperswitch/QuickStart/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/hyperswitch/QuickStart/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/hyperswitch/QuickStart/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/QuickStart/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/hyperswitch/QuickStart/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/QuickStart/Refunds - Retrieve/event.test.js b/postman/collection-dir/hyperswitch/QuickStart/Refunds - Retrieve/event.test.js index b1e1f12ba50..bbd8e544e2c 100644 --- a/postman/collection-dir/hyperswitch/QuickStart/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/hyperswitch/QuickStart/Refunds - Retrieve/event.test.js @@ -1,22 +1,30 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); - // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/QuickStart/Refunds - Retrieve/request.json b/postman/collection-dir/hyperswitch/QuickStart/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/hyperswitch/QuickStart/Refunds - Retrieve/request.json +++ b/postman/collection-dir/hyperswitch/QuickStart/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/Refunds/Payments - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Refunds/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Refunds/Payments - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Refunds/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Refunds/Payments - Create/event.test.js b/postman/collection-dir/hyperswitch/Refunds/Payments - Create/event.test.js index 007eb135e85..a6947db94c0 100644 --- a/postman/collection-dir/hyperswitch/Refunds/Payments - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Refunds/Payments - Create/event.test.js @@ -1,43 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/Refunds/Payments - Create/request.json b/postman/collection-dir/hyperswitch/Refunds/Payments - Create/request.json index a7d4a2e3cfd..20007308fe7 100644 --- a/postman/collection-dir/hyperswitch/Refunds/Payments - Create/request.json +++ b/postman/collection-dir/hyperswitch/Refunds/Payments - Create/request.json @@ -89,12 +89,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/hyperswitch/Refunds/Refunds - Create/.event.meta.json b/postman/collection-dir/hyperswitch/Refunds/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Refunds/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Refunds/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Refunds/Refunds - Create/event.test.js b/postman/collection-dir/hyperswitch/Refunds/Refunds - Create/event.test.js index c862e8e68a7..dbc930608cb 100644 --- a/postman/collection-dir/hyperswitch/Refunds/Refunds - Create/event.test.js +++ b/postman/collection-dir/hyperswitch/Refunds/Refunds - Create/event.test.js @@ -1,21 +1,30 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/Refunds/Refunds - Create/request.json b/postman/collection-dir/hyperswitch/Refunds/Refunds - Create/request.json index 4dbca4d01f2..0c13281ee15 100644 --- a/postman/collection-dir/hyperswitch/Refunds/Refunds - Create/request.json +++ b/postman/collection-dir/hyperswitch/Refunds/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/hyperswitch/Refunds/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/hyperswitch/Refunds/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Refunds/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Refunds/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Refunds/Refunds - Retrieve/event.test.js b/postman/collection-dir/hyperswitch/Refunds/Refunds - Retrieve/event.test.js index 8815f33f244..bbd8e544e2c 100644 --- a/postman/collection-dir/hyperswitch/Refunds/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/hyperswitch/Refunds/Refunds - Retrieve/event.test.js @@ -1,21 +1,30 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/Refunds/Refunds - Retrieve/request.json b/postman/collection-dir/hyperswitch/Refunds/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/hyperswitch/Refunds/Refunds - Retrieve/request.json +++ b/postman/collection-dir/hyperswitch/Refunds/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/hyperswitch/Refunds/Refunds - Update/.event.meta.json b/postman/collection-dir/hyperswitch/Refunds/Refunds - Update/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/hyperswitch/Refunds/Refunds - Update/.event.meta.json +++ b/postman/collection-dir/hyperswitch/Refunds/Refunds - Update/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/hyperswitch/Refunds/Refunds - Update/event.test.js b/postman/collection-dir/hyperswitch/Refunds/Refunds - Update/event.test.js index a3393fa77d7..26b243a6089 100644 --- a/postman/collection-dir/hyperswitch/Refunds/Refunds - Update/event.test.js +++ b/postman/collection-dir/hyperswitch/Refunds/Refunds - Update/event.test.js @@ -1,22 +1,30 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); - // 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("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.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/hyperswitch/Refunds/Refunds - Update/request.json b/postman/collection-dir/hyperswitch/Refunds/Refunds - Update/request.json index a4c991dc114..8b4c4a97755 100644 --- a/postman/collection-dir/hyperswitch/Refunds/Refunds - Update/request.json +++ b/postman/collection-dir/hyperswitch/Refunds/Refunds - Update/request.json @@ -28,13 +28,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/mollie/.event.meta.json b/postman/collection-dir/mollie/.event.meta.json index 2df9d47d936..eb871bbcb9b 100644 --- a/postman/collection-dir/mollie/.event.meta.json +++ b/postman/collection-dir/mollie/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.prerequest.js", - "event.test.js" - ] + "eventOrder": ["event.prerequest.js", "event.test.js"] } diff --git a/postman/collection-dir/mollie/.meta.json b/postman/collection-dir/mollie/.meta.json index 91b6a65c5bc..d513035ce2d 100644 --- a/postman/collection-dir/mollie/.meta.json +++ b/postman/collection-dir/mollie/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Health check", - "Flow Testcases" - ] + "childrenOrder": ["Health check", "Flow Testcases"] } diff --git a/postman/collection-dir/mollie/Flow Testcases/.meta.json b/postman/collection-dir/mollie/Flow Testcases/.meta.json index 1bbce843680..023989e1e49 100644 --- a/postman/collection-dir/mollie/Flow Testcases/.meta.json +++ b/postman/collection-dir/mollie/Flow Testcases/.meta.json @@ -1,7 +1,3 @@ { - "childrenOrder": [ - "QuickStart", - "Happy Cases", - "Variation Cases" - ] + "childrenOrder": ["QuickStart", "Happy Cases", "Variation Cases"] } diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js index 1baf6b854b7..5e6a7972fd7 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", function() { - pm.expect(jsonData.status).to.eql("requires_customer_action"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", + function () { + pm.expect(jsonData.status).to.eql("requires_customer_action"); + }, + ); +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json index 07a024cf10c..1f351ee36bc 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json @@ -94,12 +94,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js index 08ad2d6a233..02ab01502c1 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + 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"); + }, + ); +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15- Wallets Paypal/.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario10-Bank Redirect-giropay/.meta.json similarity index 100% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15- Wallets Paypal/.meta.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario10-Bank Redirect-giropay/.meta.json diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario10-Bank Redirect-giropay/Payments - Confirm/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario10-Bank Redirect-giropay/Payments - Confirm/.event.meta.json new file mode 100644 index 00000000000..0731450e6b2 --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario10-Bank Redirect-giropay/Payments - Confirm/.event.meta.json @@ -0,0 +1,3 @@ +{ + "eventOrder": ["event.test.js"] +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario10-Bank Redirect-giropay/Payments - Confirm/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario10-Bank Redirect-giropay/Payments - Confirm/event.test.js new file mode 100644 index 00000000000..d76badb0d48 --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario10-Bank Redirect-giropay/Payments - Confirm/event.test.js @@ -0,0 +1,103 @@ +// 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 "requires_customer_action" for "status" +if (jsonData?.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"); + }, + ); +} + +// 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; + }, +); + +// Response body should have value "giropay" for "payment_method_type" +if (jsonData?.payment_method_type) { + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'giropay'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("giropay"); + }, + ); +} + +// Response body should have value "mollie" for "connector" +if (jsonData?.connector) { + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'mollie'", + function () { + pm.expect(jsonData.connector).to.eql("mollie"); + }, + ); +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/request.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario10-Bank Redirect-giropay/Payments - Confirm/request.json similarity index 72% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/request.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario10-Bank Redirect-giropay/Payments - Confirm/request.json index 70123c3aba7..caf10ddd35d 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/request.json +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario10-Bank Redirect-giropay/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_redirect", "payment_method_type": "giropay", "payment_method_data": { @@ -36,14 +57,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15- Wallets Paypal/Payments - Confirm/response.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario10-Bank Redirect-giropay/Payments - Confirm/response.json similarity index 100% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15- Wallets Paypal/Payments - Confirm/response.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario10-Bank Redirect-giropay/Payments - Confirm/response.json diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario10-Bank Redirect-giropay/Payments - Create/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario10-Bank Redirect-giropay/Payments - Create/.event.meta.json new file mode 100644 index 00000000000..0731450e6b2 --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario10-Bank Redirect-giropay/Payments - Create/.event.meta.json @@ -0,0 +1,3 @@ +{ + "eventOrder": ["event.test.js"] +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario10-Bank Redirect-giropay/Payments - Create/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario10-Bank Redirect-giropay/Payments - Create/event.test.js new file mode 100644 index 00000000000..0444324000a --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario10-Bank Redirect-giropay/Payments - Create/event.test.js @@ -0,0 +1,71 @@ +// 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"); + }, + ); +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15- Wallets Paypal/Payments - Create/request.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario10-Bank Redirect-giropay/Payments - Create/request.json similarity index 97% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15- Wallets Paypal/Payments - Create/request.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario10-Bank Redirect-giropay/Payments - Create/request.json index 87d07a6016b..0b0c56d2660 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15- Wallets Paypal/Payments - Create/request.json +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario10-Bank Redirect-giropay/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15- Wallets Paypal/Payments - Create/response.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario10-Bank Redirect-giropay/Payments - Create/response.json similarity index 100% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15- Wallets Paypal/Payments - Create/response.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario10-Bank Redirect-giropay/Payments - Create/response.json diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario10-Bank Redirect-giropay/Payments - Retrieve/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario10-Bank Redirect-giropay/Payments - Retrieve/.event.meta.json new file mode 100644 index 00000000000..0731450e6b2 --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario10-Bank Redirect-giropay/Payments - Retrieve/.event.meta.json @@ -0,0 +1,3 @@ +{ + "eventOrder": ["event.test.js"] +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario10-Bank Redirect-giropay/Payments - Retrieve/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario10-Bank Redirect-giropay/Payments - Retrieve/event.test.js new file mode 100644 index 00000000000..9053ddab13b --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario10-Bank Redirect-giropay/Payments - Retrieve/event.test.js @@ -0,0 +1,71 @@ +// 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"); + }, + ); +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/request.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario10-Bank Redirect-giropay/Payments - Retrieve/request.json similarity index 86% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/request.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario10-Bank Redirect-giropay/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/request.json +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario10-Bank Redirect-giropay/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15- Wallets Paypal/Payments - Retrieve/response.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario10-Bank Redirect-giropay/Payments - Retrieve/response.json similarity index 100% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15- Wallets Paypal/Payments - Retrieve/response.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario10-Bank Redirect-giropay/Payments - Retrieve/response.json diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15- Wallets Paypal/Payments - Confirm/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15- Wallets Paypal/Payments - Confirm/.event.meta.json deleted file mode 100644 index 688c85746ef..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15- Wallets Paypal/Payments - Confirm/.event.meta.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "eventOrder": [ - "event.test.js" - ] -} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15- Wallets Paypal/Payments - Confirm/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15- Wallets Paypal/Payments - Confirm/event.test.js deleted file mode 100644 index 30f9700a318..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15- Wallets Paypal/Payments - Confirm/event.test.js +++ /dev/null @@ -1,71 +0,0 @@ -// 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 "requires_customer_action" for "status" -if (jsonData?.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"); -})}; - - -// 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; -}); - -// Response body should have value "paypal" for "payment_method_type" -if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'paypal'", function() { - pm.expect(jsonData.payment_method_type).to.eql("paypal"); -})}; - - -// Response body should have value "mollie" for "connector" -if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'mollie'", function() { - pm.expect(jsonData.connector).to.eql("mollie"); -})}; \ No newline at end of file diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15- Wallets Paypal/Payments - Create/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15- Wallets Paypal/Payments - Create/.event.meta.json deleted file mode 100644 index 688c85746ef..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15- Wallets Paypal/Payments - Create/.event.meta.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "eventOrder": [ - "event.test.js" - ] -} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15- Wallets Paypal/Payments - Create/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15- Wallets Paypal/Payments - Create/event.test.js deleted file mode 100644 index eecbfd020ff..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15- Wallets Paypal/Payments - Create/event.test.js +++ /dev/null @@ -1,49 +0,0 @@ -// 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"); -})}; diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15- Wallets Paypal/Payments - Retrieve/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15- Wallets Paypal/Payments - Retrieve/.event.meta.json deleted file mode 100644 index 688c85746ef..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15- Wallets Paypal/Payments - Retrieve/.event.meta.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "eventOrder": [ - "event.test.js" - ] -} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15- Wallets Paypal/Payments - Retrieve/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15- Wallets Paypal/Payments - Retrieve/event.test.js deleted file mode 100644 index cccd288c0c1..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15- Wallets Paypal/Payments - Retrieve/event.test.js +++ /dev/null @@ -1,49 +0,0 @@ -// 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"); -})}; \ No newline at end of file diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json deleted file mode 100644 index 688c85746ef..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "eventOrder": [ - "event.test.js" - ] -} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/event.test.js deleted file mode 100644 index af2b6b67b7f..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/event.test.js +++ /dev/null @@ -1,71 +0,0 @@ -// 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 "requires_customer_action" for "status" -if (jsonData?.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"); -})}; - - -// 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; -}); - -// Response body should have value "ideal" for "payment_method_type" -if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'ideal'", function() { - pm.expect(jsonData.payment_method_type).to.eql("ideal"); -})}; - - -// Response body should have value "mollie" for "connector" -if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'mollie'", function() { - pm.expect(jsonData.connector).to.eql("mollie"); -})}; \ No newline at end of file diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/.event.meta.json deleted file mode 100644 index 688c85746ef..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/.event.meta.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "eventOrder": [ - "event.test.js" - ] -} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/event.test.js deleted file mode 100644 index eecbfd020ff..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/event.test.js +++ /dev/null @@ -1,49 +0,0 @@ -// 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"); -})}; diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json deleted file mode 100644 index 688c85746ef..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "eventOrder": [ - "event.test.js" - ] -} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/event.test.js deleted file mode 100644 index cccd288c0c1..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/event.test.js +++ /dev/null @@ -1,49 +0,0 @@ -// 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"); -})}; \ No newline at end of file diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/.event.meta.json deleted file mode 100644 index 688c85746ef..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/.event.meta.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "eventOrder": [ - "event.test.js" - ] -} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/event.test.js deleted file mode 100644 index 1ebc00c9b5a..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/event.test.js +++ /dev/null @@ -1,71 +0,0 @@ -// 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 "requires_customer_action" for "status" -if (jsonData?.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"); -})}; - - -// 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; -}); - -// Response body should have value "sofort" for "payment_method_type" -if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'sofort'", function() { - pm.expect(jsonData.payment_method_type).to.eql("sofort"); -})}; - - -// Response body should have value "mollie" for "connector" -if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'mollie'", function() { - pm.expect(jsonData.connector).to.eql("mollie"); -})}; \ No newline at end of file diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/.event.meta.json deleted file mode 100644 index 688c85746ef..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/.event.meta.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "eventOrder": [ - "event.test.js" - ] -} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/event.test.js deleted file mode 100644 index eecbfd020ff..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/event.test.js +++ /dev/null @@ -1,49 +0,0 @@ -// 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"); -})}; diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/.event.meta.json deleted file mode 100644 index 688c85746ef..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/.event.meta.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "eventOrder": [ - "event.test.js" - ] -} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/event.test.js deleted file mode 100644 index cccd288c0c1..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/event.test.js +++ /dev/null @@ -1,49 +0,0 @@ -// 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"); -})}; \ No newline at end of file diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/.event.meta.json deleted file mode 100644 index 688c85746ef..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/.event.meta.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "eventOrder": [ - "event.test.js" - ] -} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/event.test.js deleted file mode 100644 index 813f88870a3..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/event.test.js +++ /dev/null @@ -1,71 +0,0 @@ -// 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 "requires_customer_action" for "status" -if (jsonData?.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"); -})}; - - -// 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; -}); - -// Response body should have value "eps" for "payment_method_type" -if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'eps'", function() { - pm.expect(jsonData.payment_method_type).to.eql("eps"); -})}; - - -// Response body should have value "mollie" for "connector" -if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'mollie'", function() { - pm.expect(jsonData.connector).to.eql("mollie"); -})}; \ No newline at end of file diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/.event.meta.json deleted file mode 100644 index 688c85746ef..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/.event.meta.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "eventOrder": [ - "event.test.js" - ] -} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/event.test.js deleted file mode 100644 index eecbfd020ff..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/event.test.js +++ /dev/null @@ -1,49 +0,0 @@ -// 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"); -})}; diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/.event.meta.json deleted file mode 100644 index 688c85746ef..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/.event.meta.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "eventOrder": [ - "event.test.js" - ] -} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/event.test.js deleted file mode 100644 index cccd288c0c1..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/event.test.js +++ /dev/null @@ -1,49 +0,0 @@ -// 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"); -})}; \ No newline at end of file diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/.event.meta.json deleted file mode 100644 index 688c85746ef..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/.event.meta.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "eventOrder": [ - "event.test.js" - ] -} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/event.test.js deleted file mode 100644 index 29c895d10a1..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/event.test.js +++ /dev/null @@ -1,71 +0,0 @@ -// 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 "requires_customer_action" for "status" -if (jsonData?.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"); -})}; - - -// 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; -}); - -// Response body should have value "giropay" for "payment_method_type" -if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'giropay'", function() { - pm.expect(jsonData.payment_method_type).to.eql("giropay"); -})}; - - -// Response body should have value "mollie" for "connector" -if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'mollie'", function() { - pm.expect(jsonData.connector).to.eql("mollie"); -})}; \ No newline at end of file diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/.event.meta.json deleted file mode 100644 index 688c85746ef..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/.event.meta.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "eventOrder": [ - "event.test.js" - ] -} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/event.test.js deleted file mode 100644 index eecbfd020ff..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/event.test.js +++ /dev/null @@ -1,49 +0,0 @@ -// 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"); -})}; diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/request.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/request.json deleted file mode 100644 index 87d07a6016b..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/request.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "options": { - "raw": { - "language": "json" - } - }, - "raw_json_formatted": { - "amount": 1000, - "currency": "EUR", - "confirm": false, - "capture_method": "automatic", - "capture_on": "2022-09-10T10:11:12Z", - "amount_to_capture": 1000, - "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", - "billing": { - "address": { - "first_name": "John", - "last_name": "Doe", - "line1": "1467", - "line2": "Harrison Street", - "line3": "Harrison Street", - "city": "San Fransico", - "state": "California", - "zip": "94122", - "country": "DE" - } - }, - "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": "127.0.0.1" - }, - "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" - } - }, - "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" -} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/.event.meta.json deleted file mode 100644 index 688c85746ef..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/.event.meta.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "eventOrder": [ - "event.test.js" - ] -} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/event.test.js deleted file mode 100644 index cccd288c0c1..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/event.test.js +++ /dev/null @@ -1,49 +0,0 @@ -// 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"); -})}; \ No newline at end of file diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/request.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/request.json deleted file mode 100644 index b9ebc1be4aa..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/request.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "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" -} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js index 926fbad9ca3..6c20960e9dc 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js index 5698484c741..55dc35b9128 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json index 2ff9eef254d..50308b15b4c 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json @@ -74,12 +74,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js index 8d2e2e5d1cc..3a866564a45 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json index 6c44ab9d4e0..10b88b51748 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_redirect", "payment_method_type": "ideal", "payment_method_data": { @@ -36,14 +57,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json index e3a89db3642..a1a9aad0d3c 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json @@ -67,12 +67,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/.meta.json new file mode 100644 index 00000000000..69b505c6d86 --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/.meta.json @@ -0,0 +1,3 @@ +{ + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Create/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Create/.event.meta.json new file mode 100644 index 00000000000..0731450e6b2 --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Create/.event.meta.json @@ -0,0 +1,3 @@ +{ + "eventOrder": ["event.test.js"] +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Create/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Create/event.test.js new file mode 100644 index 00000000000..39cbb3ee90e --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Create/event.test.js @@ -0,0 +1,80 @@ +// 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_customer_action" for "status" +if (jsonData?.status) { + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", + function () { + pm.expect(jsonData.status).to.eql("requires_customer_action"); + }, + ); +} + +// Response body should have "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; + }, +); diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Create/request.json similarity index 96% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Create/request.json index 482c165d31b..f18ddd87b34 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/response.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Create/response.json similarity index 100% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/response.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Create/response.json diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Retrieve/.event.meta.json new file mode 100644 index 00000000000..0731450e6b2 --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Retrieve/.event.meta.json @@ -0,0 +1,3 @@ +{ + "eventOrder": ["event.test.js"] +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Retrieve/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Retrieve/event.test.js new file mode 100644 index 00000000000..02ab01502c1 --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Retrieve/event.test.js @@ -0,0 +1,71 @@ +// 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"); + }, + ); +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15- Wallets Paypal/Payments - Retrieve/request.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Retrieve/request.json similarity index 86% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15- Wallets Paypal/Payments - Retrieve/request.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15- Wallets Paypal/Payments - Retrieve/request.json +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/response.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Retrieve/response.json similarity index 100% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/response.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Retrieve/response.json diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/.meta.json similarity index 100% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/.meta.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/.meta.json diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json new file mode 100644 index 00000000000..0731450e6b2 --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json @@ -0,0 +1,3 @@ +{ + "eventOrder": ["event.test.js"] +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Confirm/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Confirm/event.test.js new file mode 100644 index 00000000000..1fa0afa6402 --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Confirm/event.test.js @@ -0,0 +1,83 @@ +// 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 "requires_customer_action" for "status" +if (jsonData?.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"); + }, + ); +} + +// Response body should have "next_action.redirect_to_url" +pm.test( + "[POST]::/payments/:id/confirm - Content check if 'next_action.redirect_to_url' exists", + function () { + pm.expect(typeof jsonData.next_action.redirect_to_url !== "undefined").to.be + .true; + }, +); diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Confirm/request.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Confirm/request.json new file mode 100644 index 00000000000..ec45ef29bb6 --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Confirm/request.json @@ -0,0 +1,57 @@ +{ + "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_json_formatted": { + "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" +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/response.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Confirm/response.json similarity index 100% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/response.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Confirm/response.json diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Create/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Create/.event.meta.json new file mode 100644 index 00000000000..0731450e6b2 --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Create/.event.meta.json @@ -0,0 +1,3 @@ +{ + "eventOrder": ["event.test.js"] +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Create/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Create/event.test.js new file mode 100644 index 00000000000..55dc35b9128 --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Create/event.test.js @@ -0,0 +1,71 @@ +// Validate status 2xx +pm.test("[POST]::/payments - Status code is 2xx", function () { + pm.response.to.be.success; +}); + +// Validate if response header has matching content-type +pm.test("[POST]::/payments - Content-Type is application/json", function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); +}); + +// Validate if response has JSON Body +pm.test("[POST]::/payments - Response has JSON Body", function () { + pm.response.to.have.jsonBody(); +}); + +// Set response object as internal variable +let jsonData = {}; +try { + jsonData = pm.response.json(); +} catch (e) {} + +// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id +if (jsonData?.payment_id) { + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); +} else { + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} + +// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id +if (jsonData?.mandate_id) { + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); +} else { + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} + +// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret +if (jsonData?.client_secret) { + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); +} else { + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} + +// Response body should have value "requires_confirmation" for "status" +if (jsonData?.status) { + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Create/request.json similarity index 97% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Create/request.json index 44a4efa2238..16b4e4adcf9 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Create/request.json @@ -88,12 +88,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/response.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Create/response.json similarity index 100% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/response.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Create/response.json diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json new file mode 100644 index 00000000000..0731450e6b2 --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json @@ -0,0 +1,3 @@ +{ + "eventOrder": ["event.test.js"] +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js new file mode 100644 index 00000000000..9053ddab13b --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js @@ -0,0 +1,71 @@ +// 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"); + }, + ); +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/request.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Retrieve/request.json similarity index 86% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/request.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/request.json +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/response.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Retrieve/response.json similarity index 100% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/response.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Retrieve/response.json diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6- Wallets Paypal/.meta.json similarity index 100% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/.meta.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6- Wallets Paypal/.meta.json diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6- Wallets Paypal/Payments - Confirm/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6- Wallets Paypal/Payments - Confirm/.event.meta.json new file mode 100644 index 00000000000..0731450e6b2 --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6- Wallets Paypal/Payments - Confirm/.event.meta.json @@ -0,0 +1,3 @@ +{ + "eventOrder": ["event.test.js"] +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6- Wallets Paypal/Payments - Confirm/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6- Wallets Paypal/Payments - Confirm/event.test.js new file mode 100644 index 00000000000..276fe995ded --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6- Wallets Paypal/Payments - Confirm/event.test.js @@ -0,0 +1,103 @@ +// 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 "requires_customer_action" for "status" +if (jsonData?.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"); + }, + ); +} + +// 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; + }, +); + +// Response body should have value "paypal" for "payment_method_type" +if (jsonData?.payment_method_type) { + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'paypal'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("paypal"); + }, + ); +} + +// Response body should have value "mollie" for "connector" +if (jsonData?.connector) { + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'mollie'", + function () { + pm.expect(jsonData.connector).to.eql("mollie"); + }, + ); +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15- Wallets Paypal/Payments - Confirm/request.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6- Wallets Paypal/Payments - Confirm/request.json similarity index 68% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15- Wallets Paypal/Payments - Confirm/request.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6- Wallets Paypal/Payments - Confirm/request.json index 136c97f40bd..efa17534b1d 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15- Wallets Paypal/Payments - Confirm/request.json +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6- Wallets Paypal/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "wallet", "payment_method_type": "paypal", "payment_method_data": { @@ -29,14 +50,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/response.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6- Wallets Paypal/Payments - Confirm/response.json similarity index 100% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/response.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6- Wallets Paypal/Payments - Confirm/response.json diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6- Wallets Paypal/Payments - Create/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6- Wallets Paypal/Payments - Create/.event.meta.json new file mode 100644 index 00000000000..0731450e6b2 --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6- Wallets Paypal/Payments - Create/.event.meta.json @@ -0,0 +1,3 @@ +{ + "eventOrder": ["event.test.js"] +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6- Wallets Paypal/Payments - Create/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6- Wallets Paypal/Payments - Create/event.test.js new file mode 100644 index 00000000000..0444324000a --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6- Wallets Paypal/Payments - Create/event.test.js @@ -0,0 +1,71 @@ +// 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"); + }, + ); +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/request.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6- Wallets Paypal/Payments - Create/request.json similarity index 97% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/request.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6- Wallets Paypal/Payments - Create/request.json index 87d07a6016b..0b0c56d2660 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/request.json +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6- Wallets Paypal/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/response.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6- Wallets Paypal/Payments - Create/response.json similarity index 100% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/response.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6- Wallets Paypal/Payments - Create/response.json diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6- Wallets Paypal/Payments - Retrieve/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6- Wallets Paypal/Payments - Retrieve/.event.meta.json new file mode 100644 index 00000000000..0731450e6b2 --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6- Wallets Paypal/Payments - Retrieve/.event.meta.json @@ -0,0 +1,3 @@ +{ + "eventOrder": ["event.test.js"] +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6- Wallets Paypal/Payments - Retrieve/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6- Wallets Paypal/Payments - Retrieve/event.test.js new file mode 100644 index 00000000000..9053ddab13b --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6- Wallets Paypal/Payments - Retrieve/event.test.js @@ -0,0 +1,71 @@ +// 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"); + }, + ); +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/request.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6- Wallets Paypal/Payments - Retrieve/request.json similarity index 86% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/request.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6- Wallets Paypal/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/request.json +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6- Wallets Paypal/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/response.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6- Wallets Paypal/Payments - Retrieve/response.json similarity index 100% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/response.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6- Wallets Paypal/Payments - Retrieve/response.json diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/.meta.json deleted file mode 100644 index 60051ecca22..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/.meta.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] -} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json deleted file mode 100644 index 688c85746ef..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "eventOrder": [ - "event.test.js" - ] -} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js deleted file mode 100644 index 1388cde7c89..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js +++ /dev/null @@ -1,54 +0,0 @@ -// 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_customer_action" for "status" -if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", function() { - pm.expect(jsonData.status).to.eql("requires_customer_action"); -})}; - -// Response body should have "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; -}); diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json deleted file mode 100644 index 688c85746ef..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "eventOrder": [ - "event.test.js" - ] -} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js deleted file mode 100644 index 08ad2d6a233..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js +++ /dev/null @@ -1,51 +0,0 @@ -// 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"); -})}; diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json deleted file mode 100644 index b9ebc1be4aa..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "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" -} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Bank Redirect-Ideal/.meta.json similarity index 100% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/.meta.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Bank Redirect-Ideal/.meta.json diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json new file mode 100644 index 00000000000..0731450e6b2 --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json @@ -0,0 +1,3 @@ +{ + "eventOrder": ["event.test.js"] +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Bank Redirect-Ideal/Payments - Confirm/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Bank Redirect-Ideal/Payments - Confirm/event.test.js new file mode 100644 index 00000000000..7c5bee571d3 --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Bank Redirect-Ideal/Payments - Confirm/event.test.js @@ -0,0 +1,103 @@ +// 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 "requires_customer_action" for "status" +if (jsonData?.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"); + }, + ); +} + +// 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; + }, +); + +// Response body should have value "ideal" for "payment_method_type" +if (jsonData?.payment_method_type) { + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'ideal'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("ideal"); + }, + ); +} + +// Response body should have value "mollie" for "connector" +if (jsonData?.connector) { + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'mollie'", + function () { + pm.expect(jsonData.connector).to.eql("mollie"); + }, + ); +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/request.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Bank Redirect-Ideal/Payments - Confirm/request.json similarity index 72% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/request.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Bank Redirect-Ideal/Payments - Confirm/request.json index 6c44ab9d4e0..10b88b51748 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/request.json +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Bank Redirect-Ideal/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_redirect", "payment_method_type": "ideal", "payment_method_data": { @@ -36,14 +57,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/response.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Bank Redirect-Ideal/Payments - Confirm/response.json similarity index 100% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/response.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Bank Redirect-Ideal/Payments - Confirm/response.json diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Bank Redirect-Ideal/Payments - Create/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Bank Redirect-Ideal/Payments - Create/.event.meta.json new file mode 100644 index 00000000000..0731450e6b2 --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Bank Redirect-Ideal/Payments - Create/.event.meta.json @@ -0,0 +1,3 @@ +{ + "eventOrder": ["event.test.js"] +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Bank Redirect-Ideal/Payments - Create/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Bank Redirect-Ideal/Payments - Create/event.test.js new file mode 100644 index 00000000000..0444324000a --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Bank Redirect-Ideal/Payments - Create/event.test.js @@ -0,0 +1,71 @@ +// 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"); + }, + ); +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/request.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Bank Redirect-Ideal/Payments - Create/request.json similarity index 97% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/request.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Bank Redirect-Ideal/Payments - Create/request.json index 87d07a6016b..0b0c56d2660 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/request.json +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Bank Redirect-Ideal/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/response.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Bank Redirect-Ideal/Payments - Create/response.json similarity index 100% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/response.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Bank Redirect-Ideal/Payments - Create/response.json diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json new file mode 100644 index 00000000000..0731450e6b2 --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json @@ -0,0 +1,3 @@ +{ + "eventOrder": ["event.test.js"] +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Bank Redirect-Ideal/Payments - Retrieve/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Bank Redirect-Ideal/Payments - Retrieve/event.test.js new file mode 100644 index 00000000000..9053ddab13b --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Bank Redirect-Ideal/Payments - Retrieve/event.test.js @@ -0,0 +1,71 @@ +// 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"); + }, + ); +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Bank Redirect-Ideal/Payments - Retrieve/request.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Bank Redirect-Ideal/Payments - Retrieve/request.json new file mode 100644 index 00000000000..6cd4b7d96c5 --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Bank Redirect-Ideal/Payments - Retrieve/request.json @@ -0,0 +1,28 @@ +{ + "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" +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/response.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Bank Redirect-Ideal/Payments - Retrieve/response.json similarity index 100% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/response.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Bank Redirect-Ideal/Payments - Retrieve/response.json diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json deleted file mode 100644 index 688c85746ef..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "eventOrder": [ - "event.test.js" - ] -} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js deleted file mode 100644 index edf87c9ccdf..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js +++ /dev/null @@ -1,57 +0,0 @@ -// 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 "requires_customer_action" for "status" -if (jsonData?.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"); -})}; - -// Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments/:id/confirm - Content check if 'next_action.redirect_to_url' exists", function() { - pm.expect((typeof jsonData.next_action.redirect_to_url !== "undefined")).to.be.true; -}); \ No newline at end of file diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json deleted file mode 100644 index 17048792420..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "options": { - "raw": { - "language": "json" - } - }, - "raw_json_formatted": {} - }, - "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" -} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json deleted file mode 100644 index 688c85746ef..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "eventOrder": [ - "event.test.js" - ] -} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js deleted file mode 100644 index 5698484c741..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js +++ /dev/null @@ -1,49 +0,0 @@ -// Validate status 2xx -pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; -}); - -// Validate if response header has matching content-type -pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); - -// Validate if response has JSON Body -pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); -}); - -// Set response object as internal variable -let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} - -// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id -if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); -} else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - - -// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id -if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); -} else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; - -// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret -if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); -} else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - -// Response body should have value "requires_confirmation" for "status" -if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", function() { - pm.expect(jsonData.status).to.eql("requires_confirmation"); -})}; diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json deleted file mode 100644 index 688c85746ef..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "eventOrder": [ - "event.test.js" - ] -} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js deleted file mode 100644 index cccd288c0c1..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js +++ /dev/null @@ -1,49 +0,0 @@ -// 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"); -})}; \ No newline at end of file diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json deleted file mode 100644 index b9ebc1be4aa..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "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" -} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-sofort/.meta.json similarity index 100% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/.meta.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-sofort/.meta.json diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-sofort/Payments - Confirm/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-sofort/Payments - Confirm/.event.meta.json new file mode 100644 index 00000000000..0731450e6b2 --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-sofort/Payments - Confirm/.event.meta.json @@ -0,0 +1,3 @@ +{ + "eventOrder": ["event.test.js"] +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-sofort/Payments - Confirm/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-sofort/Payments - Confirm/event.test.js new file mode 100644 index 00000000000..9c5473895cd --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-sofort/Payments - Confirm/event.test.js @@ -0,0 +1,103 @@ +// 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 "requires_customer_action" for "status" +if (jsonData?.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"); + }, + ); +} + +// 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; + }, +); + +// Response body should have value "sofort" for "payment_method_type" +if (jsonData?.payment_method_type) { + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'sofort'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("sofort"); + }, + ); +} + +// Response body should have value "mollie" for "connector" +if (jsonData?.connector) { + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'mollie'", + function () { + pm.expect(jsonData.connector).to.eql("mollie"); + }, + ); +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/request.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-sofort/Payments - Confirm/request.json similarity index 72% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/request.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-sofort/Payments - Confirm/request.json index 1b3aca65658..d8c127799e0 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/request.json +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-sofort/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_redirect", "payment_method_type": "sofort", "payment_method_data": { @@ -36,14 +57,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/response.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-sofort/Payments - Confirm/response.json similarity index 100% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/response.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-sofort/Payments - Confirm/response.json diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-sofort/Payments - Create/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-sofort/Payments - Create/.event.meta.json new file mode 100644 index 00000000000..0731450e6b2 --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-sofort/Payments - Create/.event.meta.json @@ -0,0 +1,3 @@ +{ + "eventOrder": ["event.test.js"] +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-sofort/Payments - Create/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-sofort/Payments - Create/event.test.js new file mode 100644 index 00000000000..0444324000a --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-sofort/Payments - Create/event.test.js @@ -0,0 +1,71 @@ +// 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"); + }, + ); +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/request.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-sofort/Payments - Create/request.json similarity index 97% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/request.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-sofort/Payments - Create/request.json index 87d07a6016b..0b0c56d2660 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/request.json +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-sofort/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/response.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-sofort/Payments - Create/response.json similarity index 100% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/response.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-sofort/Payments - Create/response.json diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-sofort/Payments - Retrieve/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-sofort/Payments - Retrieve/.event.meta.json new file mode 100644 index 00000000000..0731450e6b2 --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-sofort/Payments - Retrieve/.event.meta.json @@ -0,0 +1,3 @@ +{ + "eventOrder": ["event.test.js"] +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-sofort/Payments - Retrieve/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-sofort/Payments - Retrieve/event.test.js new file mode 100644 index 00000000000..9053ddab13b --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-sofort/Payments - Retrieve/event.test.js @@ -0,0 +1,71 @@ +// 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"); + }, + ); +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-sofort/Payments - Retrieve/request.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-sofort/Payments - Retrieve/request.json new file mode 100644 index 00000000000..6cd4b7d96c5 --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-sofort/Payments - Retrieve/request.json @@ -0,0 +1,28 @@ +{ + "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" +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/response.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-sofort/Payments - Retrieve/response.json similarity index 100% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/response.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-sofort/Payments - Retrieve/response.json diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario9-Bank Redirect-eps/.meta.json similarity index 100% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/.meta.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario9-Bank Redirect-eps/.meta.json diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario9-Bank Redirect-eps/Payments - Confirm/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario9-Bank Redirect-eps/Payments - Confirm/.event.meta.json new file mode 100644 index 00000000000..0731450e6b2 --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario9-Bank Redirect-eps/Payments - Confirm/.event.meta.json @@ -0,0 +1,3 @@ +{ + "eventOrder": ["event.test.js"] +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario9-Bank Redirect-eps/Payments - Confirm/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario9-Bank Redirect-eps/Payments - Confirm/event.test.js new file mode 100644 index 00000000000..612f740e21f --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario9-Bank Redirect-eps/Payments - Confirm/event.test.js @@ -0,0 +1,103 @@ +// 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 "requires_customer_action" for "status" +if (jsonData?.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"); + }, + ); +} + +// 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; + }, +); + +// Response body should have value "eps" for "payment_method_type" +if (jsonData?.payment_method_type) { + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'eps'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("eps"); + }, + ); +} + +// Response body should have value "mollie" for "connector" +if (jsonData?.connector) { + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'mollie'", + function () { + pm.expect(jsonData.connector).to.eql("mollie"); + }, + ); +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/request.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario9-Bank Redirect-eps/Payments - Confirm/request.json similarity index 72% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/request.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario9-Bank Redirect-eps/Payments - Confirm/request.json index 66d9d486368..451d1c7e9ae 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/request.json +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario9-Bank Redirect-eps/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_redirect", "payment_method_type": "eps", "payment_method_data": { @@ -36,14 +57,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/response.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario9-Bank Redirect-eps/Payments - Confirm/response.json similarity index 100% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/response.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario9-Bank Redirect-eps/Payments - Confirm/response.json diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario9-Bank Redirect-eps/Payments - Create/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario9-Bank Redirect-eps/Payments - Create/.event.meta.json new file mode 100644 index 00000000000..0731450e6b2 --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario9-Bank Redirect-eps/Payments - Create/.event.meta.json @@ -0,0 +1,3 @@ +{ + "eventOrder": ["event.test.js"] +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario9-Bank Redirect-eps/Payments - Create/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario9-Bank Redirect-eps/Payments - Create/event.test.js new file mode 100644 index 00000000000..0444324000a --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario9-Bank Redirect-eps/Payments - Create/event.test.js @@ -0,0 +1,71 @@ +// 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"); + }, + ); +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario9-Bank Redirect-eps/Payments - Create/request.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario9-Bank Redirect-eps/Payments - Create/request.json new file mode 100644 index 00000000000..0b0c56d2660 --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario9-Bank Redirect-eps/Payments - Create/request.json @@ -0,0 +1,88 @@ +{ + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "options": { + "raw": { + "language": "json" + } + }, + "raw_json_formatted": { + "amount": 1000, + "currency": "EUR", + "confirm": false, + "capture_method": "automatic", + "capture_on": "2022-09-10T10:11:12Z", + "amount_to_capture": 1000, + "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", + "billing": { + "address": { + "first_name": "John", + "last_name": "Doe", + "line1": "1467", + "line2": "Harrison Street", + "line3": "Harrison Street", + "city": "San Fransico", + "state": "California", + "zip": "94122", + "country": "DE" + } + }, + "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": "127.0.0.1" + }, + "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" + } + }, + "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" +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/response.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario9-Bank Redirect-eps/Payments - Create/response.json similarity index 100% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/response.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario9-Bank Redirect-eps/Payments - Create/response.json diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario9-Bank Redirect-eps/Payments - Retrieve/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario9-Bank Redirect-eps/Payments - Retrieve/.event.meta.json new file mode 100644 index 00000000000..0731450e6b2 --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario9-Bank Redirect-eps/Payments - Retrieve/.event.meta.json @@ -0,0 +1,3 @@ +{ + "eventOrder": ["event.test.js"] +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario9-Bank Redirect-eps/Payments - Retrieve/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario9-Bank Redirect-eps/Payments - Retrieve/event.test.js new file mode 100644 index 00000000000..9053ddab13b --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario9-Bank Redirect-eps/Payments - Retrieve/event.test.js @@ -0,0 +1,71 @@ +// 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"); + }, + ); +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario9-Bank Redirect-eps/Payments - Retrieve/request.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario9-Bank Redirect-eps/Payments - Retrieve/request.json new file mode 100644 index 00000000000..6cd4b7d96c5 --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario9-Bank Redirect-eps/Payments - Retrieve/request.json @@ -0,0 +1,28 @@ +{ + "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" +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/response.json b/postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario9-Bank Redirect-eps/Payments - Retrieve/response.json similarity index 100% rename from postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/response.json rename to postman/collection-dir/mollie/Flow Testcases/Happy Cases/Scenario9-Bank Redirect-eps/Payments - Retrieve/response.json diff --git a/postman/collection-dir/mollie/Flow Testcases/QuickStart/API Key - Create/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/QuickStart/API Key - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/mollie/Flow Testcases/QuickStart/API Key - Create/.event.meta.json +++ b/postman/collection-dir/mollie/Flow Testcases/QuickStart/API Key - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/mollie/Flow Testcases/QuickStart/API Key - Create/event.test.js b/postman/collection-dir/mollie/Flow Testcases/QuickStart/API Key - Create/event.test.js index bc42e83a761..4e27c5a5025 100644 --- a/postman/collection-dir/mollie/Flow Testcases/QuickStart/API Key - Create/event.test.js +++ b/postman/collection-dir/mollie/Flow Testcases/QuickStart/API Key - Create/event.test.js @@ -1,32 +1,46 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/api_keys/:merchant_id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/api_keys/:merchant_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/api_keys/:merchant_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; try { jsonData = pm.response.json(); -} catch(e) { -} +} catch (e) {} // pm.collectionVariables - Set api_key_id as variable for jsonData.key_id if (jsonData?.key_id) { - pm.collectionVariables.set("api_key_id", jsonData.key_id); - console.log("- use {{api_key_id}} as collection variable for value", jsonData.key_id); + pm.collectionVariables.set("api_key_id", jsonData.key_id); + console.log( + "- use {{api_key_id}} as collection variable for value", + jsonData.key_id, + ); } else { - console.log('INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value", jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} diff --git a/postman/collection-dir/mollie/Flow Testcases/QuickStart/API Key - Create/request.json b/postman/collection-dir/mollie/Flow Testcases/QuickStart/API Key - Create/request.json index 29c2490d1bc..2210d14da0e 100644 --- a/postman/collection-dir/mollie/Flow Testcases/QuickStart/API Key - Create/request.json +++ b/postman/collection-dir/mollie/Flow Testcases/QuickStart/API Key - Create/request.json @@ -35,13 +35,8 @@ }, "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/mollie/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/mollie/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json +++ b/postman/collection-dir/mollie/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/mollie/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js b/postman/collection-dir/mollie/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js index 538b393c084..7de0d5beb31 100644 --- a/postman/collection-dir/mollie/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js +++ b/postman/collection-dir/mollie/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js @@ -1,37 +1,56 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - 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]::/accounts - 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", + ); }); // 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 merchant_id as variable for jsonData.merchant_id if (jsonData?.merchant_id) { - pm.collectionVariables.set("merchant_id", jsonData.merchant_id); - console.log("- use {{merchant_id}} as collection variable for value",jsonData.merchant_id); + pm.collectionVariables.set("merchant_id", jsonData.merchant_id); + console.log( + "- use {{merchant_id}} as collection variable for value", + jsonData.merchant_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value",jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} // pm.collectionVariables - Set publishable_key as variable for jsonData.publishable_key if (jsonData?.publishable_key) { - pm.collectionVariables.set("publishable_key", jsonData.publishable_key); - console.log("- use {{publishable_key}} as collection variable for value",jsonData.publishable_key); + pm.collectionVariables.set("publishable_key", jsonData.publishable_key); + console.log( + "- use {{publishable_key}} as collection variable for value", + jsonData.publishable_key, + ); } else { - console.log('INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.", + ); +} diff --git a/postman/collection-dir/mollie/Flow Testcases/QuickStart/Merchant Account - Create/request.json b/postman/collection-dir/mollie/Flow Testcases/QuickStart/Merchant Account - Create/request.json index ffeea3410a4..dcbf46ee538 100644 --- a/postman/collection-dir/mollie/Flow Testcases/QuickStart/Merchant Account - Create/request.json +++ b/postman/collection-dir/mollie/Flow Testcases/QuickStart/Merchant Account - Create/request.json @@ -84,12 +84,8 @@ }, "url": { "raw": "{{baseUrl}}/accounts", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "accounts" - ] + "host": ["{{baseUrl}}"], + "path": ["accounts"] }, "description": "Create a new account for a merchant. The merchant could be a seller or retailer or client who likes to receive and send payments." } diff --git a/postman/collection-dir/mollie/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/mollie/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json +++ b/postman/collection-dir/mollie/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/mollie/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js b/postman/collection-dir/mollie/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js index b831702461e..88e92d8d84a 100644 --- a/postman/collection-dir/mollie/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js +++ b/postman/collection-dir/mollie/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js @@ -1,21 +1,39 @@ -// Validate status 2xx -pm.test("[POST]::/account/:account_id/connectors - 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.be.success; + }, +); // Validate if response header has matching content-type -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"); -}); +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){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id if (jsonData?.merchant_connector_id) { - pm.collectionVariables.set("merchant_connector_id", jsonData.merchant_connector_id); - console.log("- use {{merchant_connector_id}} as collection variable for value",jsonData.merchant_connector_id); + pm.collectionVariables.set( + "merchant_connector_id", + jsonData.merchant_connector_id, + ); + console.log( + "- use {{merchant_connector_id}} as collection variable for value", + jsonData.merchant_connector_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.", + ); +} diff --git a/postman/collection-dir/mollie/Flow Testcases/QuickStart/Payment Connector - Create/request.json b/postman/collection-dir/mollie/Flow Testcases/QuickStart/Payment Connector - Create/request.json index 88741f13fc3..261baedf10d 100644 --- a/postman/collection-dir/mollie/Flow Testcases/QuickStart/Payment Connector - Create/request.json +++ b/postman/collection-dir/mollie/Flow Testcases/QuickStart/Payment Connector - Create/request.json @@ -253,14 +253,8 @@ }, "url": { "raw": "{{baseUrl}}/account/:account_id/connectors", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/mollie/Flow Testcases/QuickStart/Payments - Create/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/QuickStart/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/mollie/Flow Testcases/QuickStart/Payments - Create/.event.meta.json +++ b/postman/collection-dir/mollie/Flow Testcases/QuickStart/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/mollie/Flow Testcases/QuickStart/Payments - Create/event.test.js b/postman/collection-dir/mollie/Flow Testcases/QuickStart/Payments - Create/event.test.js index 62142d52dca..a6947db94c0 100644 --- a/postman/collection-dir/mollie/Flow Testcases/QuickStart/Payments - Create/event.test.js +++ b/postman/collection-dir/mollie/Flow Testcases/QuickStart/Payments - Create/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/mollie/Flow Testcases/QuickStart/Payments - Create/request.json b/postman/collection-dir/mollie/Flow Testcases/QuickStart/Payments - Create/request.json index 07a024cf10c..1f351ee36bc 100644 --- a/postman/collection-dir/mollie/Flow Testcases/QuickStart/Payments - Create/request.json +++ b/postman/collection-dir/mollie/Flow Testcases/QuickStart/Payments - Create/request.json @@ -94,12 +94,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/mollie/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/mollie/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/mollie/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/mollie/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js b/postman/collection-dir/mollie/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js index 4dd072b2222..d0a02af7436 100644 --- a/postman/collection-dir/mollie/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/mollie/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // 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.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/mollie/Flow Testcases/QuickStart/Payments - Retrieve/request.json b/postman/collection-dir/mollie/Flow Testcases/QuickStart/Payments - Retrieve/request.json index c71774083b2..ef0b213739d 100644 --- a/postman/collection-dir/mollie/Flow Testcases/QuickStart/Payments - Retrieve/request.json +++ b/postman/collection-dir/mollie/Flow Testcases/QuickStart/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/mollie/Flow Testcases/Variation Cases/.meta.json b/postman/collection-dir/mollie/Flow Testcases/Variation Cases/.meta.json index 98030c356ab..a345c00d181 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Variation Cases/.meta.json +++ b/postman/collection-dir/mollie/Flow Testcases/Variation Cases/.meta.json @@ -1,5 +1,3 @@ { - "childrenOrder": [ - "Scenario2-Confirming the payment without PMD" - ] + "childrenOrder": ["Scenario2-Confirming the payment without PMD"] } diff --git a/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario1-Confirming the payment without PMD/.meta.json b/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario1-Confirming the payment without PMD/.meta.json new file mode 100644 index 00000000000..f2bee31ef66 --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario1-Confirming the payment without PMD/.meta.json @@ -0,0 +1,3 @@ +{ + "childrenOrder": ["Payments - Create", "Payments - Confirm"] +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario1-Confirming the payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario1-Confirming the payment without PMD/Payments - Confirm/.event.meta.json new file mode 100644 index 00000000000..0731450e6b2 --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario1-Confirming the payment without PMD/Payments - Confirm/.event.meta.json @@ -0,0 +1,3 @@ +{ + "eventOrder": ["event.test.js"] +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario1-Confirming the payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario1-Confirming the payment without PMD/Payments - Confirm/event.test.js new file mode 100644 index 00000000000..e8d6b2216c5 --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario1-Confirming the payment without PMD/Payments - Confirm/event.test.js @@ -0,0 +1,82 @@ +// 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 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 "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"); + }, + ); +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario1-Confirming the payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario1-Confirming the payment without PMD/Payments - Confirm/request.json new file mode 100644 index 00000000000..ec45ef29bb6 --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario1-Confirming the payment without PMD/Payments - Confirm/request.json @@ -0,0 +1,57 @@ +{ + "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_json_formatted": { + "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" +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/response.json b/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario1-Confirming the payment without PMD/Payments - Confirm/response.json similarity index 100% rename from postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/response.json rename to postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario1-Confirming the payment without PMD/Payments - Confirm/response.json diff --git a/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario1-Confirming the payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario1-Confirming the payment without PMD/Payments - Create/.event.meta.json new file mode 100644 index 00000000000..0731450e6b2 --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario1-Confirming the payment without PMD/Payments - Create/.event.meta.json @@ -0,0 +1,3 @@ +{ + "eventOrder": ["event.test.js"] +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario1-Confirming the payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario1-Confirming the payment without PMD/Payments - Create/event.test.js new file mode 100644 index 00000000000..0444324000a --- /dev/null +++ b/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario1-Confirming the payment without PMD/Payments - Create/event.test.js @@ -0,0 +1,71 @@ +// 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"); + }, + ); +} diff --git a/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json b/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario1-Confirming the payment without PMD/Payments - Create/request.json similarity index 96% rename from postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json rename to postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario1-Confirming the payment without PMD/Payments - Create/request.json index b28abd0c309..e3b1e235042 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario1-Confirming the payment without PMD/Payments - Create/request.json @@ -67,12 +67,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/response.json b/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario1-Confirming the payment without PMD/Payments - Create/response.json similarity index 100% rename from postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/response.json rename to postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario1-Confirming the payment without PMD/Payments - Create/response.json diff --git a/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json b/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json deleted file mode 100644 index 90b19864ee1..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "childrenOrder": [ - "Payments - Create", - "Payments - Confirm" - ] -} diff --git a/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json deleted file mode 100644 index 688c85746ef..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "eventOrder": [ - "event.test.js" - ] -} diff --git a/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js deleted file mode 100644 index 1e8ba8cc3a6..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js +++ /dev/null @@ -1,58 +0,0 @@ -// 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 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 "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"); -})}; \ No newline at end of file diff --git a/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json deleted file mode 100644 index 688c85746ef..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "eventOrder": [ - "event.test.js" - ] -} diff --git a/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js deleted file mode 100644 index eecbfd020ff..00000000000 --- a/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js +++ /dev/null @@ -1,49 +0,0 @@ -// 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"); -})}; diff --git a/postman/collection-dir/mollie/Health check/.meta.json b/postman/collection-dir/mollie/Health check/.meta.json index 66ee7e50cab..579f9fd541c 100644 --- a/postman/collection-dir/mollie/Health check/.meta.json +++ b/postman/collection-dir/mollie/Health check/.meta.json @@ -1,5 +1,3 @@ { - "childrenOrder": [ - "New Request" - ] + "childrenOrder": ["New Request"] } diff --git a/postman/collection-dir/mollie/Health check/New Request/.event.meta.json b/postman/collection-dir/mollie/Health check/New Request/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/mollie/Health check/New Request/.event.meta.json +++ b/postman/collection-dir/mollie/Health check/New Request/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/mollie/Health check/New Request/event.test.js b/postman/collection-dir/mollie/Health check/New Request/event.test.js index 325a8c8a479..b490b8be090 100644 --- a/postman/collection-dir/mollie/Health check/New Request/event.test.js +++ b/postman/collection-dir/mollie/Health check/New Request/event.test.js @@ -1,4 +1,4 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - Status code is 2xx", function () { - pm.response.to.be.success; -}); \ No newline at end of file + pm.response.to.be.success; +}); diff --git a/postman/collection-dir/mollie/Health check/New Request/request.json b/postman/collection-dir/mollie/Health check/New Request/request.json index 4cc8d4b1a96..e40e9396178 100644 --- a/postman/collection-dir/mollie/Health check/New Request/request.json +++ b/postman/collection-dir/mollie/Health check/New Request/request.json @@ -10,11 +10,7 @@ ], "url": { "raw": "{{baseUrl}}/health", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "health" - ] + "host": ["{{baseUrl}}"], + "path": ["health"] } } diff --git a/postman/collection-dir/mollie/event.test.js b/postman/collection-dir/mollie/event.test.js index 69037688f22..fb52caec30f 100644 --- a/postman/collection-dir/mollie/event.test.js +++ b/postman/collection-dir/mollie/event.test.js @@ -1,11 +1,13 @@ // 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("[LOG]::payment_id - " + jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log("[LOG]::payment_id - " + jsonData.payment_id); } -console.log("[LOG]::x-request-id - " + pm.response.headers.get('x-request-id')); \ No newline at end of file +console.log("[LOG]::x-request-id - " + pm.response.headers.get("x-request-id")); diff --git a/postman/collection-dir/multisafepay/.event.meta.json b/postman/collection-dir/multisafepay/.event.meta.json index 2df9d47d936..eb871bbcb9b 100644 --- a/postman/collection-dir/multisafepay/.event.meta.json +++ b/postman/collection-dir/multisafepay/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.prerequest.js", - "event.test.js" - ] + "eventOrder": ["event.prerequest.js", "event.test.js"] } diff --git a/postman/collection-dir/multisafepay/.meta.json b/postman/collection-dir/multisafepay/.meta.json index 91b6a65c5bc..d513035ce2d 100644 --- a/postman/collection-dir/multisafepay/.meta.json +++ b/postman/collection-dir/multisafepay/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Health check", - "Flow Testcases" - ] + "childrenOrder": ["Health check", "Flow Testcases"] } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/.meta.json b/postman/collection-dir/multisafepay/Flow Testcases/.meta.json index 1bbce843680..023989e1e49 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/.meta.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/.meta.json @@ -1,7 +1,3 @@ { - "childrenOrder": [ - "QuickStart", - "Happy Cases", - "Variation Cases" - ] + "childrenOrder": ["QuickStart", "Happy Cases", "Variation Cases"] } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario1-Create payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario1-Create payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario1-Create payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario1-Create payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario1-Create payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario1-Create payment without PMD/Payments - Confirm/event.test.js index b9c3e1eb341..2566308f248 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario1-Create payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario1-Create payment without PMD/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id/confirm - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("requires_customer_action"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id/confirm - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("requires_customer_action"); + }, + ); +} diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario1-Create payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario1-Create payment without PMD/Payments - Confirm/request.json index bb2b0cdc1b0..402aa25fef8 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario1-Create payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario1-Create payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "card", "payment_method_data": { "card": { @@ -32,14 +53,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario1-Create payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario1-Create payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario1-Create payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario1-Create payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario1-Create payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario1-Create payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario1-Create payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario1-Create payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario1-Create payment without PMD/Payments - Create/request.json b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario1-Create payment without PMD/Payments - Create/request.json index 42ca6b72bf1..c5477359f31 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario1-Create payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario1-Create payment without PMD/Payments - Create/request.json @@ -69,12 +69,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario1-Create payment without PMD/Payments - Retrieve/.event.meta.json b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario1-Create payment without PMD/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario1-Create payment without PMD/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario1-Create payment without PMD/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario1-Create payment without PMD/Payments - Retrieve/event.test.js b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario1-Create payment without PMD/Payments - Retrieve/event.test.js index 045d4d0e3a2..bf220adc0a5 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario1-Create payment without PMD/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario1-Create payment without PMD/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("requires_customer_action"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("requires_customer_action"); + }, + ); +} diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario1-Create payment without PMD/Payments - Retrieve/request.json b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario1-Create payment without PMD/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario1-Create payment without PMD/Payments - Retrieve/request.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario1-Create payment without PMD/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario2-Create 3DS payment/.meta.json b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario2-Create 3DS payment/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario2-Create 3DS payment/.meta.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario2-Create 3DS payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario2-Create 3DS payment/Payments - Create/.event.meta.json b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario2-Create 3DS payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario2-Create 3DS payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario2-Create 3DS payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario2-Create 3DS payment/Payments - Create/event.test.js b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario2-Create 3DS payment/Payments - Create/event.test.js index 1388cde7c89..39cbb3ee90e 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario2-Create 3DS payment/Payments - Create/event.test.js +++ b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario2-Create 3DS payment/Payments - Create/event.test.js @@ -1,54 +1,80 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", function() { - pm.expect(jsonData.status).to.eql("requires_customer_action"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", + function () { + pm.expect(jsonData.status).to.eql("requires_customer_action"); + }, + ); +} // Response body should have "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; -}); +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; + }, +); diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario2-Create 3DS payment/Payments - Create/request.json b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario2-Create 3DS payment/Payments - Create/request.json index 698d307997a..bfc4f1e1b94 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario2-Create 3DS payment/Payments - Create/request.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario2-Create 3DS payment/Payments - Create/request.json @@ -79,12 +79,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario2-Create 3DS payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario2-Create 3DS payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario2-Create 3DS payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario2-Create 3DS payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario2-Create 3DS payment/Payments - Retrieve/event.test.js b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario2-Create 3DS payment/Payments - Retrieve/event.test.js index 08ad2d6a233..02ab01502c1 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario2-Create 3DS payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario2-Create 3DS payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + 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"); + }, + ); +} diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario2-Create 3DS payment/Payments - Retrieve/request.json b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario2-Create 3DS payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario2-Create 3DS payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario2-Create 3DS payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario3-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario3-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario3-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario3-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario3-Create 3DS payment with confrm false/Payments - Confirm/event.test.js b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario3-Create 3DS payment with confrm false/Payments - Confirm/event.test.js index edf87c9ccdf..1fa0afa6402 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario3-Create 3DS payment with confrm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario3-Create 3DS payment with confrm false/Payments - Confirm/event.test.js @@ -1,57 +1,83 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments/:id/confirm - Content check if 'next_action.redirect_to_url' exists", function() { - pm.expect((typeof jsonData.next_action.redirect_to_url !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments/:id/confirm - Content check if 'next_action.redirect_to_url' exists", + function () { + pm.expect(typeof jsonData.next_action.redirect_to_url !== "undefined").to.be + .true; + }, +); diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario3-Create 3DS payment with confrm false/Payments - Confirm/request.json b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario3-Create 3DS payment with confrm false/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario3-Create 3DS payment with confrm false/Payments - Confirm/request.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario3-Create 3DS payment with confrm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario3-Create 3DS payment with confrm false/Payments - Create/.event.meta.json b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario3-Create 3DS payment with confrm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario3-Create 3DS payment with confrm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario3-Create 3DS payment with confrm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario3-Create 3DS payment with confrm false/Payments - Create/event.test.js b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario3-Create 3DS payment with confrm false/Payments - Create/event.test.js index 5698484c741..55dc35b9128 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario3-Create 3DS payment with confrm false/Payments - Create/event.test.js +++ b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario3-Create 3DS payment with confrm false/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario3-Create 3DS payment with confrm false/Payments - Create/request.json b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario3-Create 3DS payment with confrm false/Payments - Create/request.json index 06e65a351f8..4aaedb5bbcc 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario3-Create 3DS payment with confrm false/Payments - Create/request.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario3-Create 3DS payment with confrm false/Payments - Create/request.json @@ -79,12 +79,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario3-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario3-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario3-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario3-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario3-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario3-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario3-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario3-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario3-Create 3DS payment with confrm false/Payments - Retrieve/request.json b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario3-Create 3DS payment with confrm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario3-Create 3DS payment with confrm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Happy Cases/Scenario3-Create 3DS payment with confrm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/API Key - Create/.event.meta.json b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/API Key - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/API Key - Create/.event.meta.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/API Key - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/API Key - Create/event.test.js b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/API Key - Create/event.test.js index bc42e83a761..4e27c5a5025 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/API Key - Create/event.test.js +++ b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/API Key - Create/event.test.js @@ -1,32 +1,46 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/api_keys/:merchant_id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/api_keys/:merchant_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/api_keys/:merchant_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; try { jsonData = pm.response.json(); -} catch(e) { -} +} catch (e) {} // pm.collectionVariables - Set api_key_id as variable for jsonData.key_id if (jsonData?.key_id) { - pm.collectionVariables.set("api_key_id", jsonData.key_id); - console.log("- use {{api_key_id}} as collection variable for value", jsonData.key_id); + pm.collectionVariables.set("api_key_id", jsonData.key_id); + console.log( + "- use {{api_key_id}} as collection variable for value", + jsonData.key_id, + ); } else { - console.log('INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value", jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} diff --git a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/API Key - Create/request.json b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/API Key - Create/request.json index 29c2490d1bc..2210d14da0e 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/API Key - Create/request.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/API Key - Create/request.json @@ -35,13 +35,8 @@ }, "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js index 538b393c084..7de0d5beb31 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js +++ b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js @@ -1,37 +1,56 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - 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]::/accounts - 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", + ); }); // 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 merchant_id as variable for jsonData.merchant_id if (jsonData?.merchant_id) { - pm.collectionVariables.set("merchant_id", jsonData.merchant_id); - console.log("- use {{merchant_id}} as collection variable for value",jsonData.merchant_id); + pm.collectionVariables.set("merchant_id", jsonData.merchant_id); + console.log( + "- use {{merchant_id}} as collection variable for value", + jsonData.merchant_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value",jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} // pm.collectionVariables - Set publishable_key as variable for jsonData.publishable_key if (jsonData?.publishable_key) { - pm.collectionVariables.set("publishable_key", jsonData.publishable_key); - console.log("- use {{publishable_key}} as collection variable for value",jsonData.publishable_key); + pm.collectionVariables.set("publishable_key", jsonData.publishable_key); + console.log( + "- use {{publishable_key}} as collection variable for value", + jsonData.publishable_key, + ); } else { - console.log('INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.", + ); +} diff --git a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Merchant Account - Create/request.json b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Merchant Account - Create/request.json index dcb4ad8adf2..d9fce823087 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Merchant Account - Create/request.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Merchant Account - Create/request.json @@ -75,7 +75,7 @@ "payment_succeeded_enabled": true, "payment_failed_enabled": true }, - + "sub_merchants_enabled": false, "metadata": { "city": "NY", @@ -85,12 +85,8 @@ }, "url": { "raw": "{{baseUrl}}/accounts", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "accounts" - ] + "host": ["{{baseUrl}}"], + "path": ["accounts"] }, "description": "Create a new account for a merchant. The merchant could be a seller or retailer or client who likes to receive and send payments." } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js index b831702461e..88e92d8d84a 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js +++ b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js @@ -1,21 +1,39 @@ -// Validate status 2xx -pm.test("[POST]::/account/:account_id/connectors - 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.be.success; + }, +); // Validate if response header has matching content-type -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"); -}); +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){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id if (jsonData?.merchant_connector_id) { - pm.collectionVariables.set("merchant_connector_id", jsonData.merchant_connector_id); - console.log("- use {{merchant_connector_id}} as collection variable for value",jsonData.merchant_connector_id); + pm.collectionVariables.set( + "merchant_connector_id", + jsonData.merchant_connector_id, + ); + console.log( + "- use {{merchant_connector_id}} as collection variable for value", + jsonData.merchant_connector_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.", + ); +} diff --git a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payment Connector - Create/request.json b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payment Connector - Create/request.json index 1caf082bffd..7aae2bd2c01 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payment Connector - Create/request.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payment Connector - Create/request.json @@ -259,10 +259,7 @@ { "type": "CARD", "parameters": { - "allowed_auth_methods": [ - "PAN_ONLY", - "CRYPTOGRAM_3DS" - ], + "allowed_auth_methods": ["PAN_ONLY", "CRYPTOGRAM_3DS"], "allowed_card_networks": [ "AMEX", "DISCOVER", @@ -290,14 +287,8 @@ }, "url": { "raw": "{{baseUrl}}/account/:account_id/connectors", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payments - Create/.event.meta.json b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payments - Create/.event.meta.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payments - Create/event.test.js b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payments - Create/event.test.js index 62142d52dca..a6947db94c0 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payments - Create/event.test.js +++ b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payments - Create/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payments - Create/request.json b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payments - Create/request.json index c2ec0e0a752..289e780a72c 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payments - Create/request.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payments - Create/request.json @@ -79,12 +79,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js index 4dd072b2222..d0a02af7436 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // 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.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payments - Retrieve/request.json b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payments - Retrieve/request.json index c71774083b2..ef0b213739d 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payments - Retrieve/request.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Refunds - Create/event.test.js b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Refunds - Create/event.test.js index 30f2510992a..33e9e001baf 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Refunds - Create/event.test.js +++ b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Refunds - Create/event.test.js @@ -1,27 +1,42 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - Status code is 2xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have an error message as we try to refund a "processing" payment if (jsonData?.error) { - pm.test("[POST]::/payments - Content check if error type is 'invalid_request'", function() { - pm.expect(jsonData.error.message).to.eql("The payment has not succeeded yet. Please pass a successful payment to initiate refund"); -})}; + pm.test( + "[POST]::/payments - Content check if error type is 'invalid_request'", + function () { + pm.expect(jsonData.error.message).to.eql( + "The payment has not succeeded yet. Please pass a successful payment to initiate refund", + ); + }, + ); +} diff --git a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Refunds - Create/request.json b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Refunds - Create/request.json index 4dbca4d01f2..0c13281ee15 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Refunds - Create/request.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js index e6234f27afe..6b122d1df53 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js @@ -1,28 +1,40 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - Status code is 2xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have an error message as we try to retrieve refund that doesn't exist if (jsonData?.error) { - pm.test("[POST]::/payments - Content check if error type is 'invalid_request'", function() { - pm.expect(jsonData.error.message).to.eql("Unrecognized request URL"); -})}; - + pm.test( + "[POST]::/payments - Content check if error type is 'invalid_request'", + function () { + pm.expect(jsonData.error.message).to.eql("Unrecognized request URL"); + }, + ); +} diff --git a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Refunds - Retrieve/request.json b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Refunds - Retrieve/request.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js index 08f14e045be..edb1f073bee 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js @@ -1,54 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json index 658dedae682..02ce8dc892b 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json @@ -79,12 +79,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js index 7d118e2f5e5..edb1f073bee 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js @@ -1,56 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); - // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json index b769f21b2ef..b38f47d3cbd 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json @@ -79,12 +79,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js index 0e6401222ff..52680771c31 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js @@ -1,55 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector_error'", function() { - pm.expect(jsonData.error.type).to.eql("connector_error"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'", + function () { + pm.expect(jsonData.error.type).to.eql("connector_error"); + }, + ); +} diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json index 0a16b975817..c7ad4cb2749 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json @@ -75,12 +75,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js index ab9532fab05..c1dffb25d86 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js @@ -1,55 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json index 79a70e782fc..d68379f9444 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json index 90b19864ee1..f2bee31ef66 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Confirm" - ] + "childrenOrder": ["Payments - Create", "Payments - Confirm"] } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js index 1e8ba8cc3a6..e8d6b2216c5 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js @@ -1,58 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); -}); - - +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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json index 69bb03ec9f6..7b1b714241d 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json @@ -69,12 +69,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario4-Refund for unsuccessful payment/Payments - Create/.event.meta.json b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario4-Refund for unsuccessful payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario4-Refund for unsuccessful payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario4-Refund for unsuccessful payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario4-Refund for unsuccessful payment/Payments - Create/event.test.js b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario4-Refund for unsuccessful payment/Payments - Create/event.test.js index 65232a76373..55dc35b9128 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario4-Refund for unsuccessful payment/Payments - Create/event.test.js +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario4-Refund for unsuccessful payment/Payments - Create/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; - - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario4-Refund for unsuccessful payment/Payments - Create/request.json b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario4-Refund for unsuccessful payment/Payments - Create/request.json index 3e0dd32ca20..a14bc349aa3 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario4-Refund for unsuccessful payment/Payments - Create/request.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario4-Refund for unsuccessful payment/Payments - Create/request.json @@ -79,12 +79,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario4-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario4-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario4-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario4-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario4-Refund for unsuccessful payment/Payments - Retrieve/event.test.js b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario4-Refund for unsuccessful payment/Payments - Retrieve/event.test.js index 42bf3e0ac45..fdb8a946f3d 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario4-Refund for unsuccessful payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario4-Refund for unsuccessful payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario4-Refund for unsuccessful payment/Payments - Retrieve/request.json b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario4-Refund for unsuccessful payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario4-Refund for unsuccessful payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario4-Refund for unsuccessful payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario4-Refund for unsuccessful payment/Refunds - Create/.event.meta.json b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario4-Refund for unsuccessful payment/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario4-Refund for unsuccessful payment/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario4-Refund for unsuccessful payment/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario4-Refund for unsuccessful payment/Refunds - Create/event.test.js b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario4-Refund for unsuccessful payment/Refunds - Create/event.test.js index 30888b5cc0c..d3c4451760d 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario4-Refund for unsuccessful payment/Refunds - Create/event.test.js +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario4-Refund for unsuccessful payment/Refunds - Create/event.test.js @@ -1,32 +1,48 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/refunds - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + 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; -}); +pm.test( + "[POST]::/payments/:id/confirm - Content check if 'error' exists", + function () { + pm.expect(typeof jsonData.error !== "undefined").to.be.true; + }, +); // Response body should have value "invalid_request" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; + pm.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"); + }, + ); +} diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario4-Refund for unsuccessful payment/Refunds - Create/request.json b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario4-Refund for unsuccessful payment/Refunds - Create/request.json index d18aaf8befd..9fe125ce8ea 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario4-Refund for unsuccessful payment/Refunds - Create/request.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario4-Refund for unsuccessful payment/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario5-Create a recurring payment with greater mandate amount/Payments - Create/.event.meta.json b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario5-Create a recurring payment with greater mandate amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario5-Create a recurring payment with greater mandate amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario5-Create a recurring payment with greater mandate amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario5-Create a recurring payment with greater mandate amount/Payments - Create/event.test.js b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario5-Create a recurring payment with greater mandate amount/Payments - Create/event.test.js index 33da02b8b0a..bb62a9c0d4c 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario5-Create a recurring payment with greater mandate amount/Payments - Create/event.test.js +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario5-Create a recurring payment with greater mandate amount/Payments - Create/event.test.js @@ -1,60 +1,87 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("requires_customer_action"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("requires_customer_action"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario5-Create a recurring payment with greater mandate amount/Payments - Create/request.json b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario5-Create a recurring payment with greater mandate amount/Payments - Create/request.json index dd907e038f7..011e150c4ec 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario5-Create a recurring payment with greater mandate amount/Payments - Create/request.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario5-Create a recurring payment with greater mandate amount/Payments - Create/request.json @@ -96,12 +96,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario5-Create a recurring payment with greater mandate amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario5-Create a recurring payment with greater mandate amount/Payments - Retrieve/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario5-Create a recurring payment with greater mandate amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario5-Create a recurring payment with greater mandate amount/Payments - Retrieve/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario5-Create a recurring payment with greater mandate amount/Payments - Retrieve/event.test.js b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario5-Create a recurring payment with greater mandate amount/Payments - Retrieve/event.test.js index 459ba9e54a0..2a7927a5b08 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario5-Create a recurring payment with greater mandate amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario5-Create a recurring payment with greater mandate amount/Payments - Retrieve/event.test.js @@ -1,61 +1,87 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("requires_customer_action"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("requires_customer_action"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +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; -}); \ No newline at end of file +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario5-Create a recurring payment with greater mandate amount/Payments - Retrieve/request.json b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario5-Create a recurring payment with greater mandate amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario5-Create a recurring payment with greater mandate amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario5-Create a recurring payment with greater mandate amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario5-Create a recurring payment with greater mandate amount/Recurring Payments - Create/.event.meta.json b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario5-Create a recurring payment with greater mandate amount/Recurring Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario5-Create a recurring payment with greater mandate amount/Recurring Payments - Create/.event.meta.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario5-Create a recurring payment with greater mandate amount/Recurring Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario5-Create a recurring payment with greater mandate amount/Recurring Payments - Create/event.test.js b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario5-Create a recurring payment with greater mandate amount/Recurring Payments - Create/event.test.js index 22617f827cf..e862404c2b2 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario5-Create a recurring payment with greater mandate amount/Recurring Payments - Create/event.test.js +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario5-Create a recurring payment with greater mandate amount/Recurring Payments - Create/event.test.js @@ -1,56 +1,79 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/confirm - Content check if 'error' exists", + function () { + pm.expect(typeof jsonData.error !== "undefined").to.be.true; + }, +); // Response body should have value "invalid_request" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; - - + pm.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"); + }, + ); +} diff --git a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario5-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario5-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json index d2c4a106d65..8fc4831ccc3 100644 --- a/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario5-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json +++ b/postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario5-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json @@ -69,12 +69,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/multisafepay/Health check/.meta.json b/postman/collection-dir/multisafepay/Health check/.meta.json index 66ee7e50cab..579f9fd541c 100644 --- a/postman/collection-dir/multisafepay/Health check/.meta.json +++ b/postman/collection-dir/multisafepay/Health check/.meta.json @@ -1,5 +1,3 @@ { - "childrenOrder": [ - "New Request" - ] + "childrenOrder": ["New Request"] } diff --git a/postman/collection-dir/multisafepay/Health check/New Request/.event.meta.json b/postman/collection-dir/multisafepay/Health check/New Request/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/multisafepay/Health check/New Request/.event.meta.json +++ b/postman/collection-dir/multisafepay/Health check/New Request/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/multisafepay/Health check/New Request/event.test.js b/postman/collection-dir/multisafepay/Health check/New Request/event.test.js index 325a8c8a479..b490b8be090 100644 --- a/postman/collection-dir/multisafepay/Health check/New Request/event.test.js +++ b/postman/collection-dir/multisafepay/Health check/New Request/event.test.js @@ -1,4 +1,4 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - Status code is 2xx", function () { - pm.response.to.be.success; -}); \ No newline at end of file + pm.response.to.be.success; +}); diff --git a/postman/collection-dir/multisafepay/Health check/New Request/request.json b/postman/collection-dir/multisafepay/Health check/New Request/request.json index 4cc8d4b1a96..e40e9396178 100644 --- a/postman/collection-dir/multisafepay/Health check/New Request/request.json +++ b/postman/collection-dir/multisafepay/Health check/New Request/request.json @@ -10,11 +10,7 @@ ], "url": { "raw": "{{baseUrl}}/health", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "health" - ] + "host": ["{{baseUrl}}"], + "path": ["health"] } } diff --git a/postman/collection-dir/multisafepay/event.test.js b/postman/collection-dir/multisafepay/event.test.js index 69037688f22..fb52caec30f 100644 --- a/postman/collection-dir/multisafepay/event.test.js +++ b/postman/collection-dir/multisafepay/event.test.js @@ -1,11 +1,13 @@ // 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("[LOG]::payment_id - " + jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log("[LOG]::payment_id - " + jsonData.payment_id); } -console.log("[LOG]::x-request-id - " + pm.response.headers.get('x-request-id')); \ No newline at end of file +console.log("[LOG]::x-request-id - " + pm.response.headers.get("x-request-id")); diff --git a/postman/collection-dir/nexinets/.event.meta.json b/postman/collection-dir/nexinets/.event.meta.json index 2df9d47d936..eb871bbcb9b 100644 --- a/postman/collection-dir/nexinets/.event.meta.json +++ b/postman/collection-dir/nexinets/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.prerequest.js", - "event.test.js" - ] + "eventOrder": ["event.prerequest.js", "event.test.js"] } diff --git a/postman/collection-dir/nexinets/.meta.json b/postman/collection-dir/nexinets/.meta.json index 91b6a65c5bc..d513035ce2d 100644 --- a/postman/collection-dir/nexinets/.meta.json +++ b/postman/collection-dir/nexinets/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Health check", - "Flow Testcases" - ] + "childrenOrder": ["Health check", "Flow Testcases"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/.meta.json b/postman/collection-dir/nexinets/Flow Testcases/.meta.json index 1bbce843680..023989e1e49 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/.meta.json @@ -1,7 +1,3 @@ { - "childrenOrder": [ - "QuickStart", - "Happy Cases", - "Variation Cases" - ] + "childrenOrder": ["QuickStart", "Happy Cases", "Variation Cases"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js index 72f142cc731..c48d8e2d054 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json index d7d23febca4..843e246d980 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js index c5bae16750d..c48d8e2d054 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json index d7d23febca4..843e246d980 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js index 01c5b744eac..4974bba662f 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js @@ -1,58 +1,76 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "refunds" -pm.test("[POST]::/payments - Content check if 'refunds' exists", function() { - pm.expect((typeof jsonData.refunds !== "undefined")).to.be.true; +pm.test("[POST]::/payments - Content check if 'refunds' exists", function () { + pm.expect(typeof jsonData.refunds !== "undefined").to.be.true; }); - - - diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js index d28f25fa46d..56ea9efbac0 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "1000" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '1000'", function() { - pm.expect(jsonData.amount).to.eql(1000); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '1000'", + function () { + pm.expect(jsonData.amount).to.eql(1000); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json index b56057fad5d..caed7818578 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js index 04650f547a2..c1dd16a4551 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '540'", function() { - pm.expect(jsonData.amount).to.eql(540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '540'", + function () { + pm.expect(jsonData.amount).to.eql(540); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json index d18aaf8befd..9fe125ce8ea 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js index bfe3137afb0..f0351c05701 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '1000'", function() { - pm.expect(jsonData.amount).to.eql(1000); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '1000'", + function () { + pm.expect(jsonData.amount).to.eql(1000); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js index 7bff0a3c12c..920a7c47f36 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '540'", function() { - pm.expect(jsonData.amount).to.eql(540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '540'", + function () { + pm.expect(jsonData.amount).to.eql(540); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/event.test.js index 39fb594007f..08bb60b9f1b 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "ideal" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'ideal'", function() { - pm.expect(jsonData.payment_method_type).to.eql("ideal"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'ideal'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("ideal"); + }, + ); +} // Response body should have value "stripe" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'nexinets'", function() { - pm.expect(jsonData.connector).to.eql("nexinets"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'nexinets'", + function () { + pm.expect(jsonData.connector).to.eql("nexinets"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/request.json index 418f79b7515..5839ca82a19 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_redirect", "payment_method_type": "ideal", "payment_method_data": { @@ -34,14 +55,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/request.json index e69a6d295d9..5a24d5e6aea 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/event.test.js index cabdb52d9df..1c893260ca0 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "sofort" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'sofort'", function() { - pm.expect(jsonData.payment_method_type).to.eql("sofort"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'sofort'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("sofort"); + }, + ); +} // Response body should have value "nexinets" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", function() { - pm.expect(jsonData.connector).to.eql("nexinets"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", + function () { + pm.expect(jsonData.connector).to.eql("nexinets"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/request.json index 1b3aca65658..d8c127799e0 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_redirect", "payment_method_type": "sofort", "payment_method_data": { @@ -36,14 +57,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/request.json index 87d07a6016b..0b0c56d2660 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario18-Wallet paypal/Payments - Confirm/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario18-Wallet paypal/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario18-Wallet paypal/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario18-Wallet paypal/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario18-Wallet paypal/Payments - Confirm/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario18-Wallet paypal/Payments - Confirm/event.test.js index 4d4d6184c19..8b2e477dee7 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario18-Wallet paypal/Payments - Confirm/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario18-Wallet paypal/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "giropay" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'paypal'", function() { - pm.expect(jsonData.payment_method_type).to.eql("paypal"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'paypal'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("paypal"); + }, + ); +} // Response body should have value "nexinets" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'nexinets'", function() { - pm.expect(jsonData.connector).to.eql("nexinets"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'nexinets'", + function () { + pm.expect(jsonData.connector).to.eql("nexinets"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario18-Wallet paypal/Payments - Confirm/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario18-Wallet paypal/Payments - Confirm/request.json index 136c97f40bd..efa17534b1d 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario18-Wallet paypal/Payments - Confirm/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario18-Wallet paypal/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "wallet", "payment_method_type": "paypal", "payment_method_data": { @@ -29,14 +50,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario18-Wallet paypal/Payments - Create/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario18-Wallet paypal/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario18-Wallet paypal/Payments - Create/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario18-Wallet paypal/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario18-Wallet paypal/Payments - Create/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario18-Wallet paypal/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario18-Wallet paypal/Payments - Create/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario18-Wallet paypal/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario18-Wallet paypal/Payments - Create/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario18-Wallet paypal/Payments - Create/request.json index 64d911e1f9f..0275e144ea4 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario18-Wallet paypal/Payments - Create/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario18-Wallet paypal/Payments - Create/request.json @@ -79,12 +79,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario18-Wallet paypal/Payments - Retrieve/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario18-Wallet paypal/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario18-Wallet paypal/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario18-Wallet paypal/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario18-Wallet paypal/Payments - Retrieve/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario18-Wallet paypal/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario18-Wallet paypal/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario18-Wallet paypal/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario18-Wallet paypal/Payments - Retrieve/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario18-Wallet paypal/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario18-Wallet paypal/Payments - Retrieve/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario18-Wallet paypal/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js index bb50904fd89..f92fba3d044 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js index 5698484c741..55dc35b9128 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json index e659f101e70..39111980eb3 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js index 03ccae1adb0..aced67dbfb7 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js index 5d9e5785e6e..6d812bc75fe 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id/confirm - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id/confirm - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json index cdd7011d91d..fa3d242125d 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "card", "payment_method_data": { "card": { @@ -32,14 +53,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json index e3a89db3642..a1a9aad0d3c 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json @@ -67,12 +67,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js index 03ccae1adb0..aced67dbfb7 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js index 1e2875ec9f6..2d7dbc507fb 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js @@ -1,68 +1,94 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/capture - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); - -// Validate if response has JSON Body +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.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} - +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]:://payments/:id/capture - 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 "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "6000" for "amount_received" if (jsonData?.amount_received) { -pm.test("[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", function() { - pm.expect(jsonData.amount_received).to.eql(6000); -})}; - - - - + pm.test( + "[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", + function () { + pm.expect(jsonData.amount_received).to.eql(6000); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json index 8975575ca40..9fe257ed85e 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js index b0e69cad2c2..d683186aa00 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json index ce6a0a81b65..d52b32a7018 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js index 1a0942b5f88..5c7196baa4f 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js index 9632bd19048..dcf3f191643 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js @@ -1,43 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/cancel - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type 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(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "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"); -})}; - - - + pm.test( + "[POST]::/payments/:id/cancel - Content check if value for 'status' matches 'cancelled'", + function () { + pm.expect(jsonData.status).to.eql("cancelled"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js index b0e69cad2c2..d683186aa00 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json index ce6a0a81b65..d52b32a7018 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js index f4e0ab9b2aa..5e52e13a59e 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "cancelled" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'", function() { - pm.expect(jsonData.status).to.eql("cancelled"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'", + function () { + pm.expect(jsonData.status).to.eql("cancelled"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js index 1388cde7c89..39cbb3ee90e 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js @@ -1,54 +1,80 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", function() { - pm.expect(jsonData.status).to.eql("requires_customer_action"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", + function () { + pm.expect(jsonData.status).to.eql("requires_customer_action"); + }, + ); +} // Response body should have "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; -}); +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; + }, +); diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json index f0889ceb6d4..a154ede5893 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js index 08ad2d6a233..02ab01502c1 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + 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"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js index edf87c9ccdf..1fa0afa6402 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js @@ -1,57 +1,83 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments/:id/confirm - Content check if 'next_action.redirect_to_url' exists", function() { - pm.expect((typeof jsonData.next_action.redirect_to_url !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments/:id/confirm - Content check if 'next_action.redirect_to_url' exists", + function () { + pm.expect(typeof jsonData.next_action.redirect_to_url !== "undefined").to.be + .true; + }, +); diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js index 5698484c741..55dc35b9128 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json index 1dd5b34188c..02ec7b2f7c4 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json index d7d23febca4..843e246d980 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js index 1c34027de1d..f89b9b86fef 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json index 5e306df7a55..5f4c58816d5 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js index 07a9529b82e..6cb4312a60a 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/API Key - Create/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/API Key - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/API Key - Create/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/API Key - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/API Key - Create/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/API Key - Create/event.test.js index bc42e83a761..4e27c5a5025 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/API Key - Create/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/API Key - Create/event.test.js @@ -1,32 +1,46 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/api_keys/:merchant_id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/api_keys/:merchant_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/api_keys/:merchant_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; try { jsonData = pm.response.json(); -} catch(e) { -} +} catch (e) {} // pm.collectionVariables - Set api_key_id as variable for jsonData.key_id if (jsonData?.key_id) { - pm.collectionVariables.set("api_key_id", jsonData.key_id); - console.log("- use {{api_key_id}} as collection variable for value", jsonData.key_id); + pm.collectionVariables.set("api_key_id", jsonData.key_id); + console.log( + "- use {{api_key_id}} as collection variable for value", + jsonData.key_id, + ); } else { - console.log('INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value", jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/API Key - Create/request.json b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/API Key - Create/request.json index 29c2490d1bc..2210d14da0e 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/API Key - Create/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/API Key - Create/request.json @@ -35,13 +35,8 @@ }, "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js index 538b393c084..7de0d5beb31 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js @@ -1,37 +1,56 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - 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]::/accounts - 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", + ); }); // 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 merchant_id as variable for jsonData.merchant_id if (jsonData?.merchant_id) { - pm.collectionVariables.set("merchant_id", jsonData.merchant_id); - console.log("- use {{merchant_id}} as collection variable for value",jsonData.merchant_id); + pm.collectionVariables.set("merchant_id", jsonData.merchant_id); + console.log( + "- use {{merchant_id}} as collection variable for value", + jsonData.merchant_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value",jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} // pm.collectionVariables - Set publishable_key as variable for jsonData.publishable_key if (jsonData?.publishable_key) { - pm.collectionVariables.set("publishable_key", jsonData.publishable_key); - console.log("- use {{publishable_key}} as collection variable for value",jsonData.publishable_key); + pm.collectionVariables.set("publishable_key", jsonData.publishable_key); + console.log( + "- use {{publishable_key}} as collection variable for value", + jsonData.publishable_key, + ); } else { - console.log('INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.", + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Merchant Account - Create/request.json b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Merchant Account - Create/request.json index 6db656fb0ce..7df5315150c 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Merchant Account - Create/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Merchant Account - Create/request.json @@ -84,12 +84,8 @@ }, "url": { "raw": "{{baseUrl}}/accounts", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "accounts" - ] + "host": ["{{baseUrl}}"], + "path": ["accounts"] }, "description": "Create a new account for a merchant. The merchant could be a seller or retailer or client who likes to receive and send payments." } diff --git a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js index b831702461e..88e92d8d84a 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js @@ -1,21 +1,39 @@ -// Validate status 2xx -pm.test("[POST]::/account/:account_id/connectors - 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.be.success; + }, +); // Validate if response header has matching content-type -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"); -}); +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){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id if (jsonData?.merchant_connector_id) { - pm.collectionVariables.set("merchant_connector_id", jsonData.merchant_connector_id); - console.log("- use {{merchant_connector_id}} as collection variable for value",jsonData.merchant_connector_id); + pm.collectionVariables.set( + "merchant_connector_id", + jsonData.merchant_connector_id, + ); + console.log( + "- use {{merchant_connector_id}} as collection variable for value", + jsonData.merchant_connector_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.", + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payment Connector - Create/request.json b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payment Connector - Create/request.json index 2898c546059..0e70ce963e2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payment Connector - Create/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payment Connector - Create/request.json @@ -262,14 +262,8 @@ }, "url": { "raw": "{{baseUrl}}/account/:account_id/connectors", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payments - Create/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payments - Create/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payments - Create/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payments - Create/event.test.js index 62142d52dca..a6947db94c0 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payments - Create/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payments - Create/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payments - Create/request.json b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payments - Create/request.json index 20a4cbda6ab..2ec4bf56a5b 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payments - Create/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js index 4dd072b2222..d0a02af7436 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // 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.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payments - Retrieve/request.json b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payments - Retrieve/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Refunds - Create/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Refunds - Create/event.test.js index c862e8e68a7..dbc930608cb 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Refunds - Create/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Refunds - Create/event.test.js @@ -1,21 +1,30 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Refunds - Create/request.json b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Refunds - Create/request.json index 4dbca4d01f2..0c13281ee15 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Refunds - Create/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js index b1e1f12ba50..bbd8e544e2c 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js @@ -1,22 +1,30 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); - // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Refunds - Retrieve/request.json b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Refunds - Retrieve/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/QuickStart/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js index cd0fa259bac..d337f151b68 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js @@ -1,54 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 "invalid_request" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments - Content check if value for 'error.type' matches 'connector'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json index ad281c58256..9cbdbc8e22f 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js index dd25943d3db..d337f151b68 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js @@ -1,56 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); - // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 "invalid_request" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments - Content check if value for 'error.type' matches 'connector'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json index 99a24fb4f26..8a9df91718d 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js index 0e6401222ff..52680771c31 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js @@ -1,55 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector_error'", function() { - pm.expect(jsonData.error.type).to.eql("connector_error"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'", + function () { + pm.expect(jsonData.error.type).to.eql("connector_error"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json index bd48aba1445..eeafa218577 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json @@ -75,12 +75,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js index 6abf265b641..bdaef2a11a7 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js @@ -1,55 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 "invalid_request" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments - Content check if value for 'error.type' matches 'connector'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json index d0371786574..eee1a49682e 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json index 90b19864ee1..f2bee31ef66 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Confirm" - ] + "childrenOrder": ["Payments - Create", "Payments - Confirm"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js index 1e8ba8cc3a6..e8d6b2216c5 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js @@ -1,58 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); -}); - - +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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json index b28abd0c309..e3b1e235042 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json @@ -67,12 +67,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js index c3e7afc6760..46bf201d1ce 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js @@ -1,59 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json index 766a8330d6e..6c934a9132c 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js index b0e69cad2c2..d683186aa00 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json index cdae43009d5..47828f663cc 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js index 6b03e0b9ee6..34beacf976b 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" 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"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json index cafd3a6808e..6df7c0a1943 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Capture" - ] + "childrenOrder": ["Payments - Create", "Payments - Capture"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js index c3e7afc6760..46bf201d1ce 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js @@ -1,59 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json index 766a8330d6e..6c934a9132c 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json index b7d9b45e6e9..b3b66f0deda 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json index afba25ab6d6..5ff1a7cb4e8 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Cancel" - ] + "childrenOrder": ["Payments - Create", "Payments - Cancel"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js index d7879c70d87..0f869a6dfb8 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js @@ -1,50 +1,69 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/cancel - Status code is 4xx", function () { - pm.response.to.be.error; + 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/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/cancel - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; - - - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json index b7d9b45e6e9..b3b66f0deda 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/event.test.js index f125e2a7885..46bf201d1ce 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/event.test.js @@ -1,61 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + 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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/request.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/request.json index 14ac5f8bb4a..2b31ac6d784 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/event.test.js index c289d7d25fb..39cbb3ee90e 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/event.test.js @@ -1,55 +1,80 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", function() { - pm.expect(jsonData.status).to.eql("requires_customer_action"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", + function () { + pm.expect(jsonData.status).to.eql("requires_customer_action"); + }, + ); +} // Response body should have "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; -}); - +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; + }, +); diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json index b24aa0eb628..a7d4425b0d8 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/event.test.js index 1f59e2b00ac..02ab01502c1 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/request.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json index b7d9b45e6e9..b3b66f0deda 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js index 9537daf6187..776dbd70712 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js @@ -1,33 +1,48 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/refunds - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + 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; -}); +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"); -})}; - + 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"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json index 326319e8fdf..10de81bed08 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js index 65232a76373..55dc35b9128 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; - - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json index 7186bddbe07..119353069bd 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js index 42bf3e0ac45..fdb8a946f3d 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js index 30888b5cc0c..d3c4451760d 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js @@ -1,32 +1,48 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/refunds - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + 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; -}); +pm.test( + "[POST]::/payments/:id/confirm - Content check if 'error' exists", + function () { + pm.expect(typeof jsonData.error !== "undefined").to.be.true; + }, +); // Response body should have value "invalid_request" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; + pm.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"); + }, + ); +} diff --git a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json index d18aaf8befd..9fe125ce8ea 100644 --- a/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json +++ b/postman/collection-dir/nexinets/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/nexinets/Health check/.meta.json b/postman/collection-dir/nexinets/Health check/.meta.json index 66ee7e50cab..579f9fd541c 100644 --- a/postman/collection-dir/nexinets/Health check/.meta.json +++ b/postman/collection-dir/nexinets/Health check/.meta.json @@ -1,5 +1,3 @@ { - "childrenOrder": [ - "New Request" - ] + "childrenOrder": ["New Request"] } diff --git a/postman/collection-dir/nexinets/Health check/New Request/.event.meta.json b/postman/collection-dir/nexinets/Health check/New Request/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nexinets/Health check/New Request/.event.meta.json +++ b/postman/collection-dir/nexinets/Health check/New Request/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nexinets/Health check/New Request/event.test.js b/postman/collection-dir/nexinets/Health check/New Request/event.test.js index 325a8c8a479..b490b8be090 100644 --- a/postman/collection-dir/nexinets/Health check/New Request/event.test.js +++ b/postman/collection-dir/nexinets/Health check/New Request/event.test.js @@ -1,4 +1,4 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - Status code is 2xx", function () { - pm.response.to.be.success; -}); \ No newline at end of file + pm.response.to.be.success; +}); diff --git a/postman/collection-dir/nexinets/Health check/New Request/request.json b/postman/collection-dir/nexinets/Health check/New Request/request.json index 4cc8d4b1a96..e40e9396178 100644 --- a/postman/collection-dir/nexinets/Health check/New Request/request.json +++ b/postman/collection-dir/nexinets/Health check/New Request/request.json @@ -10,11 +10,7 @@ ], "url": { "raw": "{{baseUrl}}/health", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "health" - ] + "host": ["{{baseUrl}}"], + "path": ["health"] } } diff --git a/postman/collection-dir/nexinets/event.test.js b/postman/collection-dir/nexinets/event.test.js index 69037688f22..fb52caec30f 100644 --- a/postman/collection-dir/nexinets/event.test.js +++ b/postman/collection-dir/nexinets/event.test.js @@ -1,11 +1,13 @@ // 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("[LOG]::payment_id - " + jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log("[LOG]::payment_id - " + jsonData.payment_id); } -console.log("[LOG]::x-request-id - " + pm.response.headers.get('x-request-id')); \ No newline at end of file +console.log("[LOG]::x-request-id - " + pm.response.headers.get("x-request-id")); diff --git a/postman/collection-dir/nmi/.event.meta.json b/postman/collection-dir/nmi/.event.meta.json index 2df9d47d936..eb871bbcb9b 100644 --- a/postman/collection-dir/nmi/.event.meta.json +++ b/postman/collection-dir/nmi/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.prerequest.js", - "event.test.js" - ] + "eventOrder": ["event.prerequest.js", "event.test.js"] } diff --git a/postman/collection-dir/nmi/.meta.json b/postman/collection-dir/nmi/.meta.json index 91b6a65c5bc..d513035ce2d 100644 --- a/postman/collection-dir/nmi/.meta.json +++ b/postman/collection-dir/nmi/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Health check", - "Flow Testcases" - ] + "childrenOrder": ["Health check", "Flow Testcases"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/.meta.json b/postman/collection-dir/nmi/Flow Testcases/.meta.json index 1bbce843680..023989e1e49 100644 --- a/postman/collection-dir/nmi/Flow Testcases/.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/.meta.json @@ -1,7 +1,3 @@ { - "childrenOrder": [ - "QuickStart", - "Happy Cases", - "Variation Cases" - ] + "childrenOrder": ["QuickStart", "Happy Cases", "Variation Cases"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js index b6246b9a6cc..705069ab0d7 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js @@ -1,51 +1,73 @@ -pm.environment.set("random_number", _.random(100, 100000)) +pm.environment.set("random_number", _.random(100, 100000)); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json index 3e7e1d8f778..29118575b20 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js index 77931c5bf4f..705069ab0d7 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js @@ -1,53 +1,73 @@ -pm.environment.set("random_number", _.random(100, 100000)) +pm.environment.set("random_number", _.random(100, 100000)); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; - - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json index 3e7e1d8f778..29118575b20 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js index 01c5b744eac..4974bba662f 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js @@ -1,58 +1,76 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "refunds" -pm.test("[POST]::/payments - Content check if 'refunds' exists", function() { - pm.expect((typeof jsonData.refunds !== "undefined")).to.be.true; +pm.test("[POST]::/payments - Content check if 'refunds' exists", function () { + pm.expect(typeof jsonData.refunds !== "undefined").to.be.true; }); - - - diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js index 350449d0092..55dd42339c7 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'pending'", function() { - pm.expect(jsonData.status).to.eql("pending"); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'status' matches 'pending'", + function () { + pm.expect(jsonData.status).to.eql("pending"); + }, + ); +} // Response body should have value "1000" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '10'", function() { - pm.expect(jsonData.amount).to.eql(10); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '10'", + function () { + pm.expect(jsonData.amount).to.eql(10); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json index e913162c9b4..be183328972 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js index 7c561d8a188..efadae75d29 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'pending'", function() { - pm.expect(jsonData.status).to.eql("pending"); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'status' matches 'pending'", + function () { + pm.expect(jsonData.status).to.eql("pending"); + }, + ); +} // Response body should have value "540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '100'", function() { - pm.expect(jsonData.amount).to.eql(100); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '100'", + function () { + pm.expect(jsonData.amount).to.eql(100); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json index 49682c95224..142ab27d01c 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js index 86f63f53760..4364b195adf 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '10'", function() { - pm.expect(jsonData.amount).to.eql(10); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '10'", + function () { + pm.expect(jsonData.amount).to.eql(10); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js index 9be7be11c40..c596c8a2b88 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '100'", function() { - pm.expect(jsonData.amount).to.eql(100); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '100'", + function () { + pm.expect(jsonData.amount).to.eql(100); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js index 0ab0b7893e4..394702b1fa1 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js index 01ba81bacf6..009e2045915 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js @@ -1,51 +1,73 @@ -pm.environment.set("random_number", _.random(100, 100000)) +pm.environment.set("random_number", _.random(100, 100000)); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json index c139c499ac6..dc12ea26597 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js index 03ccae1adb0..aced67dbfb7 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js index 19bfef45eb0..c25f2c03733 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id/confirm - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id/confirm - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json index 1c77275181c..ab7b144f94b 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "card", "payment_method_data": { "card": { @@ -32,14 +53,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js index 05501107ba1..e920cac3df7 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js @@ -1,51 +1,73 @@ -pm.environment.set("random_number", _.random(100, 100000)) +pm.environment.set("random_number", _.random(100, 100000)); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json index a14b824b36b..fc4e0cc59cd 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js index 03ccae1adb0..aced67dbfb7 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js index 7b5ea7df830..5b660989c50 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js @@ -1,71 +1,97 @@ // Get the value of 'amount' from the environment const amount = pm.environment.get("amount"); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/capture - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); - -// Validate if response has JSON Body +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.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} - +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]:://payments/:id/capture - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; + pm.test( + "[POST]:://payments/:id/capture - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} // Response body should have value "{{amount}}" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '{{amount}}'", function() { - pm.expect(jsonData.amount).to.eql(amount); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '{{amount}}'", + function () { + pm.expect(jsonData.amount).to.eql(amount); + }, + ); +} // Response body should have value "{{amount}}" for "amount_received" if (jsonData?.amount_received) { -pm.test("[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '{{amount}}'", function() { - pm.expect(jsonData.amount_received).to.eql(amount); -})}; - - - - + pm.test( + "[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '{{amount}}'", + function () { + pm.expect(jsonData.amount_received).to.eql(amount); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json index 28d44dc81a6..a980e3cb940 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json @@ -21,14 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js index 83f94386c3d..20b92d507d4 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js @@ -1,53 +1,74 @@ -pm.environment.set("random_number", _.random(100, 100000)) +pm.environment.set("random_number", _.random(100, 100000)); pm.environment.set("amount", pm.response.json().amount); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json index 947eb896b58..613a57f2342 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve-copy/event.test.js index 1a0942b5f88..5c7196baa4f 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve-copy/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve-copy/request.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js index 0d75cbf5821..2b84e6e484f 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js index d329801cccf..90852837cd0 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js @@ -1,43 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/cancel - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type 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(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "cancelled" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id/cancel - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; - - - + pm.test( + "[POST]::/payments/:id/cancel - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json index 3443f265bdd..374b615fdeb 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js index a2a01eac0c9..2dcd7866349 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js @@ -1,52 +1,73 @@ -pm.environment.set("random_number", _.random(100, 100000)) +pm.environment.set("random_number", _.random(100, 100000)); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json index 39ee738d6dc..f2ba0f5cb45 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve-copy/event.test.js index f4e0ab9b2aa..5e52e13a59e 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve-copy/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "cancelled" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'", function() { - pm.expect(jsonData.status).to.eql("cancelled"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'", + function () { + pm.expect(jsonData.status).to.eql("cancelled"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve-copy/request.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js index 7f62d2b3ef6..1bac76560dc 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "cancelled" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js index 453be12571d..59f4e123dfc 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js @@ -1,54 +1,75 @@ -pm.environment.set("random_number", _.random(100, 100000)) +pm.environment.set("random_number", _.random(100, 100000)); // Set the environment variable 'amount' with the value from the response pm.environment.set("amount", pm.response.json().amount); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json index 3e7e1d8f778..29118575b20 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js index bc05fefe0cf..88f7e543028 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js @@ -1,36 +1,53 @@ // Get the value of 'amount' from the environment const amount = pm.environment.get("amount"); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'pending'", function() { - pm.expect(jsonData.status).to.eql("pending"); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'status' matches 'pending'", + function () { + pm.expect(jsonData.status).to.eql("pending"); + }, + ); +} // Response body should have value "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '{{amount}}'", function() { - pm.expect(jsonData.amount).to.eql(amount); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '{{amount}}'", + function () { + pm.expect(jsonData.amount).to.eql(amount); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json index e9cb375957e..73a74425cb1 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js index 29568ea9107..fabc6394dd7 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js @@ -1,36 +1,53 @@ // Get the value of 'amount' from the environment const refund_amount = pm.environment.get("amount"); -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "{{refund_amount}}" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '{{refund_amount}}'", function() { - pm.expect(jsonData.amount).to.eql(refund_amount); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '{{refund_amount}}'", + function () { + pm.expect(jsonData.amount).to.eql(refund_amount); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/nmi/Flow Testcases/QuickStart/API Key - Create/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/QuickStart/API Key - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/QuickStart/API Key - Create/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/QuickStart/API Key - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/QuickStart/API Key - Create/event.test.js b/postman/collection-dir/nmi/Flow Testcases/QuickStart/API Key - Create/event.test.js index bc42e83a761..4e27c5a5025 100644 --- a/postman/collection-dir/nmi/Flow Testcases/QuickStart/API Key - Create/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/QuickStart/API Key - Create/event.test.js @@ -1,32 +1,46 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/api_keys/:merchant_id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/api_keys/:merchant_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/api_keys/:merchant_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; try { jsonData = pm.response.json(); -} catch(e) { -} +} catch (e) {} // pm.collectionVariables - Set api_key_id as variable for jsonData.key_id if (jsonData?.key_id) { - pm.collectionVariables.set("api_key_id", jsonData.key_id); - console.log("- use {{api_key_id}} as collection variable for value", jsonData.key_id); + pm.collectionVariables.set("api_key_id", jsonData.key_id); + console.log( + "- use {{api_key_id}} as collection variable for value", + jsonData.key_id, + ); } else { - console.log('INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value", jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/QuickStart/API Key - Create/request.json b/postman/collection-dir/nmi/Flow Testcases/QuickStart/API Key - Create/request.json index 29c2490d1bc..2210d14da0e 100644 --- a/postman/collection-dir/nmi/Flow Testcases/QuickStart/API Key - Create/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/QuickStart/API Key - Create/request.json @@ -35,13 +35,8 @@ }, "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js index 538b393c084..7de0d5beb31 100644 --- a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js @@ -1,37 +1,56 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - 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]::/accounts - 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", + ); }); // 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 merchant_id as variable for jsonData.merchant_id if (jsonData?.merchant_id) { - pm.collectionVariables.set("merchant_id", jsonData.merchant_id); - console.log("- use {{merchant_id}} as collection variable for value",jsonData.merchant_id); + pm.collectionVariables.set("merchant_id", jsonData.merchant_id); + console.log( + "- use {{merchant_id}} as collection variable for value", + jsonData.merchant_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value",jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} // pm.collectionVariables - Set publishable_key as variable for jsonData.publishable_key if (jsonData?.publishable_key) { - pm.collectionVariables.set("publishable_key", jsonData.publishable_key); - console.log("- use {{publishable_key}} as collection variable for value",jsonData.publishable_key); + pm.collectionVariables.set("publishable_key", jsonData.publishable_key); + console.log( + "- use {{publishable_key}} as collection variable for value", + jsonData.publishable_key, + ); } else { - console.log('INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.", + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Merchant Account - Create/request.json b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Merchant Account - Create/request.json index ffeea3410a4..dcbf46ee538 100644 --- a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Merchant Account - Create/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Merchant Account - Create/request.json @@ -84,12 +84,8 @@ }, "url": { "raw": "{{baseUrl}}/accounts", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "accounts" - ] + "host": ["{{baseUrl}}"], + "path": ["accounts"] }, "description": "Create a new account for a merchant. The merchant could be a seller or retailer or client who likes to receive and send payments." } diff --git a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js index b831702461e..88e92d8d84a 100644 --- a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js @@ -1,21 +1,39 @@ -// Validate status 2xx -pm.test("[POST]::/account/:account_id/connectors - 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.be.success; + }, +); // Validate if response header has matching content-type -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"); -}); +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){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id if (jsonData?.merchant_connector_id) { - pm.collectionVariables.set("merchant_connector_id", jsonData.merchant_connector_id); - console.log("- use {{merchant_connector_id}} as collection variable for value",jsonData.merchant_connector_id); + pm.collectionVariables.set( + "merchant_connector_id", + jsonData.merchant_connector_id, + ); + console.log( + "- use {{merchant_connector_id}} as collection variable for value", + jsonData.merchant_connector_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.", + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payment Connector - Create/request.json b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payment Connector - Create/request.json index 0fccd1499e0..60dabc163cc 100644 --- a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payment Connector - Create/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payment Connector - Create/request.json @@ -104,14 +104,8 @@ }, "url": { "raw": "{{baseUrl}}/account/:account_id/connectors", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payments - Create/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payments - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payments - Create/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payments - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payments - Create/event.prerequest.js b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payments - Create/event.prerequest.js index 726d5815380..27965bb9c01 100644 --- a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payments - Create/event.prerequest.js +++ b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payments - Create/event.prerequest.js @@ -1 +1 @@ -pm.environment.set("random_number", _.random(1000, 100000)) +pm.environment.set("random_number", _.random(1000, 100000)); diff --git a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payments - Create/event.test.js b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payments - Create/event.test.js index 445c0049141..dc285fb1afe 100644 --- a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payments - Create/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payments - Create/event.test.js @@ -1,50 +1,66 @@ -pm.environment.set("random_number", _.random(1000, 100000)) +pm.environment.set("random_number", _.random(1000, 100000)); // Set the environment variable 'amount' with the value from the response pm.environment.set("amount", pm.response.json().amount); - -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payments - Create/request.json b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payments - Create/request.json index 95b19ed8520..176c927bd69 100644 --- a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payments - Create/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js index b1e1f12ba50..bbd8e544e2c 100644 --- a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js @@ -1,22 +1,30 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); - // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payments - Retrieve/request.json b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payments - Retrieve/request.json index 203cc8ad8d1..edbb22e7db5 100644 --- a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payments - Retrieve/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Refunds - Create/event.test.js b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Refunds - Create/event.test.js index 99daf1ef820..61f29c86540 100644 --- a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Refunds - Create/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Refunds - Create/event.test.js @@ -1,24 +1,33 @@ // Get the value of 'amount' from the environment const amount = pm.environment.get("amount"); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Refunds - Create/request.json b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Refunds - Create/request.json index e9cb375957e..73a74425cb1 100644 --- a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Refunds - Create/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Refunds - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js index b1e1f12ba50..bbd8e544e2c 100644 --- a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js @@ -1,22 +1,30 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); - // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Refunds - Retrieve/request.json b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Refunds - Retrieve/request.json index 06b44cf7fd3..31f783a8e11 100644 --- a/postman/collection-dir/nmi/Flow Testcases/QuickStart/Refunds - Retrieve/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/QuickStart/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js index 08f14e045be..edb1f073bee 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js @@ -1,54 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json index 7a7c4db39e8..e7185ed8182 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js index 7d118e2f5e5..edb1f073bee 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js @@ -1,56 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); - // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json index 5244d20c622..8e023984aab 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js index 9502696402a..11294b20d04 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js @@ -1,57 +1,78 @@ -pm.environment.set("random_number", _.random(100, 100000)) +pm.environment.set("random_number", _.random(100, 100000)); -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector_error'", function() { - pm.expect(jsonData.error.type).to.eql("connector_error"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'", + function () { + pm.expect(jsonData.error.type).to.eql("connector_error"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json index 0419e70804d..6740273f39b 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js index 22088133b96..e5da2bc495c 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js @@ -1,57 +1,78 @@ -pm.environment.set("random_number", _.random(100, 100000)) +pm.environment.set("random_number", _.random(100, 100000)); -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector'", function() { - pm.expect(jsonData.error.type).to.eql("connector"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector'", + function () { + pm.expect(jsonData.error.type).to.eql("connector"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json index ebdea4cf7b0..58376c99d77 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json index 90b19864ee1..f2bee31ef66 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Confirm" - ] + "childrenOrder": ["Payments - Create", "Payments - Confirm"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js index 1e8ba8cc3a6..e8d6b2216c5 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js @@ -1,58 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); -}); - - +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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js index 05501107ba1..e920cac3df7 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js @@ -1,51 +1,73 @@ -pm.environment.set("random_number", _.random(100, 100000)) +pm.environment.set("random_number", _.random(100, 100000)); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json index a14b824b36b..fc4e0cc59cd 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js index 9f6d640c022..1abf5cf7c31 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js @@ -1,62 +1,85 @@ // Get the value of 'amount' from the environment const capture_amount = parseInt(pm.environment.get("amount")) + 1000; -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json index e18ddb89565..305ee93aaee 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json @@ -21,14 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js index a2a01eac0c9..2dcd7866349 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js @@ -1,52 +1,73 @@ -pm.environment.set("random_number", _.random(100, 100000)) +pm.environment.set("random_number", _.random(100, 100000)); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json index 39ee738d6dc..f2ba0f5cb45 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve-copy/event.test.js index 6b03e0b9ee6..34beacf976b 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve-copy/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" 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"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve-copy/request.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js index 6b03e0b9ee6..34beacf976b 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" 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"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js index c3e7afc6760..46bf201d1ce 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js @@ -1,59 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json index 766a8330d6e..6c934a9132c 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js index 7493926b4c0..705069ab0d7 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js @@ -1,52 +1,73 @@ -pm.environment.set("random_number", _.random(100, 100000)) +pm.environment.set("random_number", _.random(100, 100000)); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json index 793caad5486..9215a6a326b 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve-copy/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve-copy/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve-copy/request.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve/request.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js index d7879c70d87..0f869a6dfb8 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js @@ -1,50 +1,69 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/cancel - Status code is 4xx", function () { - pm.response.to.be.error; + 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/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/cancel - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; - - - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json index 3443f265bdd..374b615fdeb 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js index 7493926b4c0..705069ab0d7 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js @@ -1,52 +1,73 @@ -pm.environment.set("random_number", _.random(100, 100000)) +pm.environment.set("random_number", _.random(100, 100000)); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json index 793caad5486..9215a6a326b 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Retrieve/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Retrieve/request.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js index c3cff04170c..7002c42221b 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js @@ -1,55 +1,76 @@ -pm.environment.set("random_number", _.random(100, 100000)) +pm.environment.set("random_number", _.random(100, 100000)); // Set the environment variable 'amount' with the value from the response pm.environment.set("amount", pm.response.json().amount); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json index 793caad5486..9215a6a326b 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js index 8a650d1e9e2..3f945fb624c 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js @@ -1,54 +1,74 @@ // Get the value of 'amount' from the environment const amount = parseInt(pm.environment.get("amount")) + 100000; -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js index 85955409564..225c64f347b 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js @@ -4,36 +4,51 @@ const refund_amount = parseInt(pm.environment.get("amount") + 100000); // Set 'refund_amount' as an environment variable for the current request pm.environment.set("refund_amount", refund_amount); -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/refunds - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + 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; -}); +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"); -})}; - + 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"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json index f957f4e3a32..dbeb9b40aa4 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js index ef8cd2158d4..009e2045915 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js @@ -1,53 +1,73 @@ -pm.environment.set("random_number", _.random(100, 100000)) +pm.environment.set("random_number", _.random(100, 100000)); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; - - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json index 62f3b873911..7a8ee243bfa 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve-copy/event.test.js index 42bf3e0ac45..fdb8a946f3d 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve-copy/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve-copy/request.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js index 1bcd3c26907..37f0e4490ee 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'requires_confirmation'", function() { - pm.expect(jsonData.status).to.eql("requires_confirmation"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js index 30888b5cc0c..d3c4451760d 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js @@ -1,32 +1,48 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/refunds - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + 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; -}); +pm.test( + "[POST]::/payments/:id/confirm - Content check if 'error' exists", + function () { + pm.expect(typeof jsonData.error !== "undefined").to.be.true; + }, +); // Response body should have value "invalid_request" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; + pm.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"); + }, + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json index d18aaf8befd..9fe125ce8ea 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/nmi/Health check/.meta.json b/postman/collection-dir/nmi/Health check/.meta.json index 66ee7e50cab..579f9fd541c 100644 --- a/postman/collection-dir/nmi/Health check/.meta.json +++ b/postman/collection-dir/nmi/Health check/.meta.json @@ -1,5 +1,3 @@ { - "childrenOrder": [ - "New Request" - ] + "childrenOrder": ["New Request"] } diff --git a/postman/collection-dir/nmi/Health check/New Request/.event.meta.json b/postman/collection-dir/nmi/Health check/New Request/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/nmi/Health check/New Request/.event.meta.json +++ b/postman/collection-dir/nmi/Health check/New Request/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/nmi/Health check/New Request/event.test.js b/postman/collection-dir/nmi/Health check/New Request/event.test.js index 325a8c8a479..b490b8be090 100644 --- a/postman/collection-dir/nmi/Health check/New Request/event.test.js +++ b/postman/collection-dir/nmi/Health check/New Request/event.test.js @@ -1,4 +1,4 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - Status code is 2xx", function () { - pm.response.to.be.success; -}); \ No newline at end of file + pm.response.to.be.success; +}); diff --git a/postman/collection-dir/nmi/Health check/New Request/request.json b/postman/collection-dir/nmi/Health check/New Request/request.json index 4cc8d4b1a96..e40e9396178 100644 --- a/postman/collection-dir/nmi/Health check/New Request/request.json +++ b/postman/collection-dir/nmi/Health check/New Request/request.json @@ -10,11 +10,7 @@ ], "url": { "raw": "{{baseUrl}}/health", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "health" - ] + "host": ["{{baseUrl}}"], + "path": ["health"] } } diff --git a/postman/collection-dir/nmi/event.test.js b/postman/collection-dir/nmi/event.test.js index 69037688f22..fb52caec30f 100644 --- a/postman/collection-dir/nmi/event.test.js +++ b/postman/collection-dir/nmi/event.test.js @@ -1,11 +1,13 @@ // 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("[LOG]::payment_id - " + jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log("[LOG]::payment_id - " + jsonData.payment_id); } -console.log("[LOG]::x-request-id - " + pm.response.headers.get('x-request-id')); \ No newline at end of file +console.log("[LOG]::x-request-id - " + pm.response.headers.get("x-request-id")); diff --git a/postman/collection-dir/payme/.event.meta.json b/postman/collection-dir/payme/.event.meta.json index 2df9d47d936..eb871bbcb9b 100644 --- a/postman/collection-dir/payme/.event.meta.json +++ b/postman/collection-dir/payme/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.prerequest.js", - "event.test.js" - ] + "eventOrder": ["event.prerequest.js", "event.test.js"] } diff --git a/postman/collection-dir/payme/.meta.json b/postman/collection-dir/payme/.meta.json index 91b6a65c5bc..d513035ce2d 100644 --- a/postman/collection-dir/payme/.meta.json +++ b/postman/collection-dir/payme/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Health check", - "Flow Testcases" - ] + "childrenOrder": ["Health check", "Flow Testcases"] } diff --git a/postman/collection-dir/payme/Flow Testcases/.meta.json b/postman/collection-dir/payme/Flow Testcases/.meta.json index 1bbce843680..023989e1e49 100644 --- a/postman/collection-dir/payme/Flow Testcases/.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/.meta.json @@ -1,7 +1,3 @@ { - "childrenOrder": [ - "QuickStart", - "Happy Cases", - "Variation Cases" - ] + "childrenOrder": ["QuickStart", "Happy Cases", "Variation Cases"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js index 72f142cc731..c48d8e2d054 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json index d5cc39cacc4..a63210df7f4 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json @@ -87,12 +87,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js index 190165611ad..f24684e34df 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js index bb50904fd89..f92fba3d044 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js index 5698484c741..55dc35b9128 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json index 1c3c45c25f3..99392fc0f91 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json @@ -87,12 +87,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js index 03ccae1adb0..aced67dbfb7 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js index 5d9e5785e6e..6d812bc75fe 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id/confirm - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id/confirm - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json index bb2b0cdc1b0..402aa25fef8 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "card", "payment_method_data": { "card": { @@ -32,14 +53,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json index 85984c9fd57..90982e5acd3 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js index 03ccae1adb0..aced67dbfb7 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js index 31a9c85887b..4df2451e29e 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js @@ -1,67 +1,94 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/capture - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "6000" for "amount_received" if (jsonData?.amount_received) { -pm.test("[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6540'", function() { - pm.expect(jsonData.amount_received).to.eql(6540); -})}; + pm.test( + "[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6540'", + function () { + pm.expect(jsonData.amount_received).to.eql(6540); + }, + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - - - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json index 8efb99d3c90..cceb2b55f0a 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js index b0e69cad2c2..d683186aa00 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json index 2084b6bd5e8..0fc567f8bea 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json @@ -87,12 +87,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js index 1a0942b5f88..5c7196baa4f 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json index 6f4d51c5945..61fcdaec2d2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Payments - Create/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Payments - Create/event.test.js b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Payments - Create/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Payments - Create/request.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Payments - Create/request.json index 4784b5d0b19..625ae3a9d28 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Payments - Create/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Payments - Create/request.json @@ -86,12 +86,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Payments - Retrieve/event.test.js b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Payments - Retrieve/request.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Refunds - Create/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Refunds - Create/event.test.js b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Refunds - Create/event.test.js index 1c34027de1d..f89b9b86fef 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Refunds - Create/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Refunds - Create/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Refunds - Create/request.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Refunds - Create/request.json index 5e306df7a55..5f4c58816d5 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Refunds - Create/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Refunds - Retrieve/event.test.js b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Refunds - Retrieve/event.test.js index 07a9529b82e..6cb4312a60a 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Refunds - Retrieve/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Refunds - Retrieve/request.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Refunds - Retrieve/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario5-Refund full payment/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Payments - Create/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Payments - Create/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Payments - Create/event.test.js b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Payments - Create/event.test.js index c5bae16750d..c48d8e2d054 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Payments - Create/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Payments - Create/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Payments - Create/request.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Payments - Create/request.json index c5a07cb94d9..00b12f40997 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Payments - Create/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Payments - Create/request.json @@ -86,12 +86,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Payments - Retrieve-copy/event.test.js index 01c5b744eac..4974bba662f 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Payments - Retrieve-copy/event.test.js @@ -1,58 +1,76 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "refunds" -pm.test("[POST]::/payments - Content check if 'refunds' exists", function() { - pm.expect((typeof jsonData.refunds !== "undefined")).to.be.true; +pm.test("[POST]::/payments - Content check if 'refunds' exists", function () { + pm.expect(typeof jsonData.refunds !== "undefined").to.be.true; }); - - - diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Payments - Retrieve-copy/request.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Payments - Retrieve/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Payments - Retrieve/event.test.js b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Payments - Retrieve/request.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Payments - Retrieve/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Create-copy/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Create-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Create-copy/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Create-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Create-copy/event.test.js b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Create-copy/event.test.js index d28f25fa46d..56ea9efbac0 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Create-copy/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Create-copy/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "1000" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '1000'", function() { - pm.expect(jsonData.amount).to.eql(1000); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '1000'", + function () { + pm.expect(jsonData.amount).to.eql(1000); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Create-copy/request.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Create-copy/request.json index b56057fad5d..caed7818578 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Create-copy/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Create-copy/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Create/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Create/event.test.js b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Create/event.test.js index 04650f547a2..c1dd16a4551 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Create/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Create/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '540'", function() { - pm.expect(jsonData.amount).to.eql(540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '540'", + function () { + pm.expect(jsonData.amount).to.eql(540); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Create/request.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Create/request.json index d18aaf8befd..9fe125ce8ea 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Create/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Retrieve-copy/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Retrieve-copy/event.test.js b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Retrieve-copy/event.test.js index bfe3137afb0..f0351c05701 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Retrieve-copy/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Retrieve-copy/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '1000'", function() { - pm.expect(jsonData.amount).to.eql(1000); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '1000'", + function () { + pm.expect(jsonData.amount).to.eql(1000); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Retrieve-copy/request.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Retrieve-copy/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Retrieve-copy/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Retrieve/event.test.js b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Retrieve/event.test.js index 7bff0a3c12c..920a7c47f36 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Retrieve/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '540'", function() { - pm.expect(jsonData.amount).to.eql(540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '540'", + function () { + pm.expect(jsonData.amount).to.eql(540); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Retrieve/request.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Retrieve/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario6-Partial refund Copy/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Cancel/event.test.js b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Cancel/event.test.js index 9632bd19048..dcf3f191643 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Cancel/event.test.js @@ -1,43 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/cancel - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type 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(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "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"); -})}; - - - + pm.test( + "[POST]::/payments/:id/cancel - Content check if value for 'status' matches 'cancelled'", + function () { + pm.expect(jsonData.status).to.eql("cancelled"); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Cancel/request.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Cancel/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Create/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Create/event.test.js b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Create/event.test.js index d8a332a994e..55dc35b9128 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Create/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Create/request.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Create/request.json index 1c3c45c25f3..99392fc0f91 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Create/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Create/request.json @@ -87,12 +87,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Retrieve/event.test.js b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Retrieve/event.test.js index f4e0ab9b2aa..5e52e13a59e 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "cancelled" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'", function() { - pm.expect(jsonData.status).to.eql("cancelled"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'", + function () { + pm.expect(jsonData.status).to.eql("cancelled"); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Retrieve/request.json b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/payme/Flow Testcases/QuickStart/API Key - Create/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/QuickStart/API Key - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/QuickStart/API Key - Create/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/QuickStart/API Key - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/QuickStart/API Key - Create/event.test.js b/postman/collection-dir/payme/Flow Testcases/QuickStart/API Key - Create/event.test.js index bc42e83a761..4e27c5a5025 100644 --- a/postman/collection-dir/payme/Flow Testcases/QuickStart/API Key - Create/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/QuickStart/API Key - Create/event.test.js @@ -1,32 +1,46 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/api_keys/:merchant_id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/api_keys/:merchant_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/api_keys/:merchant_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; try { jsonData = pm.response.json(); -} catch(e) { -} +} catch (e) {} // pm.collectionVariables - Set api_key_id as variable for jsonData.key_id if (jsonData?.key_id) { - pm.collectionVariables.set("api_key_id", jsonData.key_id); - console.log("- use {{api_key_id}} as collection variable for value", jsonData.key_id); + pm.collectionVariables.set("api_key_id", jsonData.key_id); + console.log( + "- use {{api_key_id}} as collection variable for value", + jsonData.key_id, + ); } else { - console.log('INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value", jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/QuickStart/API Key - Create/request.json b/postman/collection-dir/payme/Flow Testcases/QuickStart/API Key - Create/request.json index 29c2490d1bc..2210d14da0e 100644 --- a/postman/collection-dir/payme/Flow Testcases/QuickStart/API Key - Create/request.json +++ b/postman/collection-dir/payme/Flow Testcases/QuickStart/API Key - Create/request.json @@ -35,13 +35,8 @@ }, "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/payme/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/payme/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js b/postman/collection-dir/payme/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js index 538b393c084..7de0d5beb31 100644 --- a/postman/collection-dir/payme/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js @@ -1,37 +1,56 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - 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]::/accounts - 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", + ); }); // 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 merchant_id as variable for jsonData.merchant_id if (jsonData?.merchant_id) { - pm.collectionVariables.set("merchant_id", jsonData.merchant_id); - console.log("- use {{merchant_id}} as collection variable for value",jsonData.merchant_id); + pm.collectionVariables.set("merchant_id", jsonData.merchant_id); + console.log( + "- use {{merchant_id}} as collection variable for value", + jsonData.merchant_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value",jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} // pm.collectionVariables - Set publishable_key as variable for jsonData.publishable_key if (jsonData?.publishable_key) { - pm.collectionVariables.set("publishable_key", jsonData.publishable_key); - console.log("- use {{publishable_key}} as collection variable for value",jsonData.publishable_key); + pm.collectionVariables.set("publishable_key", jsonData.publishable_key); + console.log( + "- use {{publishable_key}} as collection variable for value", + jsonData.publishable_key, + ); } else { - console.log('INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.", + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/QuickStart/Merchant Account - Create/request.json b/postman/collection-dir/payme/Flow Testcases/QuickStart/Merchant Account - Create/request.json index 101b3452b45..2c107a14f5d 100644 --- a/postman/collection-dir/payme/Flow Testcases/QuickStart/Merchant Account - Create/request.json +++ b/postman/collection-dir/payme/Flow Testcases/QuickStart/Merchant Account - Create/request.json @@ -84,12 +84,8 @@ }, "url": { "raw": "{{baseUrl}}/accounts", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "accounts" - ] + "host": ["{{baseUrl}}"], + "path": ["accounts"] }, "description": "Create a new account for a merchant. The merchant could be a seller or retailer or client who likes to receive and send payments." } diff --git a/postman/collection-dir/payme/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js b/postman/collection-dir/payme/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js index b831702461e..88e92d8d84a 100644 --- a/postman/collection-dir/payme/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js @@ -1,21 +1,39 @@ -// Validate status 2xx -pm.test("[POST]::/account/:account_id/connectors - 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.be.success; + }, +); // Validate if response header has matching content-type -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"); -}); +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){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id if (jsonData?.merchant_connector_id) { - pm.collectionVariables.set("merchant_connector_id", jsonData.merchant_connector_id); - console.log("- use {{merchant_connector_id}} as collection variable for value",jsonData.merchant_connector_id); + pm.collectionVariables.set( + "merchant_connector_id", + jsonData.merchant_connector_id, + ); + console.log( + "- use {{merchant_connector_id}} as collection variable for value", + jsonData.merchant_connector_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.", + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/QuickStart/Payment Connector - Create/request.json b/postman/collection-dir/payme/Flow Testcases/QuickStart/Payment Connector - Create/request.json index 3eb11d7376f..0b4d60ea78d 100644 --- a/postman/collection-dir/payme/Flow Testcases/QuickStart/Payment Connector - Create/request.json +++ b/postman/collection-dir/payme/Flow Testcases/QuickStart/Payment Connector - Create/request.json @@ -55,10 +55,7 @@ "payment_method_types": [ { "payment_method_type": "credit", - "card_networks": [ - "Visa", - "Mastercard" - ], + "card_networks": ["Visa", "Mastercard"], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, @@ -66,10 +63,7 @@ }, { "payment_method_type": "debit", - "card_networks": [ - "Visa", - "Mastercard" - ], + "card_networks": ["Visa", "Mastercard"], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, @@ -84,10 +78,7 @@ { "type": "CARD", "parameters": { - "allowed_auth_methods": [ - "PAN_ONLY", - "CRYPTOGRAM_3DS" - ], + "allowed_auth_methods": ["PAN_ONLY", "CRYPTOGRAM_3DS"], "allowed_card_networks": [ "AMEX", "DISCOVER", @@ -115,14 +106,8 @@ }, "url": { "raw": "{{baseUrl}}/account/:account_id/connectors", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/payme/Flow Testcases/QuickStart/Payments - Create/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/QuickStart/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/QuickStart/Payments - Create/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/QuickStart/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/QuickStart/Payments - Create/event.test.js b/postman/collection-dir/payme/Flow Testcases/QuickStart/Payments - Create/event.test.js index 62142d52dca..a6947db94c0 100644 --- a/postman/collection-dir/payme/Flow Testcases/QuickStart/Payments - Create/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/QuickStart/Payments - Create/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/QuickStart/Payments - Create/request.json b/postman/collection-dir/payme/Flow Testcases/QuickStart/Payments - Create/request.json index ab04d6475a3..a99d3db4fa5 100644 --- a/postman/collection-dir/payme/Flow Testcases/QuickStart/Payments - Create/request.json +++ b/postman/collection-dir/payme/Flow Testcases/QuickStart/Payments - Create/request.json @@ -87,12 +87,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/payme/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js b/postman/collection-dir/payme/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js index 4dd072b2222..d0a02af7436 100644 --- a/postman/collection-dir/payme/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // 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.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/QuickStart/Payments - Retrieve/request.json b/postman/collection-dir/payme/Flow Testcases/QuickStart/Payments - Retrieve/request.json index c71774083b2..ef0b213739d 100644 --- a/postman/collection-dir/payme/Flow Testcases/QuickStart/Payments - Retrieve/request.json +++ b/postman/collection-dir/payme/Flow Testcases/QuickStart/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js index 6c48697032e..15a759e4d78 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js @@ -1,54 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 "invalid_request" 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"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json index 378ec21bc62..38c0d53e64c 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json @@ -79,12 +79,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js index 18804c43147..068c6369d7d 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js @@ -1,56 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); - // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 "invalid_request " 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"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json index 26ad56dae1f..4217381edec 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json @@ -79,12 +79,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js index c2a8eec14f9..c56d15aaee8 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js @@ -1,55 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 "Json deserialize error" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments - Content check if value for 'error.type' matches 'Json deserialize error'", function() { - pm.expect(jsonData.error.type).to.eql("Json deserialize error"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'Json deserialize error'", + function () { + pm.expect(jsonData.error.type).to.eql("Json deserialize error"); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json index 03d94032457..57cd41a7218 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json @@ -75,12 +75,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js index f221e865a1a..db75f274f9a 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js @@ -1,55 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 "invalid_request" 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"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json index 37b12f543f8..7e428dc8080 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json @@ -79,12 +79,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json index 90b19864ee1..f2bee31ef66 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Confirm" - ] + "childrenOrder": ["Payments - Create", "Payments - Confirm"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js index 1e8ba8cc3a6..e8d6b2216c5 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js @@ -1,58 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); -}); - - +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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json index b28abd0c309..e3b1e235042 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json @@ -67,12 +67,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js index c3e7afc6760..46bf201d1ce 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js @@ -1,59 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json index 766a8330d6e..6c934a9132c 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js index b0e69cad2c2..d683186aa00 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json index 2084b6bd5e8..0fc567f8bea 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json @@ -87,12 +87,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js index 6b03e0b9ee6..34beacf976b 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" 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"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json index cafd3a6808e..6df7c0a1943 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Capture" - ] + "childrenOrder": ["Payments - Create", "Payments - Capture"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js index c3e7afc6760..46bf201d1ce 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js @@ -1,59 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json index 766a8330d6e..6c934a9132c 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json index d5cc39cacc4..a63210df7f4 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json @@ -87,12 +87,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json index afba25ab6d6..5ff1a7cb4e8 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Cancel" - ] + "childrenOrder": ["Payments - Create", "Payments - Cancel"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js index d7879c70d87..0f869a6dfb8 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js @@ -1,50 +1,69 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/cancel - Status code is 4xx", function () { - pm.response.to.be.error; + 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/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/cancel - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; - - - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json index d5cc39cacc4..a63210df7f4 100644 --- a/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json +++ b/postman/collection-dir/payme/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json @@ -87,12 +87,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/payme/Health check/.meta.json b/postman/collection-dir/payme/Health check/.meta.json index 66ee7e50cab..579f9fd541c 100644 --- a/postman/collection-dir/payme/Health check/.meta.json +++ b/postman/collection-dir/payme/Health check/.meta.json @@ -1,5 +1,3 @@ { - "childrenOrder": [ - "New Request" - ] + "childrenOrder": ["New Request"] } diff --git a/postman/collection-dir/payme/Health check/New Request/.event.meta.json b/postman/collection-dir/payme/Health check/New Request/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/payme/Health check/New Request/.event.meta.json +++ b/postman/collection-dir/payme/Health check/New Request/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/payme/Health check/New Request/event.test.js b/postman/collection-dir/payme/Health check/New Request/event.test.js index 325a8c8a479..b490b8be090 100644 --- a/postman/collection-dir/payme/Health check/New Request/event.test.js +++ b/postman/collection-dir/payme/Health check/New Request/event.test.js @@ -1,4 +1,4 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - Status code is 2xx", function () { - pm.response.to.be.success; -}); \ No newline at end of file + pm.response.to.be.success; +}); diff --git a/postman/collection-dir/payme/Health check/New Request/request.json b/postman/collection-dir/payme/Health check/New Request/request.json index 4cc8d4b1a96..e40e9396178 100644 --- a/postman/collection-dir/payme/Health check/New Request/request.json +++ b/postman/collection-dir/payme/Health check/New Request/request.json @@ -10,11 +10,7 @@ ], "url": { "raw": "{{baseUrl}}/health", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "health" - ] + "host": ["{{baseUrl}}"], + "path": ["health"] } } diff --git a/postman/collection-dir/payme/event.test.js b/postman/collection-dir/payme/event.test.js index 69037688f22..fb52caec30f 100644 --- a/postman/collection-dir/payme/event.test.js +++ b/postman/collection-dir/payme/event.test.js @@ -1,11 +1,13 @@ // 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("[LOG]::payment_id - " + jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log("[LOG]::payment_id - " + jsonData.payment_id); } -console.log("[LOG]::x-request-id - " + pm.response.headers.get('x-request-id')); \ No newline at end of file +console.log("[LOG]::x-request-id - " + pm.response.headers.get("x-request-id")); diff --git a/postman/collection-dir/paypal/.event.meta.json b/postman/collection-dir/paypal/.event.meta.json index 2df9d47d936..eb871bbcb9b 100644 --- a/postman/collection-dir/paypal/.event.meta.json +++ b/postman/collection-dir/paypal/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.prerequest.js", - "event.test.js" - ] + "eventOrder": ["event.prerequest.js", "event.test.js"] } diff --git a/postman/collection-dir/paypal/.meta.json b/postman/collection-dir/paypal/.meta.json index 91b6a65c5bc..d513035ce2d 100644 --- a/postman/collection-dir/paypal/.meta.json +++ b/postman/collection-dir/paypal/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Health check", - "Flow Testcases" - ] + "childrenOrder": ["Health check", "Flow Testcases"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/.meta.json b/postman/collection-dir/paypal/Flow Testcases/.meta.json index 1bbce843680..023989e1e49 100644 --- a/postman/collection-dir/paypal/Flow Testcases/.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/.meta.json @@ -1,7 +1,3 @@ { - "childrenOrder": [ - "QuickStart", - "Happy Cases", - "Variation Cases" - ] + "childrenOrder": ["QuickStart", "Happy Cases", "Variation Cases"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js index 2d21ad61e16..aeb351e4dad 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js @@ -1,56 +1,78 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("paypal"); + pm.expect(jsonData.connector).to.eql("paypal"); }); // //Validate the amount @@ -60,16 +82,21 @@ pm.test("[POST]::/payments - connector", function () { // }); // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "6540" for "amount_received" -if (jsonData?.amount_received){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'amount - 6540'", function() { - pm.expect(jsonData.amount_received).to.eql(6540); - } ) -} - +if (jsonData?.amount_received) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'amount - 6540'", + function () { + pm.expect(jsonData.amount_received).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json index 47f08f9f372..144a35f773a 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json @@ -76,12 +76,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js index 38eb2ba70a6..78121d8fe5d 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js @@ -1,65 +1,91 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "6540" for "amount_received" -if (jsonData?.amount_received){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'amount - 6540'", function() { - pm.expect(jsonData.amount_received).to.eql(6540); - } ) -} +if (jsonData?.amount_received) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'amount - 6540'", + function () { + pm.expect(jsonData.amount_received).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Capture/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Capture/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Capture/event.test.js index 2ec57849ff6..d08e91cd6e8 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Capture/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Capture/event.test.js @@ -1,77 +1,109 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/capture - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "processing" for "status" if (jsonData?.status) { -pm.test("[POST]:://payments/:id/capture - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; + pm.test( + "[POST]:://payments/:id/capture - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("paypal"); + pm.expect(jsonData.connector).to.eql("paypal"); }); // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "6000" for "amount_received" if (jsonData?.amount_received) { -pm.test("[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", function() { - pm.expect(jsonData.amount_received).to.eql(6000); -})}; + pm.test( + "[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", + function () { + pm.expect(jsonData.amount_received).to.eql(6000); + }, + ); +} // Response body should have value "6540" for "amount_capturable" -if (jsonData?.amount_capturable){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", function() { - pm.expect(jsonData.amount_capturable).to.eql(540); - } ) -} - +if (jsonData?.amount_capturable) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(540); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Capture/request.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Capture/request.json index 8975575ca40..9fe257ed85e 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Capture/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Create/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Create/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Create/event.test.js index c9938ab205c..413f34a4c9d 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Create/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Create/event.test.js @@ -1,78 +1,106 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("paypal"); + pm.expect(jsonData.connector).to.eql("paypal"); }); // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "null" for "amount_received" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", function() { - pm.expect(jsonData.amount_received).to.eql(null); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", + function () { + pm.expect(jsonData.amount_received).to.eql(null); + }, + ); +} // Response body should have value "6540" for "amount_capturable" -if (jsonData?.amount_capturable){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", function() { - pm.expect(jsonData.amount_capturable).to.eql(6540); - } ) -} - - +if (jsonData?.amount_capturable) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Create/request.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Create/request.json index c4f2248a4f4..5b606850fd2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Create/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Create/request.json @@ -76,12 +76,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Retrieve/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Retrieve/event.test.js index d2328ccd1ec..8e84e4b3846 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Retrieve/event.test.js @@ -1,75 +1,106 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("paypal"); + pm.expect(jsonData.connector).to.eql("paypal"); }); // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "6000" for "amount_received" if (jsonData?.amount_received) { -pm.test("[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", function() { - pm.expect(jsonData.amount_received).to.eql(6000); -})}; + pm.test( + "[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", + function () { + pm.expect(jsonData.amount_received).to.eql(6000); + }, + ); +} // Response body should have value "6540" for "amount_capturable" -if (jsonData?.amount_capturable){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", function() { - pm.expect(jsonData.amount_capturable).to.eql(540); - } ) -} \ No newline at end of file +if (jsonData?.amount_capturable) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(540); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Retrieve/request.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js index 8268f4440bb..67a19c80f0a 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js @@ -1,73 +1,99 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.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 "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("paypal"); + pm.expect(jsonData.connector).to.eql("paypal"); }); - // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} - +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "6540" for "amount_capturable" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 0'", function() { - pm.expect(jsonData.amount_capturable).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 0'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js index f24648126a2..0981c872f67 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js @@ -1,71 +1,101 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; - + 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 value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "null" for "amount_received" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", function() { - pm.expect(jsonData.amount_received).to.eql(null); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", + function () { + pm.expect(jsonData.amount_received).to.eql(null); + }, + ); +} // Response body should have value "6540" for "amount_capturable" -if (jsonData?.amount_capturable){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", function() { - pm.expect(jsonData.amount_capturable).to.eql(6540); - } ) -} +if (jsonData?.amount_capturable) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json index b560256741c..a6a8150c240 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json @@ -76,12 +76,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js index 066365380be..f1d49169ba3 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js @@ -1,69 +1,96 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("paypal"); + pm.expect(jsonData.connector).to.eql("paypal"); }); // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} - +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "6540" for "amount_capturable" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 0'", function() { - pm.expect(jsonData.amount_capturable).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 0'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js index b418e9d1fa8..fa4f277ad65 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js @@ -1,73 +1,99 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.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 "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id/confirm - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; + pm.test( + "[POST]::/payments:id/confirm - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("paypal"); + pm.expect(jsonData.connector).to.eql("paypal"); }); - // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} - +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "6540" for "amount_capturable" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 0'", function() { - pm.expect(jsonData.amount_capturable).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 0'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json index 76f2c294ebf..b9e2faa143c 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "card", "payment_method_data": { "card": { @@ -32,14 +53,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js index c9e203b9254..04de14459b5 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js @@ -1,71 +1,101 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "null" for "amount_received" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", function() { - pm.expect(jsonData.amount_received).to.eql(null); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", + function () { + pm.expect(jsonData.amount_received).to.eql(null); + }, + ); +} // Response body should have value "6540" for "amount_capturable" -if (jsonData?.amount_capturable){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", function() { - pm.expect(jsonData.amount_capturable).to.eql(6540); - } ) -} - +if (jsonData?.amount_capturable) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json index b28abd0c309..e3b1e235042 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json @@ -67,12 +67,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js index 0f307f77caf..f1d49169ba3 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js @@ -1,71 +1,96 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("paypal"); + pm.expect(jsonData.connector).to.eql("paypal"); }); - // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} - +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "6540" for "amount_capturable" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 0'", function() { - pm.expect(jsonData.amount_capturable).to.eql(6540); - } ) -} - +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 0'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Capture/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Capture/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Capture/event.test.js index 750c04b9ced..d08e91cd6e8 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Capture/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Capture/event.test.js @@ -1,79 +1,109 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/capture - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); - -// Validate if response has JSON Body +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.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 "processing" for "status" if (jsonData?.status) { -pm.test("[POST]:://payments/:id/capture - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; + pm.test( + "[POST]:://payments/:id/capture - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("paypal"); + pm.expect(jsonData.connector).to.eql("paypal"); }); // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "6000" for "amount_received" if (jsonData?.amount_received) { -pm.test("[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", function() { - pm.expect(jsonData.amount_received).to.eql(6000); -})}; + pm.test( + "[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", + function () { + pm.expect(jsonData.amount_received).to.eql(6000); + }, + ); +} // Response body should have value "6540" for "amount_capturable" -if (jsonData?.amount_capturable){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", function() { - pm.expect(jsonData.amount_capturable).to.eql(540); - } ) -} - - - +if (jsonData?.amount_capturable) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(540); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Capture/request.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Capture/request.json index 8975575ca40..9fe257ed85e 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Capture/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Confirm/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Confirm/event.test.js index b6eaf0a6497..7e825db7de1 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Confirm/event.test.js @@ -1,81 +1,109 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.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.", + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("paypal"); + pm.expect(jsonData.connector).to.eql("paypal"); }); // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "null" for "amount_received" -if (jsonData?.amount_received){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", function() { - pm.expect(jsonData.amount_received).to.eql(null); - } ) -} +if (jsonData?.amount_received) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", + function () { + pm.expect(jsonData.amount_received).to.eql(null); + }, + ); +} // 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 'amount - 0'", function() { - pm.expect(jsonData.amount_capturable).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 0'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Confirm/request.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Confirm/request.json index b7a4aa5998f..1c3a9e08ac3 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Confirm/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Create/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Create/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Create/event.test.js index a00b7a7ada8..46d22efaaae 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Create/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Create/event.test.js @@ -1,72 +1,101 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_confirmation" 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_confirmation"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "null" for "amount_received" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", function() { - pm.expect(jsonData.amount_received).to.eql(null); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", + function () { + pm.expect(jsonData.amount_received).to.eql(null); + }, + ); +} // Response body should have value "6540" for "amount_capturable" -if (jsonData?.amount_capturable){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", function() { - pm.expect(jsonData.amount_capturable).to.eql(6540); - } ) -} - - +if (jsonData?.amount_capturable) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Create/request.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Create/request.json index de5aa29f7b0..50cb0663b40 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Create/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Create/request.json @@ -76,12 +76,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Retrieve/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Retrieve/event.test.js index d2328ccd1ec..8e84e4b3846 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Retrieve/event.test.js @@ -1,75 +1,106 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("paypal"); + pm.expect(jsonData.connector).to.eql("paypal"); }); // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "6000" for "amount_received" if (jsonData?.amount_received) { -pm.test("[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", function() { - pm.expect(jsonData.amount_received).to.eql(6000); -})}; + pm.test( + "[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", + function () { + pm.expect(jsonData.amount_received).to.eql(6000); + }, + ); +} // Response body should have value "6540" for "amount_capturable" -if (jsonData?.amount_capturable){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", function() { - pm.expect(jsonData.amount_capturable).to.eql(540); - } ) -} \ No newline at end of file +if (jsonData?.amount_capturable) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(540); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Retrieve/request.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js index 55755418f4f..d2574b4816b 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js @@ -1,77 +1,109 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/capture - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "processing" for "status" if (jsonData?.status) { -pm.test("[POST]:://payments/:id/capture - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; + pm.test( + "[POST]:://payments/:id/capture - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("paypal"); + pm.expect(jsonData.connector).to.eql("paypal"); }); // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "6000" for "amount_received" if (jsonData?.amount_received) { -pm.test("[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", function() { - pm.expect(jsonData.amount_received).to.eql(6540); -})}; + pm.test( + "[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", + function () { + pm.expect(jsonData.amount_received).to.eql(6540); + }, + ); +} // Response body should have value "6540" for "amount_capturable" -if (jsonData?.amount_capturable){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", function() { - pm.expect(jsonData.amount_capturable).to.eql(0); - } ) -} - +if (jsonData?.amount_capturable) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(0); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json index 8efb99d3c90..cceb2b55f0a 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js index c9938ab205c..413f34a4c9d 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js @@ -1,78 +1,106 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("paypal"); + pm.expect(jsonData.connector).to.eql("paypal"); }); // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "null" for "amount_received" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", function() { - pm.expect(jsonData.amount_received).to.eql(null); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", + function () { + pm.expect(jsonData.amount_received).to.eql(null); + }, + ); +} // Response body should have value "6540" for "amount_capturable" -if (jsonData?.amount_capturable){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", function() { - pm.expect(jsonData.amount_capturable).to.eql(6540); - } ) -} - - +if (jsonData?.amount_capturable) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json index c4f2248a4f4..5b606850fd2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json @@ -76,12 +76,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js index 712133c2fd0..c5396fe43da 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js @@ -1,75 +1,106 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("paypal"); + pm.expect(jsonData.connector).to.eql("paypal"); }); // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "6000" for "amount_received" if (jsonData?.amount_received) { -pm.test("[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", function() { - pm.expect(jsonData.amount_received).to.eql(6540); -})}; + pm.test( + "[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", + function () { + pm.expect(jsonData.amount_received).to.eql(6540); + }, + ); +} // Response body should have value "6540" for "amount_capturable" -if (jsonData?.amount_capturable){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", function() { - pm.expect(jsonData.amount_capturable).to.eql(0); - } ) -} \ No newline at end of file +if (jsonData?.amount_capturable) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(0); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js index 9632bd19048..dcf3f191643 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js @@ -1,43 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/cancel - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type 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(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "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"); -})}; - - - + pm.test( + "[POST]::/payments/:id/cancel - Content check if value for 'status' matches 'cancelled'", + function () { + pm.expect(jsonData.status).to.eql("cancelled"); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js index 9565001a2e5..413f34a4c9d 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js @@ -1,75 +1,106 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("paypal"); + pm.expect(jsonData.connector).to.eql("paypal"); }); // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "null" for "amount_received" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", function() { - pm.expect(jsonData.amount_received).to.eql(null); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", + function () { + pm.expect(jsonData.amount_received).to.eql(null); + }, + ); +} // Response body should have value "6540" for "amount_capturable" -if (jsonData?.amount_capturable){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", function() { - pm.expect(jsonData.amount_capturable).to.eql(6540); - } ) -} +if (jsonData?.amount_capturable) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json index c4f2248a4f4..5b606850fd2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json @@ -76,12 +76,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js index f4e0ab9b2aa..5e52e13a59e 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "cancelled" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'", function() { - pm.expect(jsonData.status).to.eql("cancelled"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'", + function () { + pm.expect(jsonData.status).to.eql("cancelled"); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario6-Create Wallet - Paypal/.meta.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario6-Create Wallet - Paypal/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario6-Create Wallet - Paypal/.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario6-Create Wallet - Paypal/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario6-Create Wallet - Paypal/Payments - Create/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario6-Create Wallet - Paypal/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario6-Create Wallet - Paypal/Payments - Create/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario6-Create Wallet - Paypal/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario6-Create Wallet - Paypal/Payments - Create/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario6-Create Wallet - Paypal/Payments - Create/event.test.js index 43f5a98e749..3d4870a6832 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario6-Create Wallet - Paypal/Payments - Create/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario6-Create Wallet - Paypal/Payments - Create/event.test.js @@ -1,80 +1,115 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", function() { - pm.expect(jsonData.status).to.eql("requires_customer_action"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", + function () { + pm.expect(jsonData.status).to.eql("requires_customer_action"); + }, + ); +} // Response body should have "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; -}); +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; + }, +); // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("paypal"); + pm.expect(jsonData.connector).to.eql("paypal"); }); // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "null" for "amount_received" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", function() { - pm.expect(jsonData.amount_received).to.eql(null); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", + function () { + pm.expect(jsonData.amount_received).to.eql(null); + }, + ); +} // Response body should have value "6540" for "amount_capturable" -if (jsonData?.amount_capturable){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", function() { - pm.expect(jsonData.amount_capturable).to.eql(6540); - } ) -} +if (jsonData?.amount_capturable) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario6-Create Wallet - Paypal/Payments - Create/request.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario6-Create Wallet - Paypal/Payments - Create/request.json index a61f8ffa570..f0066e67bbc 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario6-Create Wallet - Paypal/Payments - Create/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario6-Create Wallet - Paypal/Payments - Create/request.json @@ -87,12 +87,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario6-Create Wallet - Paypal/Payments - Retrieve/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario6-Create Wallet - Paypal/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario6-Create Wallet - Paypal/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario6-Create Wallet - Paypal/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario6-Create Wallet - Paypal/Payments - Retrieve/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario6-Create Wallet - Paypal/Payments - Retrieve/event.test.js index 16655d6f7c2..a29b5ea6f2c 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario6-Create Wallet - Paypal/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario6-Create Wallet - Paypal/Payments - Retrieve/event.test.js @@ -1,63 +1,86 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + 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"); + }, + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("paypal"); + pm.expect(jsonData.connector).to.eql("paypal"); }); // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} - +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario6-Create Wallet - Paypal/Payments - Retrieve/request.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario6-Create Wallet - Paypal/Payments - Retrieve/request.json index a8f68e8be1b..c3931e7d04c 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario6-Create Wallet - Paypal/Payments - Retrieve/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario6-Create Wallet - Paypal/Payments - Retrieve/request.json @@ -12,13 +12,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario7-Create Wallet - Paypal with confrm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario7-Create Wallet - Paypal with confrm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario7-Create Wallet - Paypal with confrm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario7-Create Wallet - Paypal with confrm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario7-Create Wallet - Paypal with confrm false/Payments - Confirm/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario7-Create Wallet - Paypal with confrm false/Payments - Confirm/event.test.js index ce6318ee34a..029e382ff0e 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario7-Create Wallet - Paypal with confrm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario7-Create Wallet - Paypal with confrm false/Payments - Confirm/event.test.js @@ -1,83 +1,118 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments/:id/confirm - Content check if 'next_action.redirect_to_url' exists", function() { - pm.expect((typeof jsonData.next_action.redirect_to_url !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments/:id/confirm - Content check if 'next_action.redirect_to_url' exists", + function () { + pm.expect(typeof jsonData.next_action.redirect_to_url !== "undefined").to.be + .true; + }, +); // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("paypal"); + pm.expect(jsonData.connector).to.eql("paypal"); }); // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "null" for "amount_received" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", function() { - pm.expect(jsonData.amount_received).to.eql(null); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", + function () { + pm.expect(jsonData.amount_received).to.eql(null); + }, + ); +} // Response body should have value "6540" for "amount_capturable" -if (jsonData?.amount_capturable){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", function() { - pm.expect(jsonData.amount_capturable).to.eql(6540); - } ) -} +if (jsonData?.amount_capturable) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario7-Create Wallet - Paypal with confrm false/Payments - Confirm/request.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario7-Create Wallet - Paypal with confrm false/Payments - Confirm/request.json index 136c97f40bd..efa17534b1d 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario7-Create Wallet - Paypal with confrm false/Payments - Confirm/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario7-Create Wallet - Paypal with confrm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "wallet", "payment_method_type": "paypal", "payment_method_data": { @@ -29,14 +50,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario7-Create Wallet - Paypal with confrm false/Payments - Create/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario7-Create Wallet - Paypal with confrm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario7-Create Wallet - Paypal with confrm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario7-Create Wallet - Paypal with confrm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario7-Create Wallet - Paypal with confrm false/Payments - Create/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario7-Create Wallet - Paypal with confrm false/Payments - Create/event.test.js index d75dea1c838..757cabb9bbf 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario7-Create Wallet - Paypal with confrm false/Payments - Create/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario7-Create Wallet - Paypal with confrm false/Payments - Create/event.test.js @@ -1,71 +1,101 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + 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 value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "null" for "amount_received" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", function() { - pm.expect(jsonData.amount_received).to.eql(null); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", + function () { + pm.expect(jsonData.amount_received).to.eql(null); + }, + ); +} // Response body should have value "6540" for "amount_capturable" -if (jsonData?.amount_capturable){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", function() { - pm.expect(jsonData.amount_capturable).to.eql(6540); - } ) -} - +if (jsonData?.amount_capturable) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario7-Create Wallet - Paypal with confrm false/Payments - Create/request.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario7-Create Wallet - Paypal with confrm false/Payments - Create/request.json index 3a7ba690270..792e7c399fc 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario7-Create Wallet - Paypal with confrm false/Payments - Create/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario7-Create Wallet - Paypal with confrm false/Payments - Create/request.json @@ -80,12 +80,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario7-Create Wallet - Paypal with confrm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario7-Create Wallet - Paypal with confrm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario7-Create Wallet - Paypal with confrm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario7-Create Wallet - Paypal with confrm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario7-Create Wallet - Paypal with confrm false/Payments - Retrieve/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario7-Create Wallet - Paypal with confrm false/Payments - Retrieve/event.test.js index f636be6ef3b..a29b5ea6f2c 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario7-Create Wallet - Paypal with confrm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario7-Create Wallet - Paypal with confrm false/Payments - Retrieve/event.test.js @@ -1,61 +1,86 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + 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"); + }, + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("paypal"); + pm.expect(jsonData.connector).to.eql("paypal"); }); // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario7-Create Wallet - Paypal with confrm false/Payments - Retrieve/request.json b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario7-Create Wallet - Paypal with confrm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario7-Create Wallet - Paypal with confrm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario7-Create Wallet - Paypal with confrm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/paypal/Flow Testcases/QuickStart/API Key - Create/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/QuickStart/API Key - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/QuickStart/API Key - Create/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/QuickStart/API Key - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/QuickStart/API Key - Create/event.test.js b/postman/collection-dir/paypal/Flow Testcases/QuickStart/API Key - Create/event.test.js index bc42e83a761..4e27c5a5025 100644 --- a/postman/collection-dir/paypal/Flow Testcases/QuickStart/API Key - Create/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/QuickStart/API Key - Create/event.test.js @@ -1,32 +1,46 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/api_keys/:merchant_id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/api_keys/:merchant_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/api_keys/:merchant_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; try { jsonData = pm.response.json(); -} catch(e) { -} +} catch (e) {} // pm.collectionVariables - Set api_key_id as variable for jsonData.key_id if (jsonData?.key_id) { - pm.collectionVariables.set("api_key_id", jsonData.key_id); - console.log("- use {{api_key_id}} as collection variable for value", jsonData.key_id); + pm.collectionVariables.set("api_key_id", jsonData.key_id); + console.log( + "- use {{api_key_id}} as collection variable for value", + jsonData.key_id, + ); } else { - console.log('INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value", jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/QuickStart/API Key - Create/request.json b/postman/collection-dir/paypal/Flow Testcases/QuickStart/API Key - Create/request.json index 29c2490d1bc..2210d14da0e 100644 --- a/postman/collection-dir/paypal/Flow Testcases/QuickStart/API Key - Create/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/QuickStart/API Key - Create/request.json @@ -35,13 +35,8 @@ }, "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/paypal/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js b/postman/collection-dir/paypal/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js index 538b393c084..7de0d5beb31 100644 --- a/postman/collection-dir/paypal/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js @@ -1,37 +1,56 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - 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]::/accounts - 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", + ); }); // 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 merchant_id as variable for jsonData.merchant_id if (jsonData?.merchant_id) { - pm.collectionVariables.set("merchant_id", jsonData.merchant_id); - console.log("- use {{merchant_id}} as collection variable for value",jsonData.merchant_id); + pm.collectionVariables.set("merchant_id", jsonData.merchant_id); + console.log( + "- use {{merchant_id}} as collection variable for value", + jsonData.merchant_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value",jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} // pm.collectionVariables - Set publishable_key as variable for jsonData.publishable_key if (jsonData?.publishable_key) { - pm.collectionVariables.set("publishable_key", jsonData.publishable_key); - console.log("- use {{publishable_key}} as collection variable for value",jsonData.publishable_key); + pm.collectionVariables.set("publishable_key", jsonData.publishable_key); + console.log( + "- use {{publishable_key}} as collection variable for value", + jsonData.publishable_key, + ); } else { - console.log('INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.", + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/QuickStart/Merchant Account - Create/request.json b/postman/collection-dir/paypal/Flow Testcases/QuickStart/Merchant Account - Create/request.json index 6db656fb0ce..7df5315150c 100644 --- a/postman/collection-dir/paypal/Flow Testcases/QuickStart/Merchant Account - Create/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/QuickStart/Merchant Account - Create/request.json @@ -84,12 +84,8 @@ }, "url": { "raw": "{{baseUrl}}/accounts", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "accounts" - ] + "host": ["{{baseUrl}}"], + "path": ["accounts"] }, "description": "Create a new account for a merchant. The merchant could be a seller or retailer or client who likes to receive and send payments." } diff --git a/postman/collection-dir/paypal/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js b/postman/collection-dir/paypal/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js index b831702461e..88e92d8d84a 100644 --- a/postman/collection-dir/paypal/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js @@ -1,21 +1,39 @@ -// Validate status 2xx -pm.test("[POST]::/account/:account_id/connectors - 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.be.success; + }, +); // Validate if response header has matching content-type -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"); -}); +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){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id if (jsonData?.merchant_connector_id) { - pm.collectionVariables.set("merchant_connector_id", jsonData.merchant_connector_id); - console.log("- use {{merchant_connector_id}} as collection variable for value",jsonData.merchant_connector_id); + pm.collectionVariables.set( + "merchant_connector_id", + jsonData.merchant_connector_id, + ); + console.log( + "- use {{merchant_connector_id}} as collection variable for value", + jsonData.merchant_connector_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.", + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/QuickStart/Payment Connector - Create/request.json b/postman/collection-dir/paypal/Flow Testcases/QuickStart/Payment Connector - Create/request.json index 35468067055..d5cdb779adf 100644 --- a/postman/collection-dir/paypal/Flow Testcases/QuickStart/Payment Connector - Create/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/QuickStart/Payment Connector - Create/request.json @@ -55,10 +55,7 @@ "payment_method_types": [ { "payment_method_type": "credit", - "card_networks": [ - "Visa", - "Mastercard" - ], + "card_networks": ["Visa", "Mastercard"], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, @@ -66,10 +63,7 @@ }, { "payment_method_type": "debit", - "card_networks": [ - "Visa", - "Mastercard" - ], + "card_networks": ["Visa", "Mastercard"], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, @@ -99,14 +93,8 @@ }, "url": { "raw": "{{baseUrl}}/account/:account_id/connectors", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/paypal/Flow Testcases/QuickStart/Payments - Create/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/QuickStart/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/QuickStart/Payments - Create/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/QuickStart/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/QuickStart/Payments - Create/event.test.js b/postman/collection-dir/paypal/Flow Testcases/QuickStart/Payments - Create/event.test.js index 62142d52dca..a6947db94c0 100644 --- a/postman/collection-dir/paypal/Flow Testcases/QuickStart/Payments - Create/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/QuickStart/Payments - Create/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/QuickStart/Payments - Create/request.json b/postman/collection-dir/paypal/Flow Testcases/QuickStart/Payments - Create/request.json index 872fac0738c..07ffc4eedef 100644 --- a/postman/collection-dir/paypal/Flow Testcases/QuickStart/Payments - Create/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/QuickStart/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/paypal/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js b/postman/collection-dir/paypal/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js index 4dd072b2222..d0a02af7436 100644 --- a/postman/collection-dir/paypal/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // 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.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/QuickStart/Payments - Retrieve/request.json b/postman/collection-dir/paypal/Flow Testcases/QuickStart/Payments - Retrieve/request.json index c71774083b2..ef0b213739d 100644 --- a/postman/collection-dir/paypal/Flow Testcases/QuickStart/Payments - Retrieve/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/QuickStart/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js index d085d05f9a1..e2c54d3409d 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js @@ -1,60 +1,86 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} // Response body should have value "Invalid Expiry Year" for "message" if (jsonData?.error?.message) { -pm.test("[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'", function() { - pm.expect(jsonData.error.message).to.eql("Invalid Expiry Year"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'", + function () { + pm.expect(jsonData.error.message).to.eql("Invalid Expiry Year"); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json index ad281c58256..9cbdbc8e22f 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js index 85f52ad4af6..f32645dbe28 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js @@ -1,62 +1,86 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); - // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 "invalid_request" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments - Content check if value for 'error.type' matches 'connector'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} // Response body should have value "Invalid Expiry Month" for "reason" if (jsonData?.error?.message) { -pm.test("[POST]::/payments - Content check if value for 'error.message' matches 'connector_error'", function() { - pm.expect(jsonData.error.message).to.eql("Invalid Expiry Month"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.message' matches 'connector_error'", + function () { + pm.expect(jsonData.error.message).to.eql("Invalid Expiry Month"); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json index 03e71d6c7ea..6e9db26a339 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js index d0b365fa916..57900d52342 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js @@ -1,61 +1,92 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_confirmation" 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"); -})}; + 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 "requires_confirmation" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'error_code' matches 'UNPROCESSABLE_ENTITY'", function() { - pm.expect(jsonData.error_code).to.eql("UNPROCESSABLE_ENTITY"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'error_code' matches 'UNPROCESSABLE_ENTITY'", + function () { + pm.expect(jsonData.error_code).to.eql("UNPROCESSABLE_ENTITY"); + }, + ); +} // Response body should have value "requires_confirmation" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'error_message' matches 'failed'", function() { - pm.expect(jsonData.error_message).to.eql("description - Invalid card number, field - number;"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'error_message' matches 'failed'", + function () { + pm.expect(jsonData.error_message).to.eql( + "description - Invalid card number, field - number;", + ); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json index ce7ff7bfa48..51e6cdf2a66 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json @@ -75,12 +75,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js index 38dfb34a9f9..c39719fe296 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js @@ -1,61 +1,86 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 "invalid_request" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments - Content check if value for 'error.type' matches 'connector'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} // Response body should have value "Invalid card_cvc length" for "message" if (jsonData?.error?.message) { -pm.test("[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'", function() { - pm.expect(jsonData.error.message).to.eql("Invalid card_cvc length"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'", + function () { + pm.expect(jsonData.error.message).to.eql("Invalid card_cvc length"); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json index bd5526d6f86..0b35b7a4e92 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json index 90b19864ee1..f2bee31ef66 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Confirm" - ] + "childrenOrder": ["Payments - Create", "Payments - Confirm"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js index 2c8f4b5ecad..e03c186a82e 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js @@ -1,64 +1,94 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); -}); - - +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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} // Response body should have value "A payment token or payment method data is required" for "message" if (jsonData?.error?.message) { -pm.test("[POST]::/payments - Content check if value for 'error.message' matches 'connector_error'", function() { - pm.expect(jsonData.error.message).to.eql("A payment token or payment method data is required"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.message' matches 'connector_error'", + function () { + pm.expect(jsonData.error.message).to.eql( + "A payment token or payment method data is required", + ); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json index b28abd0c309..e3b1e235042 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json @@ -67,12 +67,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js index fa97098610f..2b35f439a6f 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js @@ -1,64 +1,94 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} // Response body should have value "amount_to_capture is greater than amount" for "message" if (jsonData?.error?.message) { -pm.test("[POST]::/payments - Content check if value for 'error.message' matches 'connector_error'", function() { - pm.expect(jsonData.error.message).to.eql("amount_to_capture is greater than amount"); -})}; - - + pm.test( + "[POST]::/payments - Content check if value for 'error.message' matches 'connector_error'", + function () { + pm.expect(jsonData.error.message).to.eql( + "amount_to_capture is greater than amount", + ); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json index 766a8330d6e..6c934a9132c 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js index 985bb64c732..4744b5ed114 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js @@ -1,83 +1,116 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} // Validate the connector pm.test("[POST]::/payments - connector", function () { - pm.expect(jsonData.connector).to.eql("paypal"); + pm.expect(jsonData.connector).to.eql("paypal"); }); // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "null" for "amount_received" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", function() { - pm.expect(jsonData.amount_received).to.eql(null); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'", + function () { + pm.expect(jsonData.amount_received).to.eql(null); + }, + ); +} // Response body should have value "6540" for "amount_capturable" -if (jsonData?.amount_capturable){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", function() { - pm.expect(jsonData.amount_capturable).to.eql(6540); - } ) -} - +if (jsonData?.amount_capturable) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json index c4f2248a4f4..5b606850fd2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json @@ -76,12 +76,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js index 6b03e0b9ee6..34beacf976b 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" 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"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json index cafd3a6808e..6df7c0a1943 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Capture" - ] + "childrenOrder": ["Payments - Create", "Payments - Capture"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js index c16698c0074..46bf201d1ce 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js @@ -1,60 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json index 766a8330d6e..6c934a9132c 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js index cd0c4d65e21..16c37817f0b 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json index 47f08f9f372..144a35f773a 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json @@ -76,12 +76,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json index afba25ab6d6..5ff1a7cb4e8 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Cancel" - ] + "childrenOrder": ["Payments - Create", "Payments - Cancel"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js index d7879c70d87..0f869a6dfb8 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js @@ -1,50 +1,69 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/cancel - Status code is 4xx", function () { - pm.response.to.be.error; + 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/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/cancel - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; - - - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js index cd0c4d65e21..16c37817f0b 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "processing" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json index 06284e30aed..09987daa71e 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js index 65232a76373..55dc35b9128 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; - - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json index 758498447dd..45feadeb3c3 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js index 42bf3e0ac45..fdb8a946f3d 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js index 30888b5cc0c..d3c4451760d 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js @@ -1,32 +1,48 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/refunds - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + 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; -}); +pm.test( + "[POST]::/payments/:id/confirm - Content check if 'error' exists", + function () { + pm.expect(typeof jsonData.error !== "undefined").to.be.true; + }, +); // Response body should have value "invalid_request" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; + pm.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"); + }, + ); +} diff --git a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json index d18aaf8befd..9fe125ce8ea 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json +++ b/postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/paypal/Health check/.meta.json b/postman/collection-dir/paypal/Health check/.meta.json index 66ee7e50cab..579f9fd541c 100644 --- a/postman/collection-dir/paypal/Health check/.meta.json +++ b/postman/collection-dir/paypal/Health check/.meta.json @@ -1,5 +1,3 @@ { - "childrenOrder": [ - "New Request" - ] + "childrenOrder": ["New Request"] } diff --git a/postman/collection-dir/paypal/Health check/New Request/.event.meta.json b/postman/collection-dir/paypal/Health check/New Request/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/paypal/Health check/New Request/.event.meta.json +++ b/postman/collection-dir/paypal/Health check/New Request/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/paypal/Health check/New Request/event.test.js b/postman/collection-dir/paypal/Health check/New Request/event.test.js index 325a8c8a479..b490b8be090 100644 --- a/postman/collection-dir/paypal/Health check/New Request/event.test.js +++ b/postman/collection-dir/paypal/Health check/New Request/event.test.js @@ -1,4 +1,4 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - Status code is 2xx", function () { - pm.response.to.be.success; -}); \ No newline at end of file + pm.response.to.be.success; +}); diff --git a/postman/collection-dir/paypal/Health check/New Request/request.json b/postman/collection-dir/paypal/Health check/New Request/request.json index 4cc8d4b1a96..e40e9396178 100644 --- a/postman/collection-dir/paypal/Health check/New Request/request.json +++ b/postman/collection-dir/paypal/Health check/New Request/request.json @@ -10,11 +10,7 @@ ], "url": { "raw": "{{baseUrl}}/health", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "health" - ] + "host": ["{{baseUrl}}"], + "path": ["health"] } } diff --git a/postman/collection-dir/paypal/event.test.js b/postman/collection-dir/paypal/event.test.js index 69037688f22..fb52caec30f 100644 --- a/postman/collection-dir/paypal/event.test.js +++ b/postman/collection-dir/paypal/event.test.js @@ -1,11 +1,13 @@ // 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("[LOG]::payment_id - " + jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log("[LOG]::payment_id - " + jsonData.payment_id); } -console.log("[LOG]::x-request-id - " + pm.response.headers.get('x-request-id')); \ No newline at end of file +console.log("[LOG]::x-request-id - " + pm.response.headers.get("x-request-id")); diff --git a/postman/collection-dir/powertranz/.event.meta.json b/postman/collection-dir/powertranz/.event.meta.json index 2df9d47d936..eb871bbcb9b 100644 --- a/postman/collection-dir/powertranz/.event.meta.json +++ b/postman/collection-dir/powertranz/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.prerequest.js", - "event.test.js" - ] + "eventOrder": ["event.prerequest.js", "event.test.js"] } diff --git a/postman/collection-dir/powertranz/.meta.json b/postman/collection-dir/powertranz/.meta.json index 91b6a65c5bc..d513035ce2d 100644 --- a/postman/collection-dir/powertranz/.meta.json +++ b/postman/collection-dir/powertranz/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Health check", - "Flow Testcases" - ] + "childrenOrder": ["Health check", "Flow Testcases"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/.meta.json b/postman/collection-dir/powertranz/Flow Testcases/.meta.json index 1bbce843680..023989e1e49 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/.meta.json @@ -1,7 +1,3 @@ { - "childrenOrder": [ - "QuickStart", - "Happy Cases", - "Variation Cases" - ] + "childrenOrder": ["QuickStart", "Happy Cases", "Variation Cases"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js index 5c480bdf0e0..71283b9aabd 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js @@ -1,51 +1,73 @@ -pm.environment.set("random_number", _.random(100, 100000)) +pm.environment.set("random_number", _.random(100, 100000)); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json index 148cb19c9fc..fce0e7926c0 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json @@ -100,12 +100,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js index b6dbc8b44f1..71283b9aabd 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js @@ -1,53 +1,73 @@ -pm.environment.set("random_number", _.random(100, 100000)) +pm.environment.set("random_number", _.random(100, 100000)); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json index c59205fe1cf..4c796362830 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js index 01c5b744eac..4974bba662f 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js @@ -1,58 +1,76 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "refunds" -pm.test("[POST]::/payments - Content check if 'refunds' exists", function() { - pm.expect((typeof jsonData.refunds !== "undefined")).to.be.true; +pm.test("[POST]::/payments - Content check if 'refunds' exists", function () { + pm.expect(typeof jsonData.refunds !== "undefined").to.be.true; }); - - - diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js index 33557a9578f..f0735a1195e 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'failed'", function() { - pm.expect(jsonData.status).to.eql("failed"); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'status' matches 'failed'", + function () { + pm.expect(jsonData.status).to.eql("failed"); + }, + ); +} // Response body should have value "1000" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '500'", function() { - pm.expect(jsonData.amount).to.eql(500); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '500'", + function () { + pm.expect(jsonData.amount).to.eql(500); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json index 241a13121e9..1c2b2efb569 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js index 94631d2b331..0dc56a10477 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '100'", function() { - pm.expect(jsonData.amount).to.eql(100); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '100'", + function () { + pm.expect(jsonData.amount).to.eql(100); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json index 49682c95224..142ab27d01c 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js index 6619007b80d..b28a29b8b2c 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'failed'", function() { - pm.expect(jsonData.status).to.eql("failed"); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'status' matches 'failed'", + function () { + pm.expect(jsonData.status).to.eql("failed"); + }, + ); +} // Response body should have value "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '500'", function() { - pm.expect(jsonData.amount).to.eql(500); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '500'", + function () { + pm.expect(jsonData.amount).to.eql(500); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js index 9be7be11c40..c596c8a2b88 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '100'", function() { - pm.expect(jsonData.amount).to.eql(100); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '100'", + function () { + pm.expect(jsonData.amount).to.eql(100); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create fail payment with confirm true/.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create fail payment with confirm true/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create fail payment with confirm true/.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create fail payment with confirm true/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create fail payment with confirm true/Payments - Create/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create fail payment with confirm true/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create fail payment with confirm true/Payments - Create/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create fail payment with confirm true/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create fail payment with confirm true/Payments - Create/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create fail payment with confirm true/Payments - Create/event.test.js index 5c480bdf0e0..71283b9aabd 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create fail payment with confirm true/Payments - Create/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create fail payment with confirm true/Payments - Create/event.test.js @@ -1,51 +1,73 @@ -pm.environment.set("random_number", _.random(100, 100000)) +pm.environment.set("random_number", _.random(100, 100000)); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create fail payment with confirm true/Payments - Create/request.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create fail payment with confirm true/Payments - Create/request.json index 148cb19c9fc..fce0e7926c0 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create fail payment with confirm true/Payments - Create/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create fail payment with confirm true/Payments - Create/request.json @@ -100,12 +100,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create fail payment with confirm true/Payments - Retrieve/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create fail payment with confirm true/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create fail payment with confirm true/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create fail payment with confirm true/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create fail payment with confirm true/Payments - Retrieve/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create fail payment with confirm true/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create fail payment with confirm true/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create fail payment with confirm true/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create fail payment with confirm true/Payments - Retrieve/request.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create fail payment with confirm true/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create fail payment with confirm true/Payments - Retrieve/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create fail payment with confirm true/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js index bb50904fd89..f92fba3d044 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js index 01ba81bacf6..009e2045915 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js @@ -1,51 +1,73 @@ -pm.environment.set("random_number", _.random(100, 100000)) +pm.environment.set("random_number", _.random(100, 100000)); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json index 43cf3820bed..0fba8baf15a 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js index 03ccae1adb0..aced67dbfb7 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js index 5d9e5785e6e..6d812bc75fe 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id/confirm - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id/confirm - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json index 1c77275181c..ab7b144f94b 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "card", "payment_method_data": { "card": { @@ -32,14 +53,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js index 05501107ba1..e920cac3df7 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js @@ -1,51 +1,73 @@ -pm.environment.set("random_number", _.random(100, 100000)) +pm.environment.set("random_number", _.random(100, 100000)); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json index 403b32d798d..dd1a9f386be 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js index 03ccae1adb0..aced67dbfb7 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js index eabff6bd386..6e24040a815 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js @@ -1,71 +1,97 @@ // Get the value of 'amount' from the environment const amount = pm.environment.get("amount"); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/capture - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); - -// Validate if response has JSON Body +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.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} - +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]:://payments/:id/capture - 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 "{{amount}}" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '{{amount}}'", function() { - pm.expect(jsonData.amount).to.eql(amount); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '{{amount}}'", + function () { + pm.expect(jsonData.amount).to.eql(amount); + }, + ); +} // Response body should have value "{{amount}}" for "amount_received" if (jsonData?.amount_received) { -pm.test("[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '{{amount}}'", function() { - pm.expect(jsonData.amount_received).to.eql(amount); -})}; - - - - + pm.test( + "[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '{{amount}}'", + function () { + pm.expect(jsonData.amount_received).to.eql(amount); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json index 28d44dc81a6..a980e3cb940 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json @@ -21,14 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js index 5db4c89addb..d0d9e1e73fe 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js @@ -1,53 +1,74 @@ -pm.environment.set("random_number", _.random(100, 100000)) +pm.environment.set("random_number", _.random(100, 100000)); pm.environment.set("amount", pm.response.json().amount); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json index 748a1a38650..c0a2c594afb 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve-copy/event.test.js index 1a0942b5f88..5c7196baa4f 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve-copy/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve-copy/request.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js index 0d75cbf5821..2b84e6e484f 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js index 9632bd19048..dcf3f191643 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js @@ -1,43 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/cancel - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type 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(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "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"); -})}; - - - + pm.test( + "[POST]::/payments/:id/cancel - Content check if value for 'status' matches 'cancelled'", + function () { + pm.expect(jsonData.status).to.eql("cancelled"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json index 3443f265bdd..374b615fdeb 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js index 717380bdbf4..d017effaaf8 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js @@ -1,52 +1,73 @@ -pm.environment.set("random_number", _.random(100, 100000)) +pm.environment.set("random_number", _.random(100, 100000)); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json index b4318360fed..e3878fee11b 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve-copy/event.test.js index f4e0ab9b2aa..5e52e13a59e 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve-copy/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "cancelled" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'", function() { - pm.expect(jsonData.status).to.eql("cancelled"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'", + function () { + pm.expect(jsonData.status).to.eql("cancelled"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve-copy/request.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js index 7f62d2b3ef6..1bac76560dc 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "cancelled" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment with confrm false/Payments - Confirm/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment with confrm false/Payments - Confirm/event.test.js index edf87c9ccdf..1fa0afa6402 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment with confrm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment with confrm false/Payments - Confirm/event.test.js @@ -1,57 +1,83 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments/:id/confirm - Content check if 'next_action.redirect_to_url' exists", function() { - pm.expect((typeof jsonData.next_action.redirect_to_url !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments/:id/confirm - Content check if 'next_action.redirect_to_url' exists", + function () { + pm.expect(typeof jsonData.next_action.redirect_to_url !== "undefined").to.be + .true; + }, +); diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment with confrm false/Payments - Confirm/request.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment with confrm false/Payments - Confirm/request.json index ef8004f31b9..d32cf1b114a 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment with confrm false/Payments - Confirm/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment with confrm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "browser_info": { "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36", "accept_header": "text\\/html,application\\/xhtml+xml,application\\/xml;q=0.9,image\\/webp,image\\/apng,*\\/*;q=0.8", @@ -33,14 +54,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment with confrm false/Payments - Create/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment with confrm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment with confrm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment with confrm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment with confrm false/Payments - Create/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment with confrm false/Payments - Create/event.test.js index 5698484c741..55dc35b9128 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment with confrm false/Payments - Create/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment with confrm false/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment with confrm false/Payments - Create/request.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment with confrm false/Payments - Create/request.json index f3eb58b77b7..5304ad1b920 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment with confrm false/Payments - Create/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment with confrm false/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment with confrm false/Payments - Retrieve/request.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment with confrm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment with confrm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment with confrm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js index 2578a606795..d8beb3d39ac 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js @@ -1,54 +1,75 @@ -pm.environment.set("random_number", _.random(100, 100000)) +pm.environment.set("random_number", _.random(100, 100000)); // Set the environment variable 'amount' with the value from the response pm.environment.set("amount", pm.response.json().amount); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json index 18d014feeac..83e6060d709 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js index 77c021ea3bc..06bfa4325bf 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js @@ -1,36 +1,53 @@ // Get the value of 'amount' from the environment const amount = pm.environment.get("amount"); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '{{amount}}'", function() { - pm.expect(jsonData.amount).to.eql(amount); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '{{amount}}'", + function () { + pm.expect(jsonData.amount).to.eql(amount); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json index e9cb375957e..73a74425cb1 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js index 29568ea9107..fabc6394dd7 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js @@ -1,36 +1,53 @@ // Get the value of 'amount' from the environment const refund_amount = pm.environment.get("amount"); -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "{{refund_amount}}" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '{{refund_amount}}'", function() { - pm.expect(jsonData.amount).to.eql(refund_amount); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '{{refund_amount}}'", + function () { + pm.expect(jsonData.amount).to.eql(refund_amount); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/API Key - Create/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/API Key - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/API Key - Create/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/API Key - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/API Key - Create/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/API Key - Create/event.test.js index bc42e83a761..4e27c5a5025 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/API Key - Create/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/API Key - Create/event.test.js @@ -1,32 +1,46 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/api_keys/:merchant_id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/api_keys/:merchant_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/api_keys/:merchant_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; try { jsonData = pm.response.json(); -} catch(e) { -} +} catch (e) {} // pm.collectionVariables - Set api_key_id as variable for jsonData.key_id if (jsonData?.key_id) { - pm.collectionVariables.set("api_key_id", jsonData.key_id); - console.log("- use {{api_key_id}} as collection variable for value", jsonData.key_id); + pm.collectionVariables.set("api_key_id", jsonData.key_id); + console.log( + "- use {{api_key_id}} as collection variable for value", + jsonData.key_id, + ); } else { - console.log('INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value", jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/API Key - Create/request.json b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/API Key - Create/request.json index 29c2490d1bc..2210d14da0e 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/API Key - Create/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/API Key - Create/request.json @@ -35,13 +35,8 @@ }, "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js index 538b393c084..7de0d5beb31 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js @@ -1,37 +1,56 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - 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]::/accounts - 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", + ); }); // 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 merchant_id as variable for jsonData.merchant_id if (jsonData?.merchant_id) { - pm.collectionVariables.set("merchant_id", jsonData.merchant_id); - console.log("- use {{merchant_id}} as collection variable for value",jsonData.merchant_id); + pm.collectionVariables.set("merchant_id", jsonData.merchant_id); + console.log( + "- use {{merchant_id}} as collection variable for value", + jsonData.merchant_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value",jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} // pm.collectionVariables - Set publishable_key as variable for jsonData.publishable_key if (jsonData?.publishable_key) { - pm.collectionVariables.set("publishable_key", jsonData.publishable_key); - console.log("- use {{publishable_key}} as collection variable for value",jsonData.publishable_key); + pm.collectionVariables.set("publishable_key", jsonData.publishable_key); + console.log( + "- use {{publishable_key}} as collection variable for value", + jsonData.publishable_key, + ); } else { - console.log('INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.", + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Merchant Account - Create/request.json b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Merchant Account - Create/request.json index aa84e7e1c3f..1d8364c8a3f 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Merchant Account - Create/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Merchant Account - Create/request.json @@ -84,12 +84,8 @@ }, "url": { "raw": "{{baseUrl}}/accounts", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "accounts" - ] + "host": ["{{baseUrl}}"], + "path": ["accounts"] }, "description": "Create a new account for a merchant. The merchant could be a seller or retailer or client who likes to receive and send payments." } diff --git a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js index b831702461e..88e92d8d84a 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js @@ -1,21 +1,39 @@ -// Validate status 2xx -pm.test("[POST]::/account/:account_id/connectors - 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.be.success; + }, +); // Validate if response header has matching content-type -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"); -}); +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){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id if (jsonData?.merchant_connector_id) { - pm.collectionVariables.set("merchant_connector_id", jsonData.merchant_connector_id); - console.log("- use {{merchant_connector_id}} as collection variable for value",jsonData.merchant_connector_id); + pm.collectionVariables.set( + "merchant_connector_id", + jsonData.merchant_connector_id, + ); + console.log( + "- use {{merchant_connector_id}} as collection variable for value", + jsonData.merchant_connector_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.", + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payment Connector - Create/request.json b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payment Connector - Create/request.json index 9807259ec46..02f087eb481 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payment Connector - Create/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payment Connector - Create/request.json @@ -55,10 +55,7 @@ "payment_method_types": [ { "payment_method_type": "credit", - "card_networks": [ - "Visa", - "Mastercard" - ], + "card_networks": ["Visa", "Mastercard"], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, @@ -66,10 +63,7 @@ }, { "payment_method_type": "debit", - "card_networks": [ - "Visa", - "Mastercard" - ], + "card_networks": ["Visa", "Mastercard"], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, @@ -83,14 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/account/:account_id/connectors", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payments - Create/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payments - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payments - Create/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payments - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payments - Create/event.prerequest.js b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payments - Create/event.prerequest.js index 726d5815380..27965bb9c01 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payments - Create/event.prerequest.js +++ b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payments - Create/event.prerequest.js @@ -1 +1 @@ -pm.environment.set("random_number", _.random(1000, 100000)) +pm.environment.set("random_number", _.random(1000, 100000)); diff --git a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payments - Create/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payments - Create/event.test.js index 445c0049141..dc285fb1afe 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payments - Create/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payments - Create/event.test.js @@ -1,50 +1,66 @@ -pm.environment.set("random_number", _.random(1000, 100000)) +pm.environment.set("random_number", _.random(1000, 100000)); // Set the environment variable 'amount' with the value from the response pm.environment.set("amount", pm.response.json().amount); - -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payments - Create/request.json b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payments - Create/request.json index 7d18068c2af..24243dbb1b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payments - Create/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payments - Create/request.json @@ -74,12 +74,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js index b1e1f12ba50..bbd8e544e2c 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js @@ -1,22 +1,30 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); - // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payments - Retrieve/request.json b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payments - Retrieve/request.json index 203cc8ad8d1..edbb22e7db5 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payments - Retrieve/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Refunds - Create/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Refunds - Create/event.test.js index 99daf1ef820..61f29c86540 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Refunds - Create/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Refunds - Create/event.test.js @@ -1,24 +1,33 @@ // Get the value of 'amount' from the environment const amount = pm.environment.get("amount"); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Refunds - Create/request.json b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Refunds - Create/request.json index e9cb375957e..73a74425cb1 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Refunds - Create/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Refunds - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js index b1e1f12ba50..bbd8e544e2c 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js @@ -1,22 +1,30 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); - // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Refunds - Retrieve/request.json b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Refunds - Retrieve/request.json index 06b44cf7fd3..31f783a8e11 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Refunds - Retrieve/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/QuickStart/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js index 08f14e045be..edb1f073bee 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js @@ -1,54 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json index 7a7c4db39e8..e7185ed8182 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js index 7d118e2f5e5..edb1f073bee 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js @@ -1,56 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); - // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json index 5244d20c622..8e023984aab 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js index 9502696402a..11294b20d04 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js @@ -1,57 +1,78 @@ -pm.environment.set("random_number", _.random(100, 100000)) +pm.environment.set("random_number", _.random(100, 100000)); -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector_error'", function() { - pm.expect(jsonData.error.type).to.eql("connector_error"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'", + function () { + pm.expect(jsonData.error.type).to.eql("connector_error"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json index 0419e70804d..6740273f39b 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js index 22088133b96..e5da2bc495c 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js @@ -1,57 +1,78 @@ -pm.environment.set("random_number", _.random(100, 100000)) +pm.environment.set("random_number", _.random(100, 100000)); -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector'", function() { - pm.expect(jsonData.error.type).to.eql("connector"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector'", + function () { + pm.expect(jsonData.error.type).to.eql("connector"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json index ebdea4cf7b0..58376c99d77 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json index 90b19864ee1..f2bee31ef66 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Confirm" - ] + "childrenOrder": ["Payments - Create", "Payments - Confirm"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js index 1e8ba8cc3a6..e8d6b2216c5 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js @@ -1,58 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); -}); - - +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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js index 05501107ba1..e920cac3df7 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js @@ -1,51 +1,73 @@ -pm.environment.set("random_number", _.random(100, 100000)) +pm.environment.set("random_number", _.random(100, 100000)); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json index a14b824b36b..fc4e0cc59cd 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js index 9f6d640c022..1abf5cf7c31 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js @@ -1,62 +1,85 @@ // Get the value of 'amount' from the environment const capture_amount = parseInt(pm.environment.get("amount")) + 1000; -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json index a5b0e4d4319..260c764cbf1 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json @@ -21,14 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.prerequest.js b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.prerequest.js index 31bc3f2aa01..30d9fbf35a0 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.prerequest.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.prerequest.js @@ -1 +1 @@ -pm.environment.set("random_number", _.random(100, 100000)) \ No newline at end of file +pm.environment.set("random_number", _.random(100, 100000)); diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js index 5db4c89addb..d0d9e1e73fe 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js @@ -1,53 +1,74 @@ -pm.environment.set("random_number", _.random(100, 100000)) +pm.environment.set("random_number", _.random(100, 100000)); pm.environment.set("amount", pm.response.json().amount); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json index 39ee738d6dc..f2ba0f5cb45 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve-copy/event.test.js index 6b03e0b9ee6..34beacf976b 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve-copy/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" 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"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve-copy/request.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js index 6b03e0b9ee6..34beacf976b 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" 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"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js index c3e7afc6760..46bf201d1ce 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js @@ -1,59 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json index 766a8330d6e..6c934a9132c 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js index d6f9cfb9e41..71283b9aabd 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js @@ -1,52 +1,73 @@ -pm.environment.set("random_number", _.random(100, 100000)) +pm.environment.set("random_number", _.random(100, 100000)); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json index 793caad5486..9215a6a326b 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve-copy/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve-copy/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve-copy/request.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve/request.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js index d7879c70d87..0f869a6dfb8 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js @@ -1,50 +1,69 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/cancel - Status code is 4xx", function () { - pm.response.to.be.error; + 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/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/cancel - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; - - - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json index 3443f265bdd..374b615fdeb 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js index d6f9cfb9e41..71283b9aabd 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js @@ -1,52 +1,73 @@ -pm.environment.set("random_number", _.random(100, 100000)) +pm.environment.set("random_number", _.random(100, 100000)); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json index 793caad5486..9215a6a326b 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Retrieve/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Retrieve/request.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js index f9b010bddef..ee1834dc256 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js @@ -1,55 +1,76 @@ -pm.environment.set("random_number", _.random(100, 100000)) +pm.environment.set("random_number", _.random(100, 100000)); // Set the environment variable 'amount' with the value from the response pm.environment.set("amount", pm.response.json().amount); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json index 793caad5486..9215a6a326b 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js index 8a650d1e9e2..3f945fb624c 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js @@ -1,54 +1,74 @@ // Get the value of 'amount' from the environment const amount = parseInt(pm.environment.get("amount")) + 100000; -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js index 85955409564..225c64f347b 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js @@ -4,36 +4,51 @@ const refund_amount = parseInt(pm.environment.get("amount") + 100000); // Set 'refund_amount' as an environment variable for the current request pm.environment.set("refund_amount", refund_amount); -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/refunds - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + 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; -}); +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"); -})}; - + 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"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json index f957f4e3a32..dbeb9b40aa4 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js index ef8cd2158d4..009e2045915 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js @@ -1,53 +1,73 @@ -pm.environment.set("random_number", _.random(100, 100000)) +pm.environment.set("random_number", _.random(100, 100000)); -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; - - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json index 62f3b873911..7a8ee243bfa 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json @@ -21,12 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve-copy/event.test.js index 42bf3e0ac45..fdb8a946f3d 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve-copy/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve-copy/request.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js index 1bcd3c26907..37f0e4490ee 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'requires_confirmation'", function() { - pm.expect(jsonData.status).to.eql("requires_confirmation"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js index 30888b5cc0c..d3c4451760d 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js @@ -1,32 +1,48 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/refunds - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + 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; -}); +pm.test( + "[POST]::/payments/:id/confirm - Content check if 'error' exists", + function () { + pm.expect(typeof jsonData.error !== "undefined").to.be.true; + }, +); // Response body should have value "invalid_request" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; + pm.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"); + }, + ); +} diff --git a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json index d18aaf8befd..9fe125ce8ea 100644 --- a/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json +++ b/postman/collection-dir/powertranz/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/powertranz/Health check/.meta.json b/postman/collection-dir/powertranz/Health check/.meta.json index 66ee7e50cab..579f9fd541c 100644 --- a/postman/collection-dir/powertranz/Health check/.meta.json +++ b/postman/collection-dir/powertranz/Health check/.meta.json @@ -1,5 +1,3 @@ { - "childrenOrder": [ - "New Request" - ] + "childrenOrder": ["New Request"] } diff --git a/postman/collection-dir/powertranz/Health check/New Request/.event.meta.json b/postman/collection-dir/powertranz/Health check/New Request/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/powertranz/Health check/New Request/.event.meta.json +++ b/postman/collection-dir/powertranz/Health check/New Request/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/powertranz/Health check/New Request/event.test.js b/postman/collection-dir/powertranz/Health check/New Request/event.test.js index 325a8c8a479..b490b8be090 100644 --- a/postman/collection-dir/powertranz/Health check/New Request/event.test.js +++ b/postman/collection-dir/powertranz/Health check/New Request/event.test.js @@ -1,4 +1,4 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - Status code is 2xx", function () { - pm.response.to.be.success; -}); \ No newline at end of file + pm.response.to.be.success; +}); diff --git a/postman/collection-dir/powertranz/Health check/New Request/request.json b/postman/collection-dir/powertranz/Health check/New Request/request.json index 4cc8d4b1a96..e40e9396178 100644 --- a/postman/collection-dir/powertranz/Health check/New Request/request.json +++ b/postman/collection-dir/powertranz/Health check/New Request/request.json @@ -10,11 +10,7 @@ ], "url": { "raw": "{{baseUrl}}/health", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "health" - ] + "host": ["{{baseUrl}}"], + "path": ["health"] } } diff --git a/postman/collection-dir/rapyd/.event.meta.json b/postman/collection-dir/rapyd/.event.meta.json index 2df9d47d936..eb871bbcb9b 100644 --- a/postman/collection-dir/rapyd/.event.meta.json +++ b/postman/collection-dir/rapyd/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.prerequest.js", - "event.test.js" - ] + "eventOrder": ["event.prerequest.js", "event.test.js"] } diff --git a/postman/collection-dir/rapyd/.meta.json b/postman/collection-dir/rapyd/.meta.json index 91b6a65c5bc..d513035ce2d 100644 --- a/postman/collection-dir/rapyd/.meta.json +++ b/postman/collection-dir/rapyd/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Health check", - "Flow Testcases" - ] + "childrenOrder": ["Health check", "Flow Testcases"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/.meta.json b/postman/collection-dir/rapyd/Flow Testcases/.meta.json index 1bbce843680..023989e1e49 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/.meta.json @@ -1,7 +1,3 @@ { - "childrenOrder": [ - "QuickStart", - "Happy Cases", - "Variation Cases" - ] + "childrenOrder": ["QuickStart", "Happy Cases", "Variation Cases"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js index 1baf6b854b7..5e6a7972fd7 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", function() { - pm.expect(jsonData.status).to.eql("requires_customer_action"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", + function () { + pm.expect(jsonData.status).to.eql("requires_customer_action"); + }, + ); +} diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json index 2443d2c76ae..c8433a1c6ab 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js index 08ad2d6a233..02ab01502c1 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + 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"); + }, + ); +} diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js index 926fbad9ca3..6c20960e9dc 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js index 5698484c741..55dc35b9128 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json index 7186bddbe07..119353069bd 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js index 8d2e2e5d1cc..3a866564a45 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json index bb2b0cdc1b0..402aa25fef8 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "card", "payment_method_data": { "card": { @@ -32,14 +53,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json index b28abd0c309..e3b1e235042 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json @@ -67,12 +67,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js index 9632bd19048..dcf3f191643 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js @@ -1,43 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/cancel - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type 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(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "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"); -})}; - - - + pm.test( + "[POST]::/payments/:id/cancel - Content check if value for 'status' matches 'cancelled'", + function () { + pm.expect(jsonData.status).to.eql("cancelled"); + }, + ); +} diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js index 20b20b004b1..5e6a7972fd7 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", function() { - pm.expect(jsonData.status).to.eql("requires_customer_action"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", + function () { + pm.expect(jsonData.status).to.eql("requires_customer_action"); + }, + ); +} diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json index 94a707d54b4..6936932761c 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js index f4e0ab9b2aa..5e52e13a59e 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "cancelled" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'", function() { - pm.expect(jsonData.status).to.eql("cancelled"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'", + function () { + pm.expect(jsonData.status).to.eql("cancelled"); + }, + ); +} diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/.meta.json b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js index 1388cde7c89..39cbb3ee90e 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js @@ -1,54 +1,80 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", function() { - pm.expect(jsonData.status).to.eql("requires_customer_action"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", + function () { + pm.expect(jsonData.status).to.eql("requires_customer_action"); + }, + ); +} // Response body should have "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; -}); +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; + }, +); diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json index 07b1864c221..4c84ffe6b15 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js index 08ad2d6a233..02ab01502c1 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + 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"); + }, + ); +} diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js index edf87c9ccdf..1fa0afa6402 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js @@ -1,57 +1,83 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments/:id/confirm - Content check if 'next_action.redirect_to_url' exists", function() { - pm.expect((typeof jsonData.next_action.redirect_to_url !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments/:id/confirm - Content check if 'next_action.redirect_to_url' exists", + function () { + pm.expect(typeof jsonData.next_action.redirect_to_url !== "undefined").to.be + .true; + }, +); diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js index 5698484c741..55dc35b9128 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json index 5e1ee5f4f3e..566b129b33b 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/rapyd/Flow Testcases/QuickStart/API Key - Create/.event.meta.json b/postman/collection-dir/rapyd/Flow Testcases/QuickStart/API Key - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/QuickStart/API Key - Create/.event.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/QuickStart/API Key - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/QuickStart/API Key - Create/event.test.js b/postman/collection-dir/rapyd/Flow Testcases/QuickStart/API Key - Create/event.test.js index bc42e83a761..4e27c5a5025 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/QuickStart/API Key - Create/event.test.js +++ b/postman/collection-dir/rapyd/Flow Testcases/QuickStart/API Key - Create/event.test.js @@ -1,32 +1,46 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/api_keys/:merchant_id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/api_keys/:merchant_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/api_keys/:merchant_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; try { jsonData = pm.response.json(); -} catch(e) { -} +} catch (e) {} // pm.collectionVariables - Set api_key_id as variable for jsonData.key_id if (jsonData?.key_id) { - pm.collectionVariables.set("api_key_id", jsonData.key_id); - console.log("- use {{api_key_id}} as collection variable for value", jsonData.key_id); + pm.collectionVariables.set("api_key_id", jsonData.key_id); + console.log( + "- use {{api_key_id}} as collection variable for value", + jsonData.key_id, + ); } else { - console.log('INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value", jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} diff --git a/postman/collection-dir/rapyd/Flow Testcases/QuickStart/API Key - Create/request.json b/postman/collection-dir/rapyd/Flow Testcases/QuickStart/API Key - Create/request.json index 29c2490d1bc..2210d14da0e 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/QuickStart/API Key - Create/request.json +++ b/postman/collection-dir/rapyd/Flow Testcases/QuickStart/API Key - Create/request.json @@ -35,13 +35,8 @@ }, "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json b/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js b/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js index 538b393c084..7de0d5beb31 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js +++ b/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js @@ -1,37 +1,56 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - 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]::/accounts - 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", + ); }); // 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 merchant_id as variable for jsonData.merchant_id if (jsonData?.merchant_id) { - pm.collectionVariables.set("merchant_id", jsonData.merchant_id); - console.log("- use {{merchant_id}} as collection variable for value",jsonData.merchant_id); + pm.collectionVariables.set("merchant_id", jsonData.merchant_id); + console.log( + "- use {{merchant_id}} as collection variable for value", + jsonData.merchant_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value",jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} // pm.collectionVariables - Set publishable_key as variable for jsonData.publishable_key if (jsonData?.publishable_key) { - pm.collectionVariables.set("publishable_key", jsonData.publishable_key); - console.log("- use {{publishable_key}} as collection variable for value",jsonData.publishable_key); + pm.collectionVariables.set("publishable_key", jsonData.publishable_key); + console.log( + "- use {{publishable_key}} as collection variable for value", + jsonData.publishable_key, + ); } else { - console.log('INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.", + ); +} diff --git a/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Merchant Account - Create/request.json b/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Merchant Account - Create/request.json index 6db656fb0ce..7df5315150c 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Merchant Account - Create/request.json +++ b/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Merchant Account - Create/request.json @@ -84,12 +84,8 @@ }, "url": { "raw": "{{baseUrl}}/accounts", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "accounts" - ] + "host": ["{{baseUrl}}"], + "path": ["accounts"] }, "description": "Create a new account for a merchant. The merchant could be a seller or retailer or client who likes to receive and send payments." } diff --git a/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json b/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js b/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js index b831702461e..88e92d8d84a 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js +++ b/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js @@ -1,21 +1,39 @@ -// Validate status 2xx -pm.test("[POST]::/account/:account_id/connectors - 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.be.success; + }, +); // Validate if response header has matching content-type -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"); -}); +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){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id if (jsonData?.merchant_connector_id) { - pm.collectionVariables.set("merchant_connector_id", jsonData.merchant_connector_id); - console.log("- use {{merchant_connector_id}} as collection variable for value",jsonData.merchant_connector_id); + pm.collectionVariables.set( + "merchant_connector_id", + jsonData.merchant_connector_id, + ); + console.log( + "- use {{merchant_connector_id}} as collection variable for value", + jsonData.merchant_connector_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.", + ); +} diff --git a/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payment Connector - Create/request.json b/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payment Connector - Create/request.json index 439601f41cd..85826b4034a 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payment Connector - Create/request.json +++ b/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payment Connector - Create/request.json @@ -258,14 +258,8 @@ }, "url": { "raw": "{{baseUrl}}/account/:account_id/connectors", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payments - Create/.event.meta.json b/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payments - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payments - Create/.event.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payments - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payments - Create/event.test.js b/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payments - Create/event.test.js index 62142d52dca..a6947db94c0 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payments - Create/event.test.js +++ b/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payments - Create/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payments - Create/request.json b/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payments - Create/request.json index 775106362c5..1b5ef594e4a 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payments - Create/request.json +++ b/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json b/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js b/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js index 4dd072b2222..d0a02af7436 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // 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.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payments - Retrieve/request.json b/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payments - Retrieve/request.json index c71774083b2..ef0b213739d 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payments - Retrieve/request.json +++ b/postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js index 08f14e045be..edb1f073bee 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js @@ -1,54 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json index ad281c58256..9cbdbc8e22f 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js index 7d118e2f5e5..edb1f073bee 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js @@ -1,56 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); - // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json index 99a24fb4f26..8a9df91718d 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js index 0e6401222ff..52680771c31 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js @@ -1,55 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector_error'", function() { - pm.expect(jsonData.error.type).to.eql("connector_error"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'", + function () { + pm.expect(jsonData.error.type).to.eql("connector_error"); + }, + ); +} diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json index 0a16b975817..c7ad4cb2749 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json @@ -75,12 +75,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js index 630c4f25cae..3976f7f496a 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js @@ -1,55 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector'", function() { - pm.expect(jsonData.error.type).to.eql("connector"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector'", + function () { + pm.expect(jsonData.error.type).to.eql("connector"); + }, + ); +} diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json index 79a70e782fc..d68379f9444 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json index 90b19864ee1..f2bee31ef66 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Confirm" - ] + "childrenOrder": ["Payments - Create", "Payments - Confirm"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js index 1e8ba8cc3a6..e8d6b2216c5 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js @@ -1,58 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); -}); - - +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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json index b28abd0c309..e3b1e235042 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json @@ -67,12 +67,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/.event.meta.json b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/event.test.js b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/event.test.js index f125e2a7885..46bf201d1ce 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/event.test.js +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/event.test.js @@ -1,61 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + 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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/request.json b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/request.json index 14ac5f8bb4a..2b31ac6d784 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/request.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/.event.meta.json b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/.event.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/event.test.js b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/event.test.js index c289d7d25fb..39cbb3ee90e 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/event.test.js +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/event.test.js @@ -1,55 +1,80 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", function() { - pm.expect(jsonData.status).to.eql("requires_customer_action"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", + function () { + pm.expect(jsonData.status).to.eql("requires_customer_action"); + }, + ); +} // Response body should have "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; -}); - +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; + }, +); diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json index b90978ec382..746150bf3b9 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/.event.meta.json b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/event.test.js b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/event.test.js index 1f59e2b00ac..02ab01502c1 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/request.json b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/request.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js index 65232a76373..55dc35b9128 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; - - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json index 7186bddbe07..119353069bd 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js index 42bf3e0ac45..fdb8a946f3d 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js index 30888b5cc0c..d3c4451760d 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js @@ -1,32 +1,48 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/refunds - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + 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; -}); +pm.test( + "[POST]::/payments/:id/confirm - Content check if 'error' exists", + function () { + pm.expect(typeof jsonData.error !== "undefined").to.be.true; + }, +); // Response body should have value "invalid_request" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; + pm.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"); + }, + ); +} diff --git a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json index d18aaf8befd..9fe125ce8ea 100644 --- a/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json +++ b/postman/collection-dir/rapyd/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/rapyd/Health check/.meta.json b/postman/collection-dir/rapyd/Health check/.meta.json index 66ee7e50cab..579f9fd541c 100644 --- a/postman/collection-dir/rapyd/Health check/.meta.json +++ b/postman/collection-dir/rapyd/Health check/.meta.json @@ -1,5 +1,3 @@ { - "childrenOrder": [ - "New Request" - ] + "childrenOrder": ["New Request"] } diff --git a/postman/collection-dir/rapyd/Health check/New Request/.event.meta.json b/postman/collection-dir/rapyd/Health check/New Request/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/rapyd/Health check/New Request/.event.meta.json +++ b/postman/collection-dir/rapyd/Health check/New Request/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/rapyd/Health check/New Request/event.test.js b/postman/collection-dir/rapyd/Health check/New Request/event.test.js index 325a8c8a479..b490b8be090 100644 --- a/postman/collection-dir/rapyd/Health check/New Request/event.test.js +++ b/postman/collection-dir/rapyd/Health check/New Request/event.test.js @@ -1,4 +1,4 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - Status code is 2xx", function () { - pm.response.to.be.success; -}); \ No newline at end of file + pm.response.to.be.success; +}); diff --git a/postman/collection-dir/rapyd/Health check/New Request/request.json b/postman/collection-dir/rapyd/Health check/New Request/request.json index 4cc8d4b1a96..e40e9396178 100644 --- a/postman/collection-dir/rapyd/Health check/New Request/request.json +++ b/postman/collection-dir/rapyd/Health check/New Request/request.json @@ -10,11 +10,7 @@ ], "url": { "raw": "{{baseUrl}}/health", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "health" - ] + "host": ["{{baseUrl}}"], + "path": ["health"] } } diff --git a/postman/collection-dir/shift4/.event.meta.json b/postman/collection-dir/shift4/.event.meta.json index 2df9d47d936..eb871bbcb9b 100644 --- a/postman/collection-dir/shift4/.event.meta.json +++ b/postman/collection-dir/shift4/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.prerequest.js", - "event.test.js" - ] + "eventOrder": ["event.prerequest.js", "event.test.js"] } diff --git a/postman/collection-dir/shift4/.meta.json b/postman/collection-dir/shift4/.meta.json index 91b6a65c5bc..d513035ce2d 100644 --- a/postman/collection-dir/shift4/.meta.json +++ b/postman/collection-dir/shift4/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Health check", - "Flow Testcases" - ] + "childrenOrder": ["Health check", "Flow Testcases"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/.meta.json b/postman/collection-dir/shift4/Flow Testcases/.meta.json index 1bbce843680..023989e1e49 100644 --- a/postman/collection-dir/shift4/Flow Testcases/.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/.meta.json @@ -1,7 +1,3 @@ { - "childrenOrder": [ - "QuickStart", - "Happy Cases", - "Variation Cases" - ] + "childrenOrder": ["QuickStart", "Happy Cases", "Variation Cases"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js index 72f142cc731..c48d8e2d054 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json index 2443d2c76ae..c8433a1c6ab 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js index c5bae16750d..c48d8e2d054 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json index 2443d2c76ae..c8433a1c6ab 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js index 01c5b744eac..4974bba662f 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js @@ -1,58 +1,76 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "refunds" -pm.test("[POST]::/payments - Content check if 'refunds' exists", function() { - pm.expect((typeof jsonData.refunds !== "undefined")).to.be.true; +pm.test("[POST]::/payments - Content check if 'refunds' exists", function () { + pm.expect(typeof jsonData.refunds !== "undefined").to.be.true; }); - - - diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js index d28f25fa46d..56ea9efbac0 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "1000" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '1000'", function() { - pm.expect(jsonData.amount).to.eql(1000); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '1000'", + function () { + pm.expect(jsonData.amount).to.eql(1000); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json index b56057fad5d..caed7818578 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js index 04650f547a2..c1dd16a4551 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '540'", function() { - pm.expect(jsonData.amount).to.eql(540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '540'", + function () { + pm.expect(jsonData.amount).to.eql(540); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json index d18aaf8befd..9fe125ce8ea 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js index bfe3137afb0..f0351c05701 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '1000'", function() { - pm.expect(jsonData.amount).to.eql(1000); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '1000'", + function () { + pm.expect(jsonData.amount).to.eql(1000); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js index 7bff0a3c12c..920a7c47f36 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '540'", function() { - pm.expect(jsonData.amount).to.eql(540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '540'", + function () { + pm.expect(jsonData.amount).to.eql(540); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/event.test.js index 9fc0056753b..80ddb707e4d 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "ideal" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'ideal'", function() { - pm.expect(jsonData.payment_method_type).to.eql("ideal"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'ideal'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("ideal"); + }, + ); +} // Response body should have value "shift4" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'shift4'", function() { - pm.expect(jsonData.connector).to.eql("shift4"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'shift4'", + function () { + pm.expect(jsonData.connector).to.eql("shift4"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/request.json index e3287148612..0526df47361 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_redirect", "payment_method_type": "ideal", "payment_method_data": { @@ -36,14 +57,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/request.json index ec4b1671bf0..70d0e556a64 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/request.json @@ -80,12 +80,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/event.test.js index 3e1e1dbdcb2..db58d12fe7a 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "sofort" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'sofort'", function() { - pm.expect(jsonData.payment_method_type).to.eql("sofort"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'sofort'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("sofort"); + }, + ); +} // Response body should have value "shift4" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'shift4'", function() { - pm.expect(jsonData.connector).to.eql("shift4"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'shift4'", + function () { + pm.expect(jsonData.connector).to.eql("shift4"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/request.json index 1b3aca65658..d8c127799e0 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_redirect", "payment_method_type": "sofort", "payment_method_data": { @@ -36,14 +57,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/request.json index 87d07a6016b..0b0c56d2660 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/event.test.js index f9014ffb27f..a36f45105f8 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "eps" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'eps'", function() { - pm.expect(jsonData.payment_method_type).to.eql("eps"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'eps'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("eps"); + }, + ); +} // Response body should have value "shift4" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'shift4'", function() { - pm.expect(jsonData.connector).to.eql("shift4"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'shift4'", + function () { + pm.expect(jsonData.connector).to.eql("shift4"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/request.json index 72ce9ab0714..12cdf30a5ad 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_redirect", "payment_method_type": "eps", "payment_method_data": { @@ -36,14 +57,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/request.json index 93a459d90b3..f423db21150 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/event.test.js index c218e0b1243..31a5eb3acba 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "giropay" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'giropay'", function() { - pm.expect(jsonData.payment_method_type).to.eql("giropay"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'giropay'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("giropay"); + }, + ); +} // Response body should have value "shift4" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'shift4'", function() { - pm.expect(jsonData.connector).to.eql("shift4"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'shift4'", + function () { + pm.expect(jsonData.connector).to.eql("shift4"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/request.json index 70123c3aba7..caf10ddd35d 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_redirect", "payment_method_type": "giropay", "payment_method_data": { @@ -36,14 +57,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/request.json index 87d07a6016b..0b0c56d2660 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js index bb50904fd89..f92fba3d044 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js index 5698484c741..55dc35b9128 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json index 7186bddbe07..119353069bd 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js index 03ccae1adb0..aced67dbfb7 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js index 5d9e5785e6e..6d812bc75fe 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id/confirm - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id/confirm - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json index bb2b0cdc1b0..402aa25fef8 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "card", "payment_method_data": { "card": { @@ -32,14 +53,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json index b28abd0c309..e3b1e235042 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json @@ -67,12 +67,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js index 03ccae1adb0..aced67dbfb7 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js index 1e2875ec9f6..2d7dbc507fb 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js @@ -1,68 +1,94 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/capture - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); - -// Validate if response has JSON Body +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.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} - +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]:://payments/:id/capture - 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 "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "6000" for "amount_received" if (jsonData?.amount_received) { -pm.test("[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", function() { - pm.expect(jsonData.amount_received).to.eql(6000); -})}; - - - - + pm.test( + "[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", + function () { + pm.expect(jsonData.amount_received).to.eql(6000); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json index 8975575ca40..9fe257ed85e 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js index b0e69cad2c2..d683186aa00 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json index 94a707d54b4..6936932761c 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js index 1a0942b5f88..5c7196baa4f 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js index 1388cde7c89..39cbb3ee90e 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js @@ -1,54 +1,80 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", function() { - pm.expect(jsonData.status).to.eql("requires_customer_action"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", + function () { + pm.expect(jsonData.status).to.eql("requires_customer_action"); + }, + ); +} // Response body should have "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; -}); +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; + }, +); diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json index 8fc8be89fa7..0c86dcec618 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js index 08ad2d6a233..02ab01502c1 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + 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"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js index edf87c9ccdf..1fa0afa6402 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js @@ -1,57 +1,83 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments/:id/confirm - Content check if 'next_action.redirect_to_url' exists", function() { - pm.expect((typeof jsonData.next_action.redirect_to_url !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments/:id/confirm - Content check if 'next_action.redirect_to_url' exists", + function () { + pm.expect(typeof jsonData.next_action.redirect_to_url !== "undefined").to.be + .true; + }, +); diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js index 5698484c741..55dc35b9128 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json index 0c2f11aa4a5..4a0581eaafd 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json index 2443d2c76ae..c8433a1c6ab 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js index 1c34027de1d..f89b9b86fef 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json index 5e306df7a55..5f4c58816d5 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js index 07a9529b82e..6cb4312a60a 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/shift4/Flow Testcases/QuickStart/API Key - Create/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/QuickStart/API Key - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/QuickStart/API Key - Create/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/QuickStart/API Key - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/QuickStart/API Key - Create/event.test.js b/postman/collection-dir/shift4/Flow Testcases/QuickStart/API Key - Create/event.test.js index bc42e83a761..4e27c5a5025 100644 --- a/postman/collection-dir/shift4/Flow Testcases/QuickStart/API Key - Create/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/QuickStart/API Key - Create/event.test.js @@ -1,32 +1,46 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/api_keys/:merchant_id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/api_keys/:merchant_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/api_keys/:merchant_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; try { jsonData = pm.response.json(); -} catch(e) { -} +} catch (e) {} // pm.collectionVariables - Set api_key_id as variable for jsonData.key_id if (jsonData?.key_id) { - pm.collectionVariables.set("api_key_id", jsonData.key_id); - console.log("- use {{api_key_id}} as collection variable for value", jsonData.key_id); + pm.collectionVariables.set("api_key_id", jsonData.key_id); + console.log( + "- use {{api_key_id}} as collection variable for value", + jsonData.key_id, + ); } else { - console.log('INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value", jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/QuickStart/API Key - Create/request.json b/postman/collection-dir/shift4/Flow Testcases/QuickStart/API Key - Create/request.json index 29c2490d1bc..2210d14da0e 100644 --- a/postman/collection-dir/shift4/Flow Testcases/QuickStart/API Key - Create/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/QuickStart/API Key - Create/request.json @@ -35,13 +35,8 @@ }, "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/shift4/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js b/postman/collection-dir/shift4/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js index 538b393c084..7de0d5beb31 100644 --- a/postman/collection-dir/shift4/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js @@ -1,37 +1,56 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - 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]::/accounts - 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", + ); }); // 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 merchant_id as variable for jsonData.merchant_id if (jsonData?.merchant_id) { - pm.collectionVariables.set("merchant_id", jsonData.merchant_id); - console.log("- use {{merchant_id}} as collection variable for value",jsonData.merchant_id); + pm.collectionVariables.set("merchant_id", jsonData.merchant_id); + console.log( + "- use {{merchant_id}} as collection variable for value", + jsonData.merchant_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value",jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} // pm.collectionVariables - Set publishable_key as variable for jsonData.publishable_key if (jsonData?.publishable_key) { - pm.collectionVariables.set("publishable_key", jsonData.publishable_key); - console.log("- use {{publishable_key}} as collection variable for value",jsonData.publishable_key); + pm.collectionVariables.set("publishable_key", jsonData.publishable_key); + console.log( + "- use {{publishable_key}} as collection variable for value", + jsonData.publishable_key, + ); } else { - console.log('INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.", + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/QuickStart/Merchant Account - Create/request.json b/postman/collection-dir/shift4/Flow Testcases/QuickStart/Merchant Account - Create/request.json index ffeea3410a4..dcbf46ee538 100644 --- a/postman/collection-dir/shift4/Flow Testcases/QuickStart/Merchant Account - Create/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/QuickStart/Merchant Account - Create/request.json @@ -84,12 +84,8 @@ }, "url": { "raw": "{{baseUrl}}/accounts", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "accounts" - ] + "host": ["{{baseUrl}}"], + "path": ["accounts"] }, "description": "Create a new account for a merchant. The merchant could be a seller or retailer or client who likes to receive and send payments." } diff --git a/postman/collection-dir/shift4/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js b/postman/collection-dir/shift4/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js index b831702461e..88e92d8d84a 100644 --- a/postman/collection-dir/shift4/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js @@ -1,21 +1,39 @@ -// Validate status 2xx -pm.test("[POST]::/account/:account_id/connectors - 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.be.success; + }, +); // Validate if response header has matching content-type -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"); -}); +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){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id if (jsonData?.merchant_connector_id) { - pm.collectionVariables.set("merchant_connector_id", jsonData.merchant_connector_id); - console.log("- use {{merchant_connector_id}} as collection variable for value",jsonData.merchant_connector_id); + pm.collectionVariables.set( + "merchant_connector_id", + jsonData.merchant_connector_id, + ); + console.log( + "- use {{merchant_connector_id}} as collection variable for value", + jsonData.merchant_connector_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.", + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/QuickStart/Payment Connector - Create/request.json b/postman/collection-dir/shift4/Flow Testcases/QuickStart/Payment Connector - Create/request.json index 50296241a91..b75880bea3d 100644 --- a/postman/collection-dir/shift4/Flow Testcases/QuickStart/Payment Connector - Create/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/QuickStart/Payment Connector - Create/request.json @@ -244,14 +244,8 @@ }, "url": { "raw": "{{baseUrl}}/account/:account_id/connectors", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/shift4/Flow Testcases/QuickStart/Payments - Create/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/QuickStart/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/QuickStart/Payments - Create/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/QuickStart/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/QuickStart/Payments - Create/event.test.js b/postman/collection-dir/shift4/Flow Testcases/QuickStart/Payments - Create/event.test.js index 62142d52dca..a6947db94c0 100644 --- a/postman/collection-dir/shift4/Flow Testcases/QuickStart/Payments - Create/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/QuickStart/Payments - Create/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/QuickStart/Payments - Create/request.json b/postman/collection-dir/shift4/Flow Testcases/QuickStart/Payments - Create/request.json index c9a4f6ec36e..967dc41cb6e 100644 --- a/postman/collection-dir/shift4/Flow Testcases/QuickStart/Payments - Create/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/QuickStart/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/shift4/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js b/postman/collection-dir/shift4/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js index 4dd072b2222..d0a02af7436 100644 --- a/postman/collection-dir/shift4/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // 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.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/QuickStart/Payments - Retrieve/request.json b/postman/collection-dir/shift4/Flow Testcases/QuickStart/Payments - Retrieve/request.json index c71774083b2..ef0b213739d 100644 --- a/postman/collection-dir/shift4/Flow Testcases/QuickStart/Payments - Retrieve/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/QuickStart/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/shift4/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/QuickStart/Refunds - Create/event.test.js b/postman/collection-dir/shift4/Flow Testcases/QuickStart/Refunds - Create/event.test.js index c862e8e68a7..dbc930608cb 100644 --- a/postman/collection-dir/shift4/Flow Testcases/QuickStart/Refunds - Create/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/QuickStart/Refunds - Create/event.test.js @@ -1,21 +1,30 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/QuickStart/Refunds - Create/request.json b/postman/collection-dir/shift4/Flow Testcases/QuickStart/Refunds - Create/request.json index 4dbca4d01f2..0c13281ee15 100644 --- a/postman/collection-dir/shift4/Flow Testcases/QuickStart/Refunds - Create/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/QuickStart/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/shift4/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js b/postman/collection-dir/shift4/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js index b1e1f12ba50..bbd8e544e2c 100644 --- a/postman/collection-dir/shift4/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js @@ -1,22 +1,30 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); - // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/QuickStart/Refunds - Retrieve/request.json b/postman/collection-dir/shift4/Flow Testcases/QuickStart/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/shift4/Flow Testcases/QuickStart/Refunds - Retrieve/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/QuickStart/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js index 08f14e045be..edb1f073bee 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js @@ -1,54 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json index ad281c58256..9cbdbc8e22f 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js index 7d118e2f5e5..edb1f073bee 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js @@ -1,56 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); - // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json index 99a24fb4f26..8a9df91718d 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js index 0e6401222ff..52680771c31 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js @@ -1,55 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector_error'", function() { - pm.expect(jsonData.error.type).to.eql("connector_error"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'", + function () { + pm.expect(jsonData.error.type).to.eql("connector_error"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json index 0a16b975817..c7ad4cb2749 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json @@ -75,12 +75,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js index 630c4f25cae..3976f7f496a 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js @@ -1,55 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector'", function() { - pm.expect(jsonData.error.type).to.eql("connector"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector'", + function () { + pm.expect(jsonData.error.type).to.eql("connector"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json index 79a70e782fc..d68379f9444 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json index 90b19864ee1..f2bee31ef66 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Confirm" - ] + "childrenOrder": ["Payments - Create", "Payments - Confirm"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js index 1e8ba8cc3a6..e8d6b2216c5 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js @@ -1,58 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); -}); - - +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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json index 17048792420..6dc6286e21e 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json @@ -21,14 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json index b28abd0c309..e3b1e235042 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json @@ -67,12 +67,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js index c3e7afc6760..46bf201d1ce 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js @@ -1,59 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json index 766a8330d6e..6c934a9132c 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js index b0e69cad2c2..d683186aa00 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json index 94a707d54b4..6936932761c 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js index 6b03e0b9ee6..34beacf976b 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" 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"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json index cafd3a6808e..6df7c0a1943 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Capture" - ] + "childrenOrder": ["Payments - Create", "Payments - Capture"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js index c3e7afc6760..46bf201d1ce 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js @@ -1,59 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json index 766a8330d6e..6c934a9132c 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json index 2443d2c76ae..c8433a1c6ab 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json index afba25ab6d6..5ff1a7cb4e8 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Cancel" - ] + "childrenOrder": ["Payments - Create", "Payments - Cancel"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js index d7879c70d87..0f869a6dfb8 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js @@ -1,50 +1,69 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/cancel - Status code is 4xx", function () { - pm.response.to.be.error; + 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/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/cancel - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; - - - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json index 2443d2c76ae..c8433a1c6ab 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/event.test.js index f125e2a7885..46bf201d1ce 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/event.test.js @@ -1,61 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + 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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/request.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/request.json index 14ac5f8bb4a..2b31ac6d784 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/event.test.js index c289d7d25fb..39cbb3ee90e 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/event.test.js @@ -1,55 +1,80 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", function() { - pm.expect(jsonData.status).to.eql("requires_customer_action"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", + function () { + pm.expect(jsonData.status).to.eql("requires_customer_action"); + }, + ); +} // Response body should have "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; -}); - +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; + }, +); diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json index 59d0e7ce8e0..f96f8812d00 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/event.test.js index 1f59e2b00ac..02ab01502c1 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/request.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json index 2443d2c76ae..c8433a1c6ab 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js index 9537daf6187..776dbd70712 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js @@ -1,33 +1,48 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/refunds - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + 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; -}); +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"); -})}; - + 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"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json index 326319e8fdf..10de81bed08 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js index 65232a76373..55dc35b9128 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; - - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json index 7186bddbe07..119353069bd 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js index 42bf3e0ac45..fdb8a946f3d 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js index 30888b5cc0c..d3c4451760d 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js @@ -1,32 +1,48 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/refunds - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + 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; -}); +pm.test( + "[POST]::/payments/:id/confirm - Content check if 'error' exists", + function () { + pm.expect(typeof jsonData.error !== "undefined").to.be.true; + }, +); // Response body should have value "invalid_request" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; + pm.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"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json index d18aaf8befd..9fe125ce8ea 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/event.test.js index b9d305e4fc4..1b37dc2c7d1 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/event.test.js @@ -1,65 +1,97 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/request.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/request.json index d0887ba7661..57d625e7c39 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/request.json @@ -94,12 +94,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/event.test.js index b94e329999b..db584da2266 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/event.test.js @@ -1,61 +1,87 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/request.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/.event.meta.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/.event.meta.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/event.test.js b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/event.test.js index 22617f827cf..e862404c2b2 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/event.test.js +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/event.test.js @@ -1,56 +1,79 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/confirm - Content check if 'error' exists", + function () { + pm.expect(typeof jsonData.error !== "undefined").to.be.true; + }, +); // Response body should have value "invalid_request" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; - - + pm.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"); + }, + ); +} diff --git a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json index d2c4a106d65..8fc4831ccc3 100644 --- a/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json +++ b/postman/collection-dir/shift4/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json @@ -69,12 +69,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/shift4/Health check/.meta.json b/postman/collection-dir/shift4/Health check/.meta.json index 66ee7e50cab..579f9fd541c 100644 --- a/postman/collection-dir/shift4/Health check/.meta.json +++ b/postman/collection-dir/shift4/Health check/.meta.json @@ -1,5 +1,3 @@ { - "childrenOrder": [ - "New Request" - ] + "childrenOrder": ["New Request"] } diff --git a/postman/collection-dir/shift4/Health check/New Request/.event.meta.json b/postman/collection-dir/shift4/Health check/New Request/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/shift4/Health check/New Request/.event.meta.json +++ b/postman/collection-dir/shift4/Health check/New Request/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/shift4/Health check/New Request/event.test.js b/postman/collection-dir/shift4/Health check/New Request/event.test.js index 325a8c8a479..b490b8be090 100644 --- a/postman/collection-dir/shift4/Health check/New Request/event.test.js +++ b/postman/collection-dir/shift4/Health check/New Request/event.test.js @@ -1,4 +1,4 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - Status code is 2xx", function () { - pm.response.to.be.success; -}); \ No newline at end of file + pm.response.to.be.success; +}); diff --git a/postman/collection-dir/shift4/Health check/New Request/request.json b/postman/collection-dir/shift4/Health check/New Request/request.json index 4cc8d4b1a96..e40e9396178 100644 --- a/postman/collection-dir/shift4/Health check/New Request/request.json +++ b/postman/collection-dir/shift4/Health check/New Request/request.json @@ -10,11 +10,7 @@ ], "url": { "raw": "{{baseUrl}}/health", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "health" - ] + "host": ["{{baseUrl}}"], + "path": ["health"] } } diff --git a/postman/collection-dir/shift4/event.test.js b/postman/collection-dir/shift4/event.test.js index 69037688f22..fb52caec30f 100644 --- a/postman/collection-dir/shift4/event.test.js +++ b/postman/collection-dir/shift4/event.test.js @@ -1,11 +1,13 @@ // 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("[LOG]::payment_id - " + jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log("[LOG]::payment_id - " + jsonData.payment_id); } -console.log("[LOG]::x-request-id - " + pm.response.headers.get('x-request-id')); \ No newline at end of file +console.log("[LOG]::x-request-id - " + pm.response.headers.get("x-request-id")); diff --git a/postman/collection-dir/stripe/.event.json b/postman/collection-dir/stripe/.event.json new file mode 100644 index 00000000000..beb78f1db9d --- /dev/null +++ b/postman/collection-dir/stripe/.event.json @@ -0,0 +1,18 @@ +{ + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [""] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [""] + } + } + ] +} diff --git a/postman/collection-dir/stripe/.event.meta.json b/postman/collection-dir/stripe/.event.meta.json index 2df9d47d936..eb871bbcb9b 100644 --- a/postman/collection-dir/stripe/.event.meta.json +++ b/postman/collection-dir/stripe/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.prerequest.js", - "event.test.js" - ] + "eventOrder": ["event.prerequest.js", "event.test.js"] } diff --git a/postman/collection-dir/stripe/.info.json b/postman/collection-dir/stripe/.info.json index 9e761d83cb0..4d935562e9f 100644 --- a/postman/collection-dir/stripe/.info.json +++ b/postman/collection-dir/stripe/.info.json @@ -1,6 +1,6 @@ { "info": { - "_postman_id": "b4f11b9e-244e-4f34-b5dd-418dcdc91699", + "_postman_id": "8690e6f5-b693-42f3-a9f5-a1492faecdd6", "name": "stripe", "description": "## Get started\n\nJuspay Router provides a collection of APIs that enable you to process and manage payments. Our APIs accept and return JSON in the HTTP body, and return standard HTTP response codes. \nYou can consume the APIs directly using your favorite HTTP/REST library. \nWe have a testing environment referred to \"sandbox\", which you can setup to test API calls without affecting production data.\n\n### Base URLs\n\nUse the following base URLs when making requests to the APIs:\n\n| Environment | Base URL |\n| --- | --- |\n| Sandbox | [https://sandbox.hyperswitch.io](https://sandbox.hyperswitch.io) |\n| Production | [https://router.juspay.io](https://router.juspay.io) |\n\n# Authentication\n\nWhen you sign up for an account, you are given a secret key (also referred as api-key). You may authenticate all API requests with Juspay server by providing the appropriate key in the request Authorization header. \nNever share your secret api keys. Keep them guarded and secure.\n\nContact Support: \nName: Juspay Support \nEmail: [[email protected]](mailto:[email protected])", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", diff --git a/postman/collection-dir/stripe/API Key/Create API Key/.event.meta.json b/postman/collection-dir/stripe/API Key/Create API Key/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/API Key/Create API Key/.event.meta.json +++ b/postman/collection-dir/stripe/API Key/Create API Key/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/API Key/Create API Key/event.test.js b/postman/collection-dir/stripe/API Key/Create API Key/event.test.js index bc42e83a761..4e27c5a5025 100644 --- a/postman/collection-dir/stripe/API Key/Create API Key/event.test.js +++ b/postman/collection-dir/stripe/API Key/Create API Key/event.test.js @@ -1,32 +1,46 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/api_keys/:merchant_id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/api_keys/:merchant_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/api_keys/:merchant_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; try { jsonData = pm.response.json(); -} catch(e) { -} +} catch (e) {} // pm.collectionVariables - Set api_key_id as variable for jsonData.key_id if (jsonData?.key_id) { - pm.collectionVariables.set("api_key_id", jsonData.key_id); - console.log("- use {{api_key_id}} as collection variable for value", jsonData.key_id); + pm.collectionVariables.set("api_key_id", jsonData.key_id); + console.log( + "- use {{api_key_id}} as collection variable for value", + jsonData.key_id, + ); } else { - console.log('INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value", jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/API Key/Create API Key/request.json b/postman/collection-dir/stripe/API Key/Create API Key/request.json index 29c2490d1bc..2210d14da0e 100644 --- a/postman/collection-dir/stripe/API Key/Create API Key/request.json +++ b/postman/collection-dir/stripe/API Key/Create API Key/request.json @@ -35,13 +35,8 @@ }, "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/stripe/API Key/Delete API Key/.event.meta.json b/postman/collection-dir/stripe/API Key/Delete API Key/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/API Key/Delete API Key/.event.meta.json +++ b/postman/collection-dir/stripe/API Key/Delete API Key/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/API Key/Delete API Key/event.test.js b/postman/collection-dir/stripe/API Key/Delete API Key/event.test.js index 183b46ea167..bed2232f1a3 100644 --- a/postman/collection-dir/stripe/API Key/Delete API Key/event.test.js +++ b/postman/collection-dir/stripe/API Key/Delete API Key/event.test.js @@ -1,9 +1,17 @@ -// Validate status 2xx -pm.test("[DELETE]::/api_keys/:merchant_id/:api-key - Status code is 2xx", function () { - pm.response.to.be.success; -}); +// Validate status 2xx +pm.test( + "[DELETE]::/api_keys/:merchant_id/:api-key - Status code is 2xx", + function () { + pm.response.to.be.success; + }, +); // Validate if response header has matching content-type -pm.test("[DELETE]::/api_keys/:merchant_id/:api-key - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); \ No newline at end of file +pm.test( + "[DELETE]::/api_keys/:merchant_id/:api-key - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); diff --git a/postman/collection-dir/stripe/API Key/Delete API Key/request.json b/postman/collection-dir/stripe/API Key/Delete API Key/request.json index a83d12a2beb..d3631013d83 100644 --- a/postman/collection-dir/stripe/API Key/Delete API Key/request.json +++ b/postman/collection-dir/stripe/API Key/Delete API Key/request.json @@ -27,14 +27,8 @@ ], "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id/:api-key", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id", - ":api-key" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id", ":api-key"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/stripe/API Key/List API Keys/.event.meta.json b/postman/collection-dir/stripe/API Key/List API Keys/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/API Key/List API Keys/.event.meta.json +++ b/postman/collection-dir/stripe/API Key/List API Keys/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/API Key/List API Keys/event.test.js b/postman/collection-dir/stripe/API Key/List API Keys/event.test.js index add47315344..c6cbb8742e2 100644 --- a/postman/collection-dir/stripe/API Key/List API Keys/event.test.js +++ b/postman/collection-dir/stripe/API Key/List API Keys/event.test.js @@ -1,33 +1,46 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/api_keys/:merchant_id/list - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[GET]::/api_keys/:merchant_id/list - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); - +pm.test( + "[GET]::/api_keys/:merchant_id/list - 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) { -} +} catch (e) {} // pm.collectionVariables - Set api_key_id as variable for jsonData.key_id if (jsonData?.key_id) { - pm.collectionVariables.set("api_key_id", jsonData.key_id); - console.log("- use {{api_key_id}} as collection variable for value", jsonData.key_id); + pm.collectionVariables.set("api_key_id", jsonData.key_id); + console.log( + "- use {{api_key_id}} as collection variable for value", + jsonData.key_id, + ); } else { - console.log('INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value", jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/API Key/List API Keys/request.json b/postman/collection-dir/stripe/API Key/List API Keys/request.json index 86d12e8c741..739586859df 100644 --- a/postman/collection-dir/stripe/API Key/List API Keys/request.json +++ b/postman/collection-dir/stripe/API Key/List API Keys/request.json @@ -27,14 +27,8 @@ ], "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id/list", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id", - "list" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id", "list"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/stripe/API Key/Retrieve API Key/.event.meta.json b/postman/collection-dir/stripe/API Key/Retrieve API Key/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/API Key/Retrieve API Key/.event.meta.json +++ b/postman/collection-dir/stripe/API Key/Retrieve API Key/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/API Key/Retrieve API Key/event.test.js b/postman/collection-dir/stripe/API Key/Retrieve API Key/event.test.js index 257285a03a8..bef13cc3577 100644 --- a/postman/collection-dir/stripe/API Key/Retrieve API Key/event.test.js +++ b/postman/collection-dir/stripe/API Key/Retrieve API Key/event.test.js @@ -1,33 +1,49 @@ -// Validate status 2xx -pm.test("[GET]::/api_keys/:merchant_id/:api_key_id - Status code is 2xx", function () { - pm.response.to.be.success; -}); +// Validate status 2xx +pm.test( + "[GET]::/api_keys/:merchant_id/:api_key_id - Status code is 2xx", + function () { + pm.response.to.be.success; + }, +); // Validate if response header has matching content-type -pm.test("[GET]::/api_keys/:merchant_id/:api_key_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); - +pm.test( + "[GET]::/api_keys/:merchant_id/:api_key_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) { -} +} catch (e) {} // pm.collectionVariables - Set api_key_id as variable for jsonData.key_id if (jsonData?.key_id) { - pm.collectionVariables.set("api_key_id", jsonData.key_id); - console.log("- use {{api_key_id}} as collection variable for value", jsonData.key_id); + pm.collectionVariables.set("api_key_id", jsonData.key_id); + console.log( + "- use {{api_key_id}} as collection variable for value", + jsonData.key_id, + ); } else { - console.log('INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value", jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/API Key/Retrieve API Key/request.json b/postman/collection-dir/stripe/API Key/Retrieve API Key/request.json index 958049e9087..6d9d97d776b 100644 --- a/postman/collection-dir/stripe/API Key/Retrieve API Key/request.json +++ b/postman/collection-dir/stripe/API Key/Retrieve API Key/request.json @@ -27,14 +27,8 @@ ], "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id/:api_key_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id", - ":api_key_id" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id", ":api_key_id"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/stripe/API Key/Update API Key/.event.meta.json b/postman/collection-dir/stripe/API Key/Update API Key/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/API Key/Update API Key/.event.meta.json +++ b/postman/collection-dir/stripe/API Key/Update API Key/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/API Key/Update API Key/event.test.js b/postman/collection-dir/stripe/API Key/Update API Key/event.test.js index ba0a326d90f..fd6ed957bdf 100644 --- a/postman/collection-dir/stripe/API Key/Update API Key/event.test.js +++ b/postman/collection-dir/stripe/API Key/Update API Key/event.test.js @@ -1,33 +1,49 @@ -// Validate status 2xx -pm.test("[POST]::/api_keys/:merchant_id/:api_key_id - Status code is 2xx", function () { - pm.response.to.be.success; -}); +// Validate status 2xx +pm.test( + "[POST]::/api_keys/:merchant_id/:api_key_id - Status code is 2xx", + function () { + pm.response.to.be.success; + }, +); // Validate if response header has matching content-type -pm.test("[POST]::/api_keys/:merchant_id/:api_key_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); - +pm.test( + "[POST]::/api_keys/:merchant_id/:api_key_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) { -} +} catch (e) {} // pm.collectionVariables - Set api_key_id as variable for jsonData.key_id if (jsonData?.key_id) { - pm.collectionVariables.set("api_key_id", jsonData.key_id); - console.log("- use {{api_key_id}} as collection variable for value", jsonData.key_id); + pm.collectionVariables.set("api_key_id", jsonData.key_id); + console.log( + "- use {{api_key_id}} as collection variable for value", + jsonData.key_id, + ); } else { - console.log('INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value", jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/API Key/Update API Key/request.json b/postman/collection-dir/stripe/API Key/Update API Key/request.json index af2f450969b..ba0f58b55e8 100644 --- a/postman/collection-dir/stripe/API Key/Update API Key/request.json +++ b/postman/collection-dir/stripe/API Key/Update API Key/request.json @@ -35,14 +35,8 @@ }, "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id/:api_key_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id", - ":api_key_id" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id", ":api_key_id"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/stripe/Customers/Create Customer/.event.meta.json b/postman/collection-dir/stripe/Customers/Create Customer/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Customers/Create Customer/.event.meta.json +++ b/postman/collection-dir/stripe/Customers/Create Customer/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Customers/Create Customer/event.test.js b/postman/collection-dir/stripe/Customers/Create Customer/event.test.js index e05989041ee..4ee1d3e8b2b 100644 --- a/postman/collection-dir/stripe/Customers/Create Customer/event.test.js +++ b/postman/collection-dir/stripe/Customers/Create Customer/event.test.js @@ -1,38 +1,53 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/customers - 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]::/customers - 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]::/customers - 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 "customer_id" -pm.test("[POST]::/customers - Content check if 'customer_id' exists", function() { - pm.expect((typeof jsonData.customer_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/customers - Content check if 'customer_id' exists", + function () { + pm.expect(typeof jsonData.customer_id !== "undefined").to.be.true; + }, +); // Response body should have a minimum length of "1" for "customer_id" if (jsonData?.customer_id) { -pm.test("[POST]::/customers - Content check if value of 'customer_id' has a minimum length of '1'", function() { - pm.expect(jsonData.customer_id.length).is.at.least(1); -})}; - + pm.test( + "[POST]::/customers - Content check if value of 'customer_id' has a minimum length of '1'", + function () { + pm.expect(jsonData.customer_id.length).is.at.least(1); + }, + ); +} // pm.collectionVariables - Set customer_id as variable for jsonData.customer_id if (jsonData?.customer_id) { - pm.collectionVariables.set("customer_id", jsonData.customer_id); - console.log("- use {{customer_id}} as collection variable for value",jsonData.customer_id); + pm.collectionVariables.set("customer_id", jsonData.customer_id); + console.log( + "- use {{customer_id}} as collection variable for value", + jsonData.customer_id, + ); } else { - console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/Customers/Create Customer/request.json b/postman/collection-dir/stripe/Customers/Create Customer/request.json index 18a4500c8e8..be27f693d9c 100644 --- a/postman/collection-dir/stripe/Customers/Create Customer/request.json +++ b/postman/collection-dir/stripe/Customers/Create Customer/request.json @@ -32,12 +32,8 @@ }, "url": { "raw": "{{baseUrl}}/customers", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "customers" - ] + "host": ["{{baseUrl}}"], + "path": ["customers"] }, "description": "Create a customer object and store the customer details to be reused for future payments. Incase the customer already exists in the system, this API will respond with the customer details." } diff --git a/postman/collection-dir/stripe/Customers/Delete Customer/.event.meta.json b/postman/collection-dir/stripe/Customers/Delete Customer/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Customers/Delete Customer/.event.meta.json +++ b/postman/collection-dir/stripe/Customers/Delete Customer/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Customers/Delete Customer/event.test.js b/postman/collection-dir/stripe/Customers/Delete Customer/event.test.js index c6231f7be46..c1aa6604dd9 100644 --- a/postman/collection-dir/stripe/Customers/Delete Customer/event.test.js +++ b/postman/collection-dir/stripe/Customers/Delete Customer/event.test.js @@ -1,14 +1,19 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[DELETE]::/customers/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[DELETE]::/customers/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[DELETE]::/customers/: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 +// Validate if response has JSON Body pm.test("[DELETE]::/customers/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); diff --git a/postman/collection-dir/stripe/Customers/Delete Customer/request.json b/postman/collection-dir/stripe/Customers/Delete Customer/request.json index 75a0d4ebae9..5396d9672f6 100644 --- a/postman/collection-dir/stripe/Customers/Delete Customer/request.json +++ b/postman/collection-dir/stripe/Customers/Delete Customer/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/customers/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "customers", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["customers", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/Customers/Ephemeral Key/.event.meta.json b/postman/collection-dir/stripe/Customers/Ephemeral Key/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Customers/Ephemeral Key/.event.meta.json +++ b/postman/collection-dir/stripe/Customers/Ephemeral Key/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Customers/Ephemeral Key/event.test.js b/postman/collection-dir/stripe/Customers/Ephemeral Key/event.test.js index 8f3941c4117..854d248cbb5 100644 --- a/postman/collection-dir/stripe/Customers/Ephemeral Key/event.test.js +++ b/postman/collection-dir/stripe/Customers/Ephemeral Key/event.test.js @@ -1,9 +1,14 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/ephemeral_keys - 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]::/ephemeral_keys - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); \ No newline at end of file +pm.test( + "[POST]::/ephemeral_keys - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); diff --git a/postman/collection-dir/stripe/Customers/Ephemeral Key/request.json b/postman/collection-dir/stripe/Customers/Ephemeral Key/request.json index a360d72edaf..7ea8a49c306 100644 --- a/postman/collection-dir/stripe/Customers/Ephemeral Key/request.json +++ b/postman/collection-dir/stripe/Customers/Ephemeral Key/request.json @@ -14,11 +14,7 @@ }, "url": { "raw": "{{baseUrl}}/ephemeral_keys", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "ephemeral_keys" - ] + "host": ["{{baseUrl}}"], + "path": ["ephemeral_keys"] } } diff --git a/postman/collection-dir/stripe/Customers/Retrieve Customer/.event.meta.json b/postman/collection-dir/stripe/Customers/Retrieve Customer/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Customers/Retrieve Customer/.event.meta.json +++ b/postman/collection-dir/stripe/Customers/Retrieve Customer/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Customers/Retrieve Customer/event.test.js b/postman/collection-dir/stripe/Customers/Retrieve Customer/event.test.js index 821f8c7321e..9358ea597a2 100644 --- a/postman/collection-dir/stripe/Customers/Retrieve Customer/event.test.js +++ b/postman/collection-dir/stripe/Customers/Retrieve Customer/event.test.js @@ -1,16 +1,19 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/customers/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[GET]::/customers/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[GET]::/customers/: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 +// Validate if response has JSON Body pm.test("[GET]::/customers/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - - diff --git a/postman/collection-dir/stripe/Customers/Retrieve Customer/request.json b/postman/collection-dir/stripe/Customers/Retrieve Customer/request.json index 754fca88377..61a3c66a267 100644 --- a/postman/collection-dir/stripe/Customers/Retrieve Customer/request.json +++ b/postman/collection-dir/stripe/Customers/Retrieve Customer/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/customers/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "customers", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["customers", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/Customers/Update Customer/.event.meta.json b/postman/collection-dir/stripe/Customers/Update Customer/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Customers/Update Customer/.event.meta.json +++ b/postman/collection-dir/stripe/Customers/Update Customer/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Customers/Update Customer/event.test.js b/postman/collection-dir/stripe/Customers/Update Customer/event.test.js index bdec4764056..745585252bf 100644 --- a/postman/collection-dir/stripe/Customers/Update Customer/event.test.js +++ b/postman/collection-dir/stripe/Customers/Update Customer/event.test.js @@ -1,15 +1,19 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/customers/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/customers/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/customers/: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 +// Validate if response has JSON Body pm.test("[POST]::/customers/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - diff --git a/postman/collection-dir/stripe/Customers/Update Customer/request.json b/postman/collection-dir/stripe/Customers/Update Customer/request.json index b1319899764..e85716eedc0 100644 --- a/postman/collection-dir/stripe/Customers/Update Customer/request.json +++ b/postman/collection-dir/stripe/Customers/Update Customer/request.json @@ -31,13 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/customers/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "customers", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["customers", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/Flow Testcases/.meta.json b/postman/collection-dir/stripe/Flow Testcases/.meta.json index 1bbce843680..023989e1e49 100644 --- a/postman/collection-dir/stripe/Flow Testcases/.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/.meta.json @@ -1,7 +1,3 @@ { - "childrenOrder": [ - "QuickStart", - "Happy Cases", - "Variation Cases" - ] + "childrenOrder": ["QuickStart", "Happy Cases", "Variation Cases"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js index 63b6c0a0fcb..ffcdd527d07 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js @@ -1,57 +1,80 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "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.test( + "[POST]::/payments - Content check if 'connector_transaction_id' exists", + function () { + pm.expect(typeof jsonData.connector_transaction_id !== "undefined").to.be + .true; + }, +); diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json index 21f05484389..fe57a769892 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json @@ -87,12 +87,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js index 287abb31962..20626ecd2a9 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js @@ -1,57 +1,80 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches '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.test( + "[POST]::/payments - Content check if 'connector_transaction_id' exists", + function () { + pm.expect(typeof jsonData.connector_transaction_id !== "undefined").to.be + .true; + }, +); diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js index c5bae16750d..c48d8e2d054 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json index b5f464abc14..2363c62ff27 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js index 01c5b744eac..4974bba662f 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/event.test.js @@ -1,58 +1,76 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "refunds" -pm.test("[POST]::/payments - Content check if 'refunds' exists", function() { - pm.expect((typeof jsonData.refunds !== "undefined")).to.be.true; +pm.test("[POST]::/payments - Content check if 'refunds' exists", function () { + pm.expect(typeof jsonData.refunds !== "undefined").to.be.true; }); - - - diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js index d28f25fa46d..56ea9efbac0 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "1000" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '1000'", function() { - pm.expect(jsonData.amount).to.eql(1000); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '1000'", + function () { + pm.expect(jsonData.amount).to.eql(1000); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json index b56057fad5d..caed7818578 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create-copy/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js index 04650f547a2..c1dd16a4551 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '540'", function() { - pm.expect(jsonData.amount).to.eql(540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '540'", + function () { + pm.expect(jsonData.amount).to.eql(540); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json index d18aaf8befd..9fe125ce8ea 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js index bfe3137afb0..f0351c05701 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '1000'", function() { - pm.expect(jsonData.amount).to.eql(1000); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '1000'", + function () { + pm.expect(jsonData.amount).to.eql(1000); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js index 7bff0a3c12c..920a7c47f36 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '540'", function() { - pm.expect(jsonData.amount).to.eql(540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '540'", + function () { + pm.expect(jsonData.amount).to.eql(540); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Partial refund/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/event.test.js index b9d305e4fc4..1b37dc2c7d1 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/event.test.js @@ -1,65 +1,97 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/request.json index 3ffbe03a605..a5c9391cf74 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Create/request.json @@ -98,12 +98,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/event.test.js index b94e329999b..db584da2266 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/event.test.js @@ -1,61 +1,87 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/event.test.js index b94e329999b..db584da2266 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/event.test.js @@ -1,61 +1,87 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/event.test.js index 0868d67db09..e2ddde7136f 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/event.test.js @@ -1,65 +1,95 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); // Response body should have "payment_method_data" -pm.test("[POST]::/payments - Content check if 'payment_method_data' exists", function() { - pm.expect((typeof jsonData.payment_method_data !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'payment_method_data' exists", + function () { + pm.expect(typeof jsonData.payment_method_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/request.json index 613e9148f78..01f47678bea 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Create a mandate and recurring payment/Recurring Payments - Create/request.json @@ -61,12 +61,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/event.test.js index b9d305e4fc4..1b37dc2c7d1 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/event.test.js @@ -1,65 +1,97 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/request.json index 9df18b5e886..599c708ba73 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/request.json @@ -86,12 +86,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/event.test.js index b94e329999b..db584da2266 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/event.test.js @@ -1,61 +1,87 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve-copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/event.test.js index b94e329999b..db584da2266 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/event.test.js @@ -1,61 +1,87 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/event.test.js index d6f055f4ddd..ef2a8b7e7ac 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/event.test.js @@ -1,70 +1,105 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); // Response body should have "payment_method_data" -pm.test("[POST]::/payments - Content check if 'payment_method_data' exists", function() { - pm.expect((typeof jsonData.payment_method_data !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'payment_method_data' exists", + function () { + pm.expect(typeof jsonData.payment_method_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/request.json index 90fe1973d69..90c966e10f1 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Recurring Payments - Create/request.json @@ -61,12 +61,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/event.test.js index 1c34027de1d..f89b9b86fef 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/request.json index 5e306df7a55..5f4c58816d5 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Create Copy/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/event.test.js index 07a9529b82e..6cb4312a60a 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Refunds - Retrieve Copy/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Confirm/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Confirm/.event.meta.json index 688c85746ef..220b1a6723d 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Confirm/event.prerequest.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Confirm/event.prerequest.js new file mode 100644 index 00000000000..e69de29bb2d diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Confirm/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Confirm/event.test.js index 85c1dc81eed..e6e0b8ac8ba 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Confirm/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "klarna" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'klarna'", function() { - pm.expect(jsonData.payment_method_type).to.eql("klarna"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'klarna'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("klarna"); + }, + ); +} // Response body should have value "stripe" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", function() { - pm.expect(jsonData.connector).to.eql("stripe"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", + function () { + pm.expect(jsonData.connector).to.eql("stripe"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Confirm/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Confirm/request.json index 43543e1f7cb..9b19b521cad 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Confirm/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -29,19 +49,14 @@ "billing_country": "US" } } - } + }, + "client_secret": "{{client_secret}}" } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Create/request.json index 738179a44db..b0bc12a6ac8 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Create/request.json @@ -47,12 +47,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Retrieve/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Retrieve/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Retrieve/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Retrieve/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario12-BNPL-klarna/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Confirm/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Confirm/.event.meta.json index 688c85746ef..220b1a6723d 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Confirm/event.prerequest.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Confirm/event.prerequest.js new file mode 100644 index 00000000000..e69de29bb2d diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Confirm/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Confirm/event.test.js index 9d71774581a..75a51d5cc80 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Confirm/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "afterpay_clearpay" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'afterpay_clearpay'", function() { - pm.expect(jsonData.payment_method_type).to.eql("afterpay_clearpay"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'afterpay_clearpay'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("afterpay_clearpay"); + }, + ); +} // Response body should have value "stripe" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", function() { - pm.expect(jsonData.connector).to.eql("stripe"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", + function () { + pm.expect(jsonData.connector).to.eql("stripe"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Confirm/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Confirm/request.json index add4f4e624a..8979d854850 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Confirm/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -28,19 +48,14 @@ "billing_email": "[email protected]" } } - } + }, + "client_secret": "{{client_secret}}" } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Create/request.json index a751c3e522d..dcbeac44d9e 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Create/request.json @@ -86,12 +86,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Retrieve/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Retrieve/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Retrieve/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Retrieve/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario13-BNPL-afterpay/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Confirm/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Confirm/.event.meta.json index 688c85746ef..220b1a6723d 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Confirm/event.prerequest.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Confirm/event.prerequest.js new file mode 100644 index 00000000000..e69de29bb2d diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Confirm/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Confirm/event.test.js index 58f7b26c284..c50860153eb 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Confirm/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "affirm" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'affirm'", function() { - pm.expect(jsonData.payment_method_type).to.eql("affirm"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'affirm'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("affirm"); + }, + ); +} // Response body should have value "stripe" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", function() { - pm.expect(jsonData.connector).to.eql("stripe"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", + function () { + pm.expect(jsonData.connector).to.eql("stripe"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Confirm/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Confirm/request.json index 6c33f8cf2e2..17a6826c6a2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Confirm/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -29,19 +49,14 @@ "billing_country": "US" } } - } + }, + "client_secret": "{{client_secret}}" } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Create/request.json index 09867cc8772..eedc71f3a1a 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Create/request.json @@ -86,12 +86,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Retrieve/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Retrieve/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Retrieve/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Retrieve/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario14-BNPL-affirm/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json index 688c85746ef..220b1a6723d 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/event.prerequest.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/event.prerequest.js new file mode 100644 index 00000000000..e69de29bb2d diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/event.test.js index 3e966f325dd..de4c44cb8e2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "ideal" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'ideal'", function() { - pm.expect(jsonData.payment_method_type).to.eql("ideal"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'ideal'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("ideal"); + }, + ); +} // Response body should have value "stripe" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", function() { - pm.expect(jsonData.connector).to.eql("stripe"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", + function () { + pm.expect(jsonData.connector).to.eql("stripe"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/request.json index 6c44ab9d4e0..529dab2b10d 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -31,19 +51,14 @@ "country": "DE" } } - } + }, + "client_secret": "{{client_secret}}" } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/request.json index 37cd6d0b939..21e71ad037a 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Create/request.json @@ -85,12 +85,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario15-Bank Redirect-Ideal/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/.event.meta.json index 688c85746ef..220b1a6723d 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/event.prerequest.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/event.prerequest.js new file mode 100644 index 00000000000..e69de29bb2d diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/event.test.js index 23db3632024..aa8d32b0cf2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "sofort" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'sofort'", function() { - pm.expect(jsonData.payment_method_type).to.eql("sofort"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'sofort'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("sofort"); + }, + ); +} // Response body should have value "stripe" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", function() { - pm.expect(jsonData.connector).to.eql("stripe"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", + function () { + pm.expect(jsonData.connector).to.eql("stripe"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/request.json index 1b3aca65658..fd2297e984d 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -31,19 +51,14 @@ "country": "DE" } } - } + }, + "client_secret": "{{client_secret}}" } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/request.json index 37cd6d0b939..21e71ad037a 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Create/request.json @@ -85,12 +85,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario16-Bank Redirect-sofort/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/.event.meta.json index 688c85746ef..220b1a6723d 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/event.prerequest.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/event.prerequest.js new file mode 100644 index 00000000000..e69de29bb2d diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/event.test.js index 1047304bdb0..9ac75842b5c 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "eps" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'eps'", function() { - pm.expect(jsonData.payment_method_type).to.eql("eps"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'eps'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("eps"); + }, + ); +} // Response body should have value "stripe" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", function() { - pm.expect(jsonData.connector).to.eql("stripe"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", + function () { + pm.expect(jsonData.connector).to.eql("stripe"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/request.json index 66d9d486368..61add73d411 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -31,19 +51,14 @@ "country": "DE" } } - } + }, + "client_secret": "{{client_secret}}" } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/request.json index 37cd6d0b939..21e71ad037a 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Create/request.json @@ -85,12 +85,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario17-Bank Redirect-eps/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/.event.meta.json index 688c85746ef..220b1a6723d 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/event.prerequest.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/event.prerequest.js new file mode 100644 index 00000000000..e69de29bb2d diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/event.test.js index 4baa4bae4ff..16173a9960d 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "giropay" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'giropay'", function() { - pm.expect(jsonData.payment_method_type).to.eql("giropay"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'giropay'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("giropay"); + }, + ); +} // Response body should have value "stripe" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", function() { - pm.expect(jsonData.connector).to.eql("stripe"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", + function () { + pm.expect(jsonData.connector).to.eql("stripe"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/request.json index 70123c3aba7..38b18355e14 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -31,19 +51,14 @@ "country": "DE" } } - } + }, + "client_secret": "{{client_secret}}" } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/request.json index 37cd6d0b939..21e71ad037a 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Create/request.json @@ -85,12 +85,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario18-Bank Redirect-giropay/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Debit-ach/.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Debit-ach/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Debit-ach/.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Debit-ach/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Debit-ach/Payments - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Debit-ach/Payments - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Debit-ach/Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Debit-ach/Payments - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Debit-ach/Payments - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Debit-ach/Payments - Create/event.test.js index 1baf6b854b7..5e6a7972fd7 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Debit-ach/Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Debit-ach/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", function() { - pm.expect(jsonData.status).to.eql("requires_customer_action"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", + function () { + pm.expect(jsonData.status).to.eql("requires_customer_action"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Debit-ach/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Debit-ach/Payments - Create/request.json index eda0801c9cc..9612b490987 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Debit-ach/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Debit-ach/Payments - Create/request.json @@ -23,9 +23,7 @@ "confirm": true, "business_label": "default", "capture_method": "automatic", - "connector": [ - "stripe" - ], + "connector": ["stripe"], "customer_id": "klarna", "capture_on": "2022-09-10T10:11:12Z", "authentication_type": "three_ds", @@ -85,12 +83,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Debit-ach/Payments - Retrieve/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Debit-ach/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Debit-ach/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Debit-ach/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Debit-ach/Payments - Retrieve/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Debit-ach/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Debit-ach/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Debit-ach/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Debit-ach/Payments - Retrieve/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Debit-ach/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Debit-ach/Payments - Retrieve/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Debit-ach/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Confirm/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Confirm/.event.meta.json index 688c85746ef..220b1a6723d 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Confirm/event.prerequest.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Confirm/event.prerequest.js new file mode 100644 index 00000000000..e69de29bb2d diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Confirm/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Confirm/event.test.js index 613ddad8289..5f6f2941136 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Confirm/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Confirm/event.test.js @@ -1,77 +1,114 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // Response body should have "next_action.type" -pm.test("[POST]::/payments - Content check if 'next_action.type' exists", function() { - pm.expect((typeof jsonData.next_action.type !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'next_action.type' exists", + function () { + pm.expect(typeof jsonData.next_action.type !== "undefined").to.be.true; + }, +); // Response body should have value "ach" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'ach'", function() { - pm.expect(jsonData.payment_method_type).to.eql("ach"); -})}; + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'ach'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("ach"); + }, + ); +} // Response body should have value "display_bank_transfer_information" for "next_action.type" if (jsonData?.next_action.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'display_bank_transfer_information'", function() { - pm.expect(jsonData.next_action.type).to.eql("display_bank_transfer_information"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'display_bank_transfer_information'", + function () { + pm.expect(jsonData.next_action.type).to.eql( + "display_bank_transfer_information", + ); + }, + ); +} // Response body should have value "stripe" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", function() { - pm.expect(jsonData.connector).to.eql("stripe"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", + function () { + pm.expect(jsonData.connector).to.eql("stripe"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Confirm/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Confirm/request.json index 2e474fe80c7..73cb12864b7 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Confirm/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -28,19 +48,14 @@ } } } - } + }, + "client_secret": "{{client_secret}}" } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Create/request.json index 38920280c4b..a96b695950a 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Create/request.json @@ -47,12 +47,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Retrieve/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Retrieve/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Retrieve/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Retrieve/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario19-Bank Transfer-ach/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json index 688c85746ef..220b1a6723d 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.prerequest.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.prerequest.js new file mode 100644 index 00000000000..e69de29bb2d diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js index c2246995b6d..dc69bd52a50 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js @@ -1,58 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} + +// Response body should have value "6540" for "amount" +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} + +// Response body should have value "6540" for "amount_capturable" +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 0'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(0); + }, + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments/:id/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; -}); \ No newline at end of file +pm.test( + "[POST]::/payments - Content check if 'connector_transaction_id' exists", + function () { + pm.expect(typeof jsonData.connector_transaction_id !== "undefined").to.be + .true; + }, +); diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js index 65232a76373..55dc35b9128 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; - - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json index abe9c26aeb6..4105bd1a869 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js index 03ccae1adb0..53f98b7f7f4 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js @@ -1,49 +1,91 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + 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 "6540" for "amount" +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} + +// Response body should have value "6540" for "amount_capturable" +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 0'", + function () { + pm.expect(jsonData.amount_capturable).to.eql(0); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Confirm/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Confirm/.event.meta.json index 688c85746ef..220b1a6723d 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Confirm/event.prerequest.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Confirm/event.prerequest.js new file mode 100644 index 00000000000..e69de29bb2d diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Confirm/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Confirm/event.test.js index 0278cb49b23..29b6fe2124e 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Confirm/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Confirm/event.test.js @@ -1,77 +1,112 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // Response body should have "next_action.type" -pm.test("[POST]::/payments - Content check if 'next_action.type' exists", function() { - pm.expect((typeof jsonData.next_action.type !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'next_action.type' exists", + function () { + pm.expect(typeof jsonData.next_action.type !== "undefined").to.be.true; + }, +); // Response body should have value "ach" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'we_chat_pay'", function() { - pm.expect(jsonData.payment_method_type).to.eql("we_chat_pay"); -})}; + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'we_chat_pay'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("we_chat_pay"); + }, + ); +} // Response body should have value "qr_code_information" for "next_action.type" if (jsonData?.next_action.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'qr_code_information'", function() { - pm.expect(jsonData.next_action.type).to.eql("qr_code_information"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'qr_code_information'", + function () { + pm.expect(jsonData.next_action.type).to.eql("qr_code_information"); + }, + ); +} // Response body should have value "stripe" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", function() { - pm.expect(jsonData.connector).to.eql("stripe"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'", + function () { + pm.expect(jsonData.connector).to.eql("stripe"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Confirm/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Confirm/request.json index a0f54fa27d4..9189e4dd852 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Confirm/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -24,19 +44,14 @@ "wallet": { "we_chat_pay_qr": {} } - } + }, + "client_secret": "{{client_secret}}" } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Create/request.json index daffd2ab9ec..731eeaf1400 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Create/request.json @@ -49,12 +49,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Retrieve/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Retrieve/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Retrieve/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Retrieve/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22-Wallet-Wechatpay/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..220b1a6723d 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.prerequest.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.prerequest.js new file mode 100644 index 00000000000..e69de29bb2d diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js index 5d9e5785e6e..c9d1b4e51e6 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js @@ -1,52 +1,73 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id/confirm - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id/confirm - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json index bb2b0cdc1b0..77f4d0dafe7 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -27,19 +47,14 @@ "card_holder_name": "joseph Doe", "card_cvc": "123" } - } + }, + "client_secret": "{{client_secret}}" } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json index 785122a83c5..beeb5b3983f 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json @@ -71,12 +71,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js index 03ccae1adb0..aced67dbfb7 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js index 1e2875ec9f6..2d7dbc507fb 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js @@ -1,68 +1,94 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/capture - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); - -// Validate if response has JSON Body +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.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} - +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]:://payments/:id/capture - 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 "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "6000" for "amount_received" if (jsonData?.amount_received) { -pm.test("[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", function() { - pm.expect(jsonData.amount_received).to.eql(6000); -})}; - - - - + pm.test( + "[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", + function () { + pm.expect(jsonData.amount_received).to.eql(6000); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json index 8975575ca40..9fe257ed85e 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js index b0e69cad2c2..d683186aa00 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json index 0fbd6a4dcdd..0619498e38c 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js index 1a0942b5f88..5c7196baa4f 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js index 9632bd19048..dcf3f191643 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js @@ -1,43 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/cancel - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type 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(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "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"); -})}; - - - + pm.test( + "[POST]::/payments/:id/cancel - Content check if value for 'status' matches 'cancelled'", + function () { + pm.expect(jsonData.status).to.eql("cancelled"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js index b0e69cad2c2..d683186aa00 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json index 0fbd6a4dcdd..0619498e38c 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js index f4e0ab9b2aa..5e52e13a59e 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "cancelled" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'", function() { - pm.expect(jsonData.status).to.eql("cancelled"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'", + function () { + pm.expect(jsonData.status).to.eql("cancelled"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js index 1388cde7c89..39cbb3ee90e 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/event.test.js @@ -1,54 +1,80 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", function() { - pm.expect(jsonData.status).to.eql("requires_customer_action"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", + function () { + pm.expect(jsonData.status).to.eql("requires_customer_action"); + }, + ); +} // Response body should have "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; -}); +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; + }, +); diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json index b169462ce3d..d14ae6582c8 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json @@ -84,12 +84,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js index 08ad2d6a233..02ab01502c1 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + 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"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json index 688c85746ef..220b1a6723d 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.prerequest.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.prerequest.js new file mode 100644 index 00000000000..e69de29bb2d diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js index edf87c9ccdf..1fa0afa6402 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/event.test.js @@ -1,57 +1,83 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments/:id/confirm - Content check if 'next_action.redirect_to_url' exists", function() { - pm.expect((typeof jsonData.next_action.redirect_to_url !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments/:id/confirm - Content check if 'next_action.redirect_to_url' exists", + function () { + pm.expect(typeof jsonData.next_action.redirect_to_url !== "undefined").to.be + .true; + }, +); diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js index 5698484c741..55dc35b9128 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json index e9679023b87..14f3394596f 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confrm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json index b5f464abc14..2363c62ff27 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js index 1c34027de1d..f89b9b86fef 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json index 5e306df7a55..5f4c58816d5 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js index 07a9529b82e..6cb4312a60a 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/Flow Testcases/QuickStart/API Key - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/QuickStart/API Key - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/QuickStart/API Key - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/QuickStart/API Key - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/QuickStart/API Key - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/QuickStart/API Key - Create/event.test.js index bc42e83a761..4e27c5a5025 100644 --- a/postman/collection-dir/stripe/Flow Testcases/QuickStart/API Key - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/QuickStart/API Key - Create/event.test.js @@ -1,32 +1,46 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/api_keys/:merchant_id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/api_keys/:merchant_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/api_keys/:merchant_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; try { jsonData = pm.response.json(); -} catch(e) { -} +} catch (e) {} // pm.collectionVariables - Set api_key_id as variable for jsonData.key_id if (jsonData?.key_id) { - pm.collectionVariables.set("api_key_id", jsonData.key_id); - console.log("- use {{api_key_id}} as collection variable for value", jsonData.key_id); + pm.collectionVariables.set("api_key_id", jsonData.key_id); + console.log( + "- use {{api_key_id}} as collection variable for value", + jsonData.key_id, + ); } else { - console.log('INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value", jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/QuickStart/API Key - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/QuickStart/API Key - Create/request.json index 29c2490d1bc..2210d14da0e 100644 --- a/postman/collection-dir/stripe/Flow Testcases/QuickStart/API Key - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/QuickStart/API Key - Create/request.json @@ -35,13 +35,8 @@ }, "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js index 538b393c084..7de0d5beb31 100644 --- a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js @@ -1,37 +1,56 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - 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]::/accounts - 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", + ); }); // 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 merchant_id as variable for jsonData.merchant_id if (jsonData?.merchant_id) { - pm.collectionVariables.set("merchant_id", jsonData.merchant_id); - console.log("- use {{merchant_id}} as collection variable for value",jsonData.merchant_id); + pm.collectionVariables.set("merchant_id", jsonData.merchant_id); + console.log( + "- use {{merchant_id}} as collection variable for value", + jsonData.merchant_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value",jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} // pm.collectionVariables - Set publishable_key as variable for jsonData.publishable_key if (jsonData?.publishable_key) { - pm.collectionVariables.set("publishable_key", jsonData.publishable_key); - console.log("- use {{publishable_key}} as collection variable for value",jsonData.publishable_key); + pm.collectionVariables.set("publishable_key", jsonData.publishable_key); + console.log( + "- use {{publishable_key}} as collection variable for value", + jsonData.publishable_key, + ); } else { - console.log('INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Merchant Account - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Merchant Account - Create/request.json index 9f0ff5575c0..3d331205b0a 100644 --- a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Merchant Account - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Merchant Account - Create/request.json @@ -84,12 +84,8 @@ }, "url": { "raw": "{{baseUrl}}/accounts", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "accounts" - ] + "host": ["{{baseUrl}}"], + "path": ["accounts"] }, "description": "Create a new account for a merchant. The merchant could be a seller or retailer or client who likes to receive and send payments." } diff --git a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js index b831702461e..88e92d8d84a 100644 --- a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js @@ -1,21 +1,39 @@ -// Validate status 2xx -pm.test("[POST]::/account/:account_id/connectors - 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.be.success; + }, +); // Validate if response header has matching content-type -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"); -}); +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){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id if (jsonData?.merchant_connector_id) { - pm.collectionVariables.set("merchant_connector_id", jsonData.merchant_connector_id); - console.log("- use {{merchant_connector_id}} as collection variable for value",jsonData.merchant_connector_id); + pm.collectionVariables.set( + "merchant_connector_id", + jsonData.merchant_connector_id, + ); + console.log( + "- use {{merchant_connector_id}} as collection variable for value", + jsonData.merchant_connector_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payment Connector - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payment Connector - Create/request.json index c78f2f28c26..474b4d1e1ea 100644 --- a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payment Connector - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payment Connector - Create/request.json @@ -211,10 +211,7 @@ "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true, - "card_networks": [ - "Visa", - "Mastercard" - ] + "card_networks": ["Visa", "Mastercard"] } ] }, @@ -227,10 +224,7 @@ "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true, - "card_networks": [ - "Visa", - "Mastercard" - ] + "card_networks": ["Visa", "Mastercard"] } ] }, @@ -275,10 +269,7 @@ { "type": "CARD", "parameters": { - "allowed_auth_methods": [ - "PAN_ONLY", - "CRYPTOGRAM_3DS" - ], + "allowed_auth_methods": ["PAN_ONLY", "CRYPTOGRAM_3DS"], "allowed_card_networks": [ "AMEX", "DISCOVER", @@ -312,15 +303,8 @@ }, "payment_request_data": { "label": "applepay pvt.ltd", - "supported_networks": [ - "visa", - "masterCard", - "amex", - "discover" - ], - "merchant_capabilities": [ - "supports3DS" - ] + "supported_networks": ["visa", "masterCard", "amex", "discover"], + "merchant_capabilities": ["supports3DS"] } } } @@ -328,14 +312,8 @@ }, "url": { "raw": "{{baseUrl}}/account/:account_id/connectors", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payments - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payments - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payments - Create/event.test.js index 62142d52dca..a6947db94c0 100644 --- a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payments - Create/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payments - Create/request.json index ffaa9907b73..0a7b19679aa 100644 --- a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js index 4dd072b2222..d0a02af7436 100644 --- a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // 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.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payments - Retrieve/request.json b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payments - Retrieve/request.json index c71774083b2..ef0b213739d 100644 --- a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payments - Retrieve/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Refunds - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Refunds - Create/event.test.js index c862e8e68a7..dbc930608cb 100644 --- a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Refunds - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Refunds - Create/event.test.js @@ -1,21 +1,30 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Refunds - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Refunds - Create/request.json index 4dbca4d01f2..0c13281ee15 100644 --- a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Refunds - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js index b1e1f12ba50..bbd8e544e2c 100644 --- a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js @@ -1,22 +1,30 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); - // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Refunds - Retrieve/request.json b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Refunds - Retrieve/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js index edc05c40785..20d676cc345 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js @@ -1,60 +1,86 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} // Response body should have value "connector error" for "error message" if (jsonData?.error?.message) { -pm.test("[POST]::/payments - Content check if value for 'error.message' matches 'Invalid Expiry Year'", function() { - pm.expect(jsonData.error.message).to.eql("Invalid Expiry Year"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json index 5b0df7ad6d0..0e1f282acdb 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js index 7d118e2f5e5..edb1f073bee 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js @@ -1,56 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); - // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json index cbd62dc1327..92e81f4f53a 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js index 0e6401222ff..52680771c31 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js @@ -1,55 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector_error'", function() { - pm.expect(jsonData.error.type).to.eql("connector_error"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'", + function () { + pm.expect(jsonData.error.type).to.eql("connector_error"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json index ecfec7e5d60..a8f4cf69a29 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json @@ -79,12 +79,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js index 630c4f25cae..3976f7f496a 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js @@ -1,55 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector'", function() { - pm.expect(jsonData.error.type).to.eql("connector"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector'", + function () { + pm.expect(jsonData.error.type).to.eql("connector"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json index bed0cc48bc3..fdc09ce202f 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json index 90b19864ee1..f2bee31ef66 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Confirm" - ] + "childrenOrder": ["Payments - Create", "Payments - Confirm"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..220b1a6723d 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.prerequest.js b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.prerequest.js new file mode 100644 index 00000000000..e69de29bb2d diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js index 1e8ba8cc3a6..e8d6b2216c5 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js @@ -1,58 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); -}); - - +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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json index 785122a83c5..beeb5b3983f 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json @@ -71,12 +71,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js index c3e7afc6760..46bf201d1ce 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js @@ -1,59 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json index 766a8330d6e..6c934a9132c 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js index b0e69cad2c2..d683186aa00 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json index 0fbd6a4dcdd..0619498e38c 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js index 6b03e0b9ee6..34beacf976b 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" 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"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json index cafd3a6808e..6df7c0a1943 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Capture" - ] + "childrenOrder": ["Payments - Create", "Payments - Capture"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js index c3e7afc6760..46bf201d1ce 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js @@ -1,59 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json index 766a8330d6e..6c934a9132c 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json index b5f464abc14..2363c62ff27 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json index afba25ab6d6..5ff1a7cb4e8 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Cancel" - ] + "childrenOrder": ["Payments - Create", "Payments - Cancel"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js index d7879c70d87..0f869a6dfb8 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js @@ -1,50 +1,69 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/cancel - Status code is 4xx", function () { - pm.response.to.be.error; + 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/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/cancel - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; - - - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json index b5f464abc14..2363c62ff27 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/event.test.js index f125e2a7885..46bf201d1ce 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/event.test.js @@ -1,61 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + 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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/request.json index 14ac5f8bb4a..2b31ac6d784 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/event.test.js index c289d7d25fb..39cbb3ee90e 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/event.test.js @@ -1,55 +1,80 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", function() { - pm.expect(jsonData.status).to.eql("requires_customer_action"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", + function () { + pm.expect(jsonData.status).to.eql("requires_customer_action"); + }, + ); +} // Response body should have "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; -}); - +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; + }, +); diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json index 211364c49ee..c132368eb40 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/event.test.js index 1f59e2b00ac..02ab01502c1 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json index b5f464abc14..2363c62ff27 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js index 9537daf6187..776dbd70712 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/event.test.js @@ -1,33 +1,48 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/refunds - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + 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; -}); +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"); -})}; - + 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"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json index 326319e8fdf..10de81bed08 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js index 65232a76373..55dc35b9128 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; - - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json index abe9c26aeb6..4105bd1a869 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js index 42bf3e0ac45..fdb8a946f3d 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js index 30888b5cc0c..d3c4451760d 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js @@ -1,32 +1,48 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/refunds - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + 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; -}); +pm.test( + "[POST]::/payments/:id/confirm - Content check if 'error' exists", + function () { + pm.expect(typeof jsonData.error !== "undefined").to.be.true; + }, +); // Response body should have value "invalid_request" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; + pm.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"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json index d18aaf8befd..9fe125ce8ea 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/event.test.js index b9d305e4fc4..1b37dc2c7d1 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/event.test.js @@ -1,65 +1,97 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/request.json index 3ffbe03a605..a5c9391cf74 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/request.json @@ -98,12 +98,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/event.test.js index b94e329999b..db584da2266 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/event.test.js @@ -1,61 +1,87 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} // Response body should have "mandate_id" -pm.test("[POST]::/payments - Content check if 'mandate_id' exists", function() { - pm.expect((typeof jsonData.mandate_id !== "undefined")).to.be.true; -}); +pm.test( + "[POST]::/payments - Content check if 'mandate_id' exists", + function () { + pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true; + }, +); // Response body should have "mandate_data" -pm.test("[POST]::/payments - Content check if 'mandate_data' exists", function() { - pm.expect((typeof jsonData.mandate_data !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments - Content check if 'mandate_data' exists", + function () { + pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true; + }, +); diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/.event.meta.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/event.test.js b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/event.test.js index 22617f827cf..e862404c2b2 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/event.test.js @@ -1,56 +1,79 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/confirm - Content check if 'error' exists", + function () { + pm.expect(typeof jsonData.error !== "undefined").to.be.true; + }, +); // Response body should have value "invalid_request" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; - - + pm.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"); + }, + ); +} diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json index 7046a498b43..3ced4fa5327 100644 --- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json +++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json @@ -73,12 +73,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Health check/.meta.json b/postman/collection-dir/stripe/Health check/.meta.json index 66ee7e50cab..579f9fd541c 100644 --- a/postman/collection-dir/stripe/Health check/.meta.json +++ b/postman/collection-dir/stripe/Health check/.meta.json @@ -1,5 +1,3 @@ { - "childrenOrder": [ - "New Request" - ] + "childrenOrder": ["New Request"] } diff --git a/postman/collection-dir/stripe/Health check/New Request/.event.meta.json b/postman/collection-dir/stripe/Health check/New Request/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Health check/New Request/.event.meta.json +++ b/postman/collection-dir/stripe/Health check/New Request/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Health check/New Request/event.test.js b/postman/collection-dir/stripe/Health check/New Request/event.test.js index 325a8c8a479..b490b8be090 100644 --- a/postman/collection-dir/stripe/Health check/New Request/event.test.js +++ b/postman/collection-dir/stripe/Health check/New Request/event.test.js @@ -1,4 +1,4 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - Status code is 2xx", function () { - pm.response.to.be.success; -}); \ No newline at end of file + pm.response.to.be.success; +}); diff --git a/postman/collection-dir/stripe/Health check/New Request/request.json b/postman/collection-dir/stripe/Health check/New Request/request.json index 4cc8d4b1a96..e40e9396178 100644 --- a/postman/collection-dir/stripe/Health check/New Request/request.json +++ b/postman/collection-dir/stripe/Health check/New Request/request.json @@ -10,11 +10,7 @@ ], "url": { "raw": "{{baseUrl}}/health", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "health" - ] + "host": ["{{baseUrl}}"], + "path": ["health"] } } diff --git a/postman/collection-dir/stripe/MerchantAccounts/Merchant Account - Create/.event.meta.json b/postman/collection-dir/stripe/MerchantAccounts/Merchant Account - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/stripe/MerchantAccounts/Merchant Account - Create/.event.meta.json +++ b/postman/collection-dir/stripe/MerchantAccounts/Merchant Account - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/stripe/MerchantAccounts/Merchant Account - Create/event.test.js b/postman/collection-dir/stripe/MerchantAccounts/Merchant Account - Create/event.test.js index 538b393c084..7de0d5beb31 100644 --- a/postman/collection-dir/stripe/MerchantAccounts/Merchant Account - Create/event.test.js +++ b/postman/collection-dir/stripe/MerchantAccounts/Merchant Account - Create/event.test.js @@ -1,37 +1,56 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - 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]::/accounts - 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", + ); }); // 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 merchant_id as variable for jsonData.merchant_id if (jsonData?.merchant_id) { - pm.collectionVariables.set("merchant_id", jsonData.merchant_id); - console.log("- use {{merchant_id}} as collection variable for value",jsonData.merchant_id); + pm.collectionVariables.set("merchant_id", jsonData.merchant_id); + console.log( + "- use {{merchant_id}} as collection variable for value", + jsonData.merchant_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value",jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} // pm.collectionVariables - Set publishable_key as variable for jsonData.publishable_key if (jsonData?.publishable_key) { - pm.collectionVariables.set("publishable_key", jsonData.publishable_key); - console.log("- use {{publishable_key}} as collection variable for value",jsonData.publishable_key); + pm.collectionVariables.set("publishable_key", jsonData.publishable_key); + console.log( + "- use {{publishable_key}} as collection variable for value", + jsonData.publishable_key, + ); } else { - console.log('INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/MerchantAccounts/Merchant Account - Create/request.json b/postman/collection-dir/stripe/MerchantAccounts/Merchant Account - Create/request.json index 5313e3e6b48..e0be5a59e72 100644 --- a/postman/collection-dir/stripe/MerchantAccounts/Merchant Account - Create/request.json +++ b/postman/collection-dir/stripe/MerchantAccounts/Merchant Account - Create/request.json @@ -84,12 +84,8 @@ }, "url": { "raw": "{{baseUrl}}/accounts", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "accounts" - ] + "host": ["{{baseUrl}}"], + "path": ["accounts"] }, "description": "Create a new account for a merchant. The merchant could be a seller or retailer or client who likes to receive and send payments." } diff --git a/postman/collection-dir/stripe/MerchantAccounts/Merchant Account - Retrieve/.event.meta.json b/postman/collection-dir/stripe/MerchantAccounts/Merchant Account - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/MerchantAccounts/Merchant Account - Retrieve/.event.meta.json +++ b/postman/collection-dir/stripe/MerchantAccounts/Merchant Account - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/MerchantAccounts/Merchant Account - Retrieve/event.test.js b/postman/collection-dir/stripe/MerchantAccounts/Merchant Account - Retrieve/event.test.js index 39ee1a1d9de..7694684a177 100644 --- a/postman/collection-dir/stripe/MerchantAccounts/Merchant Account - Retrieve/event.test.js +++ b/postman/collection-dir/stripe/MerchantAccounts/Merchant Account - Retrieve/event.test.js @@ -1,29 +1,43 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/accounts/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/accounts/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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 api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value",jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} // pm.collectionVariables - Set publishable_key as variable for jsonData.publishable_key if (jsonData?.publishable_key) { - pm.collectionVariables.set("publishable_key", jsonData.publishable_key); - console.log("- use {{publishable_key}} as collection variable for value",jsonData.publishable_key); + pm.collectionVariables.set("publishable_key", jsonData.publishable_key); + console.log( + "- use {{publishable_key}} as collection variable for value", + jsonData.publishable_key, + ); } else { - console.log('INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/MerchantAccounts/Merchant Account - Retrieve/request.json b/postman/collection-dir/stripe/MerchantAccounts/Merchant Account - Retrieve/request.json index 536ad17268f..bf4c8467c28 100644 --- a/postman/collection-dir/stripe/MerchantAccounts/Merchant Account - Retrieve/request.json +++ b/postman/collection-dir/stripe/MerchantAccounts/Merchant Account - Retrieve/request.json @@ -28,13 +28,8 @@ ], "url": { "raw": "{{baseUrl}}/accounts/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "accounts", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["accounts", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/MerchantAccounts/Merchant Account - Update/.event.meta.json b/postman/collection-dir/stripe/MerchantAccounts/Merchant Account - Update/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/MerchantAccounts/Merchant Account - Update/.event.meta.json +++ b/postman/collection-dir/stripe/MerchantAccounts/Merchant Account - Update/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/MerchantAccounts/Merchant Account - Update/event.test.js b/postman/collection-dir/stripe/MerchantAccounts/Merchant Account - Update/event.test.js index e783ad66b4a..ecd9d862b3f 100644 --- a/postman/collection-dir/stripe/MerchantAccounts/Merchant Account - Update/event.test.js +++ b/postman/collection-dir/stripe/MerchantAccounts/Merchant Account - Update/event.test.js @@ -1,31 +1,46 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/accounts/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/accounts/:id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value",jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} // pm.collectionVariables - Set publishable_key as variable for jsonData.publishable_key if (jsonData?.publishable_key) { - pm.collectionVariables.set("publishable_key", jsonData.publishable_key); - console.log("- use {{publishable_key}} as collection variable for value",jsonData.publishable_key); + pm.collectionVariables.set("publishable_key", jsonData.publishable_key); + console.log( + "- use {{publishable_key}} as collection variable for value", + jsonData.publishable_key, + ); } else { - console.log('INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.'); -}; - - + console.log( + "INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/MerchantAccounts/Merchant Account - Update/request.json b/postman/collection-dir/stripe/MerchantAccounts/Merchant Account - Update/request.json index c58b1202d11..28eec4aa472 100644 --- a/postman/collection-dir/stripe/MerchantAccounts/Merchant Account - Update/request.json +++ b/postman/collection-dir/stripe/MerchantAccounts/Merchant Account - Update/request.json @@ -79,13 +79,8 @@ }, "url": { "raw": "{{baseUrl}}/accounts/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "accounts", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["accounts", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/PaymentConnectors/List Connectors by MID/.event.meta.json b/postman/collection-dir/stripe/PaymentConnectors/List Connectors by MID/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/PaymentConnectors/List Connectors by MID/.event.meta.json +++ b/postman/collection-dir/stripe/PaymentConnectors/List Connectors by MID/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/PaymentConnectors/List Connectors by MID/event.test.js b/postman/collection-dir/stripe/PaymentConnectors/List Connectors by MID/event.test.js index f9f4f482ca1..c685ff160bf 100644 --- a/postman/collection-dir/stripe/PaymentConnectors/List Connectors by MID/event.test.js +++ b/postman/collection-dir/stripe/PaymentConnectors/List Connectors by MID/event.test.js @@ -1,9 +1,17 @@ -// Validate status 2xx -pm.test("[GET]::/account/:account_id/connectors - Status code is 2xx", function () { - pm.response.to.be.success; -}); +// Validate status 2xx +pm.test( + "[GET]::/account/:account_id/connectors - Status code is 2xx", + function () { + pm.response.to.be.success; + }, +); // Validate if response header has matching content-type -pm.test("[GET]::/account/:account_id/connectors - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[GET]::/account/:account_id/connectors - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); diff --git a/postman/collection-dir/stripe/PaymentConnectors/List Connectors by MID/request.json b/postman/collection-dir/stripe/PaymentConnectors/List Connectors by MID/request.json index 89aa4e59406..81d0ea5ef1e 100644 --- a/postman/collection-dir/stripe/PaymentConnectors/List Connectors by MID/request.json +++ b/postman/collection-dir/stripe/PaymentConnectors/List Connectors by MID/request.json @@ -23,14 +23,8 @@ ], "url": { "raw": "{{baseUrl}}/account/:account_id/connectors", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/stripe/PaymentConnectors/Merchant Account - Delete/.event.meta.json b/postman/collection-dir/stripe/PaymentConnectors/Merchant Account - Delete/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/PaymentConnectors/Merchant Account - Delete/.event.meta.json +++ b/postman/collection-dir/stripe/PaymentConnectors/Merchant Account - Delete/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/PaymentConnectors/Merchant Account - Delete/event.test.js b/postman/collection-dir/stripe/PaymentConnectors/Merchant Account - Delete/event.test.js index 2432e148b84..596c14630df 100644 --- a/postman/collection-dir/stripe/PaymentConnectors/Merchant Account - Delete/event.test.js +++ b/postman/collection-dir/stripe/PaymentConnectors/Merchant Account - Delete/event.test.js @@ -1,17 +1,42 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[DELETE]::/accounts/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[DELETE]::/accounts/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[DELETE]::/accounts/:id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Response Validation -const schema = {"type":"object","description":"Merchant Account","required":["merchant_id","deleted"],"properties":{"merchant_id":{"type":"string","description":"The identifier for the MerchantAccount object.","maxLength":255,"example":"y3oqhf46pyzuxjbcn2giaqnb44"},"deleted":{"type":"boolean","description":"Indicates the deletion status of the Merchant Account object.","example":true}}} +const schema = { + type: "object", + description: "Merchant Account", + required: ["merchant_id", "deleted"], + properties: { + merchant_id: { + type: "string", + description: "The identifier for the MerchantAccount object.", + maxLength: 255, + example: "y3oqhf46pyzuxjbcn2giaqnb44", + }, + deleted: { + type: "boolean", + description: + "Indicates the deletion status of the Merchant Account object.", + example: true, + }, + }, +}; -// Validate if response matches JSON schema -pm.test("[DELETE]::/accounts/:id - Schema is valid", function() { - pm.response.to.have.jsonSchema(schema,{unknownFormats: ["int32", "int64", "float", "double"]}); +// Validate if response matches JSON schema +pm.test("[DELETE]::/accounts/:id - Schema is valid", function () { + pm.response.to.have.jsonSchema(schema, { + unknownFormats: ["int32", "int64", "float", "double"], + }); }); diff --git a/postman/collection-dir/stripe/PaymentConnectors/Merchant Account - Delete/request.json b/postman/collection-dir/stripe/PaymentConnectors/Merchant Account - Delete/request.json index 17d56a57ea4..a07ea6f0868 100644 --- a/postman/collection-dir/stripe/PaymentConnectors/Merchant Account - Delete/request.json +++ b/postman/collection-dir/stripe/PaymentConnectors/Merchant Account - Delete/request.json @@ -28,13 +28,8 @@ ], "url": { "raw": "{{baseUrl}}/accounts/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "accounts", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["accounts", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Create/.event.meta.json b/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Create/.event.meta.json +++ b/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Create/event.test.js b/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Create/event.test.js index 830433e758f..aa1bc4845b7 100644 --- a/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Create/event.test.js +++ b/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Create/event.test.js @@ -1,21 +1,39 @@ -// Validate status 2xx -pm.test("[POST]::/accounts/:account_id/connectors - Status code is 2xx", function () { - pm.response.to.be.success; -}); +// Validate status 2xx +pm.test( + "[POST]::/accounts/:account_id/connectors - Status code is 2xx", + function () { + pm.response.to.be.success; + }, +); // Validate if response header has matching content-type -pm.test("[POST]::/accounts/:account_id/connectors - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/accounts/: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){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id if (jsonData?.merchant_connector_id) { - pm.collectionVariables.set("merchant_connector_id", jsonData.merchant_connector_id); - console.log("- use {{merchant_connector_id}} as collection variable for value",jsonData.merchant_connector_id); + pm.collectionVariables.set( + "merchant_connector_id", + jsonData.merchant_connector_id, + ); + console.log( + "- use {{merchant_connector_id}} as collection variable for value", + jsonData.merchant_connector_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Create/request.json b/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Create/request.json index 7597aec0999..6fe1be149f8 100644 --- a/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Create/request.json +++ b/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Create/request.json @@ -54,10 +54,7 @@ "payment_method_types": [ { "payment_method_type": "credit", - "card_networks": [ - "Visa", - "Mastercard" - ], + "card_networks": ["Visa", "Mastercard"], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, @@ -65,10 +62,7 @@ }, { "payment_method_type": "debit", - "card_networks": [ - "Visa", - "Mastercard" - ], + "card_networks": ["Visa", "Mastercard"], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, @@ -114,14 +108,8 @@ }, "url": { "raw": "{{baseUrl}}/account/:account_id/connectors", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Delete/.event.meta.json b/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Delete/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Delete/.event.meta.json +++ b/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Delete/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Delete/event.test.js b/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Delete/event.test.js index 9c3be62cfa9..a8f03ce767f 100644 --- a/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Delete/event.test.js +++ b/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Delete/event.test.js @@ -1,21 +1,39 @@ -// Validate status 2xx -pm.test("[DELETE]::/account/:account_id/connectors/:connector_id - Status code is 2xx", function () { - pm.response.to.be.success; -}); +// Validate status 2xx +pm.test( + "[DELETE]::/account/:account_id/connectors/:connector_id - Status code is 2xx", + function () { + pm.response.to.be.success; + }, +); // Validate if response header has matching content-type -pm.test("[DELETE]::/account/:account_id/connectors/:connector_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[DELETE]::/account/:account_id/connectors/:connector_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id if (jsonData?.merchant_connector_id) { - pm.collectionVariables.set("merchant_connector_id", jsonData.merchant_connector_id); - console.log("- use {{merchant_connector_id}} as collection variable for value",jsonData.merchant_connector_id); + pm.collectionVariables.set( + "merchant_connector_id", + jsonData.merchant_connector_id, + ); + console.log( + "- use {{merchant_connector_id}} as collection variable for value", + jsonData.merchant_connector_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Delete/request.json b/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Delete/request.json index 6d7939d6762..9fbf515fcce 100644 --- a/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Delete/request.json +++ b/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Delete/request.json @@ -28,15 +28,8 @@ ], "url": { "raw": "{{baseUrl}}/account/:account_id/connectors/:connector_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors", - ":connector_id" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors", ":connector_id"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Retrieve/.event.meta.json b/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Retrieve/.event.meta.json +++ b/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Retrieve/event.test.js b/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Retrieve/event.test.js index 2928af62175..8125c4e1bb7 100644 --- a/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Retrieve/event.test.js +++ b/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Retrieve/event.test.js @@ -1,21 +1,39 @@ -// Validate status 2xx -pm.test("[GET]::/accounts/:account_id/connectors/:connector_id - Status code is 2xx", function () { - pm.response.to.be.success; -}); +// Validate status 2xx +pm.test( + "[GET]::/accounts/:account_id/connectors/:connector_id - Status code is 2xx", + function () { + pm.response.to.be.success; + }, +); // Validate if response header has matching content-type -pm.test("[GET]::/accounts/:account_id/connectors/:connector_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[GET]::/accounts/:account_id/connectors/:connector_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id if (jsonData?.merchant_connector_id) { - pm.collectionVariables.set("merchant_connector_id", jsonData.merchant_connector_id); - console.log("- use {{merchant_connector_id}} as collection variable for value",jsonData.merchant_connector_id); + pm.collectionVariables.set( + "merchant_connector_id", + jsonData.merchant_connector_id, + ); + console.log( + "- use {{merchant_connector_id}} as collection variable for value", + jsonData.merchant_connector_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Retrieve/request.json b/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Retrieve/request.json index b87e6538125..7536380bcf0 100644 --- a/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Retrieve/request.json +++ b/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Retrieve/request.json @@ -28,15 +28,8 @@ ], "url": { "raw": "{{baseUrl}}/account/:account_id/connectors/:connector_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors", - ":connector_id" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors", ":connector_id"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Update/.event.meta.json b/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Update/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Update/.event.meta.json +++ b/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Update/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Update/event.test.js b/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Update/event.test.js index e589f0df54c..d7259b6a840 100644 --- a/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Update/event.test.js +++ b/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Update/event.test.js @@ -1,21 +1,39 @@ -// Validate status 2xx -pm.test("[POST]::/account/:account_id/connectors/:connector_id - Status code is 2xx", function () { - pm.response.to.be.success; -}); +// Validate status 2xx +pm.test( + "[POST]::/account/:account_id/connectors/:connector_id - Status code is 2xx", + function () { + pm.response.to.be.success; + }, +); // Validate if response header has matching content-type -pm.test("[POST]::/account/:account_id/connectors/:connector_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/connectors/:connector_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id if (jsonData?.merchant_connector_id) { - pm.collectionVariables.set("merchant_connector_id", jsonData.merchant_connector_id); - console.log("- use {{merchant_connector_id}} as collection variable for value",jsonData.merchant_connector_id); + pm.collectionVariables.set( + "merchant_connector_id", + jsonData.merchant_connector_id, + ); + console.log( + "- use {{merchant_connector_id}} as collection variable for value", + jsonData.merchant_connector_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Update/request.json b/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Update/request.json index dcde75af55e..1d77181f262 100644 --- a/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Update/request.json +++ b/postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Update/request.json @@ -51,10 +51,7 @@ "payment_method_types": [ { "payment_method_type": "credit", - "card_networks": [ - "Visa", - "Mastercard" - ], + "card_networks": ["Visa", "Mastercard"], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, @@ -62,10 +59,7 @@ }, { "payment_method_type": "debit", - "card_networks": [ - "Visa", - "Mastercard" - ], + "card_networks": ["Visa", "Mastercard"], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, @@ -111,15 +105,8 @@ }, "url": { "raw": "{{baseUrl}}/account/:account_id/connectors/:connector_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors", - ":connector_id" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors", ":connector_id"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/stripe/PaymentMethods/List payment methods for a Customer/.event.meta.json b/postman/collection-dir/stripe/PaymentMethods/List payment methods for a Customer/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/PaymentMethods/List payment methods for a Customer/.event.meta.json +++ b/postman/collection-dir/stripe/PaymentMethods/List payment methods for a Customer/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/PaymentMethods/List payment methods for a Customer/event.test.js b/postman/collection-dir/stripe/PaymentMethods/List payment methods for a Customer/event.test.js index f844efad42c..43ee143ef56 100644 --- a/postman/collection-dir/stripe/PaymentMethods/List payment methods for a Customer/event.test.js +++ b/postman/collection-dir/stripe/PaymentMethods/List payment methods for a Customer/event.test.js @@ -1,20 +1,38 @@ -// Validate status 2xx -pm.test("[GET]::/payment_methods/:customer_id - Status code is 2xx", function () { - pm.response.to.be.success; -}); +// Validate status 2xx +pm.test( + "[GET]::/payment_methods/: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"); -}); +pm.test( + "[GET]::/payment_methods/:customer_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} if (jsonData?.customer_payment_methods[0]?.payment_token) { - pm.collectionVariables.set("payment_token", jsonData.customer_payment_methods[0].payment_token); - console.log("- use {{payment_token}} as collection variable for value", jsonData.customer_payment_methods[0].payment_token); + pm.collectionVariables.set( + "payment_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.'); -} \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{payment_token}}, as jsonData.customer_payment_methods[0].payment_token is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/PaymentMethods/List payment methods for a Customer/request.json b/postman/collection-dir/stripe/PaymentMethods/List payment methods for a Customer/request.json index 40843aac2a4..6b598069886 100644 --- a/postman/collection-dir/stripe/PaymentMethods/List payment methods for a Customer/request.json +++ b/postman/collection-dir/stripe/PaymentMethods/List payment methods for a Customer/request.json @@ -8,14 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/customers/:customer_id/payment_methods", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "customers", - ":customer_id", - "payment_methods" - ], + "host": ["{{baseUrl}}"], + "path": ["customers", ":customer_id", "payment_methods"], "query": [ { "key": "accepted_country", diff --git a/postman/collection-dir/stripe/PaymentMethods/List payment methods for a Merchant/.event.meta.json b/postman/collection-dir/stripe/PaymentMethods/List payment methods for a Merchant/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/PaymentMethods/List payment methods for a Merchant/.event.meta.json +++ b/postman/collection-dir/stripe/PaymentMethods/List payment methods for a Merchant/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/PaymentMethods/List payment methods for a Merchant/event.test.js b/postman/collection-dir/stripe/PaymentMethods/List payment methods for a Merchant/event.test.js index 36ecedc4476..262b38449b3 100644 --- a/postman/collection-dir/stripe/PaymentMethods/List payment methods for a Merchant/event.test.js +++ b/postman/collection-dir/stripe/PaymentMethods/List payment methods for a Merchant/event.test.js @@ -1,10 +1,17 @@ -// Validate status 2xx -pm.test("[GET]::/payment_methods/:merchant_id - Status code is 2xx", function () { - pm.response.to.be.success; -}); +// Validate status 2xx +pm.test( + "[GET]::/payment_methods/:merchant_id - Status code is 2xx", + function () { + pm.response.to.be.success; + }, +); // Validate if response header has matching content-type -pm.test("[GET]::/payment_methods/:merchant_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); - +pm.test( + "[GET]::/payment_methods/:merchant_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); diff --git a/postman/collection-dir/stripe/PaymentMethods/List payment methods for a Merchant/request.json b/postman/collection-dir/stripe/PaymentMethods/List payment methods for a Merchant/request.json index bc72009ae2e..dfe421f512f 100644 --- a/postman/collection-dir/stripe/PaymentMethods/List payment methods for a Merchant/request.json +++ b/postman/collection-dir/stripe/PaymentMethods/List payment methods for a Merchant/request.json @@ -28,13 +28,8 @@ ], "url": { "raw": "{{baseUrl}}/account/payment_methods?client_secret={{client_secret}}", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - "payment_methods" - ], + "host": ["{{baseUrl}}"], + "path": ["account", "payment_methods"], "query": [ { "key": "client_secret", diff --git a/postman/collection-dir/stripe/PaymentMethods/PaymentMethods - Create/.event.meta.json b/postman/collection-dir/stripe/PaymentMethods/PaymentMethods - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/PaymentMethods/PaymentMethods - Create/.event.meta.json +++ b/postman/collection-dir/stripe/PaymentMethods/PaymentMethods - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/PaymentMethods/PaymentMethods - Create/event.test.js b/postman/collection-dir/stripe/PaymentMethods/PaymentMethods - Create/event.test.js index 874935af238..db811e5eb01 100644 --- a/postman/collection-dir/stripe/PaymentMethods/PaymentMethods - Create/event.test.js +++ b/postman/collection-dir/stripe/PaymentMethods/PaymentMethods - Create/event.test.js @@ -1,29 +1,45 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payment_methods - 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]::/payment_methods - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); - +pm.test( + "[POST]::/payment_methods - 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_method_id as variable for jsonData.payment_method_id if (jsonData?.payment_method_id) { - pm.collectionVariables.set("payment_method_id", jsonData.payment_method_id); - console.log("- use {{payment_method_id}} as collection variable for value",jsonData.payment_method_id); + pm.collectionVariables.set("payment_method_id", jsonData.payment_method_id); + console.log( + "- use {{payment_method_id}} as collection variable for value", + jsonData.payment_method_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_method_id}}, as jsonData.payment_method_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_method_id}}, as jsonData.payment_method_id is undefined.", + ); +} if (jsonData?.customer_id) { - pm.collectionVariables.set("customer_id", jsonData.customer_id); - console.log("- use {{customer_id}} as collection variable for value",jsonData.customer_id); + pm.collectionVariables.set("customer_id", jsonData.customer_id); + console.log( + "- use {{customer_id}} as collection variable for value", + jsonData.customer_id, + ); } else { - console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/PaymentMethods/PaymentMethods - Create/request.json b/postman/collection-dir/stripe/PaymentMethods/PaymentMethods - Create/request.json index 1cd306ef554..f9126f5e2e4 100644 --- a/postman/collection-dir/stripe/PaymentMethods/PaymentMethods - Create/request.json +++ b/postman/collection-dir/stripe/PaymentMethods/PaymentMethods - Create/request.json @@ -36,12 +36,8 @@ }, "url": { "raw": "{{baseUrl}}/payment_methods", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payment_methods" - ] + "host": ["{{baseUrl}}"], + "path": ["payment_methods"] }, "description": "To create a payment method against a customer object. In case of cards, this API could be used only by PCI compliant merchants" } diff --git a/postman/collection-dir/stripe/PaymentMethods/Payments - Create/.event.meta.json b/postman/collection-dir/stripe/PaymentMethods/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/PaymentMethods/Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/PaymentMethods/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/PaymentMethods/Payments - Create/event.test.js b/postman/collection-dir/stripe/PaymentMethods/Payments - Create/event.test.js index 5c88ff02531..aac7a8add21 100644 --- a/postman/collection-dir/stripe/PaymentMethods/Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/PaymentMethods/Payments - Create/event.test.js @@ -1,50 +1,73 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} if (jsonData?.customer_id) { - pm.collectionVariables.set("customer_id", jsonData.customer_id); - console.log("- use {{customer_id}} as collection variable for value",jsonData.customer_id); + pm.collectionVariables.set("customer_id", jsonData.customer_id); + console.log( + "- use {{customer_id}} as collection variable for value", + jsonData.customer_id, + ); } else { - console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/PaymentMethods/Payments - Create/request.json b/postman/collection-dir/stripe/PaymentMethods/Payments - Create/request.json index 3a060f629d0..ac22dac750c 100644 --- a/postman/collection-dir/stripe/PaymentMethods/Payments - Create/request.json +++ b/postman/collection-dir/stripe/PaymentMethods/Payments - Create/request.json @@ -93,12 +93,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Payments/.meta.json b/postman/collection-dir/stripe/Payments/.meta.json index a0a4e515e53..025c7bf7939 100644 --- a/postman/collection-dir/stripe/Payments/.meta.json +++ b/postman/collection-dir/stripe/Payments/.meta.json @@ -4,9 +4,11 @@ "Session Token", "Payments - Update", "Payments - Retrieve", - "Payments - Confirm", + "Payments - Confirm (Through Client Secret)", "Payments - Capture", "Payments - Create Again", + "Payments - Confirm Again (Through API Key)", + "Payments - Create Yet Again", "Payments - Cancel", "Payment-List" ], diff --git a/postman/collection-dir/stripe/Payments/Payment-List/.event.meta.json b/postman/collection-dir/stripe/Payments/Payment-List/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Payments/Payment-List/.event.meta.json +++ b/postman/collection-dir/stripe/Payments/Payment-List/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Payments/Payment-List/event.test.js b/postman/collection-dir/stripe/Payments/Payment-List/event.test.js index b47c080f1a3..9bb828db9eb 100644 --- a/postman/collection-dir/stripe/Payments/Payment-List/event.test.js +++ b/postman/collection-dir/stripe/Payments/Payment-List/event.test.js @@ -1,9 +1,14 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/list - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[GET]::/payments/list - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); \ No newline at end of file +pm.test( + "[GET]::/payments/list - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); diff --git a/postman/collection-dir/stripe/Payments/Payment-List/request.json b/postman/collection-dir/stripe/Payments/Payment-List/request.json index 75f7e7df97b..a190f6de393 100644 --- a/postman/collection-dir/stripe/Payments/Payment-List/request.json +++ b/postman/collection-dir/stripe/Payments/Payment-List/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/list", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - "list" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", "list"], "query": [ { "key": "customer_id", diff --git a/postman/collection-dir/stripe/Payments/Payments - Cancel/.event.meta.json b/postman/collection-dir/stripe/Payments/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Payments/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/stripe/Payments/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Payments/Payments - Cancel/event.test.js b/postman/collection-dir/stripe/Payments/Payments - Cancel/event.test.js index 7216e47333a..55ce161f4f6 100644 --- a/postman/collection-dir/stripe/Payments/Payments - Cancel/event.test.js +++ b/postman/collection-dir/stripe/Payments/Payments - Cancel/event.test.js @@ -1,16 +1,19 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/cancel - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/cancel - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/cancel - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - - diff --git a/postman/collection-dir/stripe/Payments/Payments - Cancel/request.json b/postman/collection-dir/stripe/Payments/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/stripe/Payments/Payments - Cancel/request.json +++ b/postman/collection-dir/stripe/Payments/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/Payments/Payments - Capture/.event.meta.json b/postman/collection-dir/stripe/Payments/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Payments/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/stripe/Payments/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Payments/Payments - Capture/event.test.js b/postman/collection-dir/stripe/Payments/Payments - Capture/event.test.js index 193e6ef45e6..98d40ad2eff 100644 --- a/postman/collection-dir/stripe/Payments/Payments - Capture/event.test.js +++ b/postman/collection-dir/stripe/Payments/Payments - Capture/event.test.js @@ -1,45 +1,64 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/capture - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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.", + ); +} diff --git a/postman/collection-dir/stripe/Payments/Payments - Capture/request.json b/postman/collection-dir/stripe/Payments/Payments - Capture/request.json index 8efb99d3c90..cceb2b55f0a 100644 --- a/postman/collection-dir/stripe/Payments/Payments - Capture/request.json +++ b/postman/collection-dir/stripe/Payments/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/Payments/Payments - Confirm (Through Client Secret)/.event.meta.json b/postman/collection-dir/stripe/Payments/Payments - Confirm (Through Client Secret)/.event.meta.json new file mode 100644 index 00000000000..220b1a6723d --- /dev/null +++ b/postman/collection-dir/stripe/Payments/Payments - Confirm (Through Client Secret)/.event.meta.json @@ -0,0 +1,3 @@ +{ + "eventOrder": ["event.test.js", "event.prerequest.js"] +} diff --git a/postman/collection-dir/stripe/Payments/Payments - Confirm (Through Client Secret)/event.prerequest.js b/postman/collection-dir/stripe/Payments/Payments - Confirm (Through Client Secret)/event.prerequest.js new file mode 100644 index 00000000000..e69de29bb2d diff --git a/postman/collection-dir/stripe/Payments/Payments - Confirm (Through Client Secret)/event.test.js b/postman/collection-dir/stripe/Payments/Payments - Confirm (Through Client Secret)/event.test.js new file mode 100644 index 00000000000..aa33b02d173 --- /dev/null +++ b/postman/collection-dir/stripe/Payments/Payments - Confirm (Through Client Secret)/event.test.js @@ -0,0 +1,64 @@ +// 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.", + ); +} diff --git a/postman/collection-dir/stripe/Payments/Payments - Confirm (Through Client Secret)/request.json b/postman/collection-dir/stripe/Payments/Payments - Confirm (Through Client Secret)/request.json new file mode 100644 index 00000000000..ec45ef29bb6 --- /dev/null +++ b/postman/collection-dir/stripe/Payments/Payments - Confirm (Through Client Secret)/request.json @@ -0,0 +1,57 @@ +{ + "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_json_formatted": { + "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" +} diff --git a/postman/collection-dir/stripe/Payments/Payments - Confirm/response.json b/postman/collection-dir/stripe/Payments/Payments - Confirm (Through Client Secret)/response.json similarity index 100% rename from postman/collection-dir/stripe/Payments/Payments - Confirm/response.json rename to postman/collection-dir/stripe/Payments/Payments - Confirm (Through Client Secret)/response.json diff --git a/postman/collection-dir/stripe/Payments/Payments - Confirm Again (Through API Key)/.event.meta.json b/postman/collection-dir/stripe/Payments/Payments - Confirm Again (Through API Key)/.event.meta.json new file mode 100644 index 00000000000..0731450e6b2 --- /dev/null +++ b/postman/collection-dir/stripe/Payments/Payments - Confirm Again (Through API Key)/.event.meta.json @@ -0,0 +1,3 @@ +{ + "eventOrder": ["event.test.js"] +} diff --git a/postman/collection-dir/stripe/Payments/Payments - Confirm Again (Through API Key)/event.test.js b/postman/collection-dir/stripe/Payments/Payments - Confirm Again (Through API Key)/event.test.js new file mode 100644 index 00000000000..2f73fead95a --- /dev/null +++ b/postman/collection-dir/stripe/Payments/Payments - Confirm Again (Through API Key)/event.test.js @@ -0,0 +1,83 @@ +// 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"); + }, + ); +} + +// 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; + }, +); diff --git a/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/stripe/Payments/Payments - Confirm Again (Through API Key)/request.json similarity index 88% rename from postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json rename to postman/collection-dir/stripe/Payments/Payments - Confirm Again (Through API Key)/request.json index 17048792420..6dc6286e21e 100644 --- a/postman/collection-dir/mollie/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/stripe/Payments/Payments - Confirm Again (Through API Key)/request.json @@ -21,14 +21,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/Payments/Payments - Confirm Again (Through API Key)/response.json b/postman/collection-dir/stripe/Payments/Payments - Confirm Again (Through API Key)/response.json new file mode 100644 index 00000000000..fe51488c706 --- /dev/null +++ b/postman/collection-dir/stripe/Payments/Payments - Confirm Again (Through API Key)/response.json @@ -0,0 +1 @@ +[] diff --git a/postman/collection-dir/stripe/Payments/Payments - Confirm/.event.meta.json b/postman/collection-dir/stripe/Payments/Payments - Confirm/.event.meta.json deleted file mode 100644 index 688c85746ef..00000000000 --- a/postman/collection-dir/stripe/Payments/Payments - Confirm/.event.meta.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "eventOrder": [ - "event.test.js" - ] -} diff --git a/postman/collection-dir/stripe/Payments/Payments - Confirm/event.test.js b/postman/collection-dir/stripe/Payments/Payments - Confirm/event.test.js deleted file mode 100644 index 48bdfd0c8c9..00000000000 --- a/postman/collection-dir/stripe/Payments/Payments - Confirm/event.test.js +++ /dev/null @@ -1,46 +0,0 @@ -// 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.'); -}; \ No newline at end of file diff --git a/postman/collection-dir/stripe/Payments/Payments - Confirm/request.json b/postman/collection-dir/stripe/Payments/Payments - Confirm/request.json deleted file mode 100644 index 17048792420..00000000000 --- a/postman/collection-dir/stripe/Payments/Payments - Confirm/request.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "options": { - "raw": { - "language": "json" - } - }, - "raw_json_formatted": {} - }, - "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" -} diff --git a/postman/collection-dir/stripe/Payments/Payments - Create Again/.event.meta.json b/postman/collection-dir/stripe/Payments/Payments - Create Again/.event.meta.json index 688c85746ef..220b1a6723d 100644 --- a/postman/collection-dir/stripe/Payments/Payments - Create Again/.event.meta.json +++ b/postman/collection-dir/stripe/Payments/Payments - Create Again/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/stripe/Payments/Payments - Create Again/event.prerequest.js b/postman/collection-dir/stripe/Payments/Payments - Create Again/event.prerequest.js new file mode 100644 index 00000000000..e69de29bb2d diff --git a/postman/collection-dir/stripe/Payments/Payments - Create Again/event.test.js b/postman/collection-dir/stripe/Payments/Payments - Create Again/event.test.js index 007eb135e85..a6947db94c0 100644 --- a/postman/collection-dir/stripe/Payments/Payments - Create Again/event.test.js +++ b/postman/collection-dir/stripe/Payments/Payments - Create Again/event.test.js @@ -1,43 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/Payments/Payments - Create Again/request.json b/postman/collection-dir/stripe/Payments/Payments - Create Again/request.json index 6f9dd5d2615..5185b04c18e 100644 --- a/postman/collection-dir/stripe/Payments/Payments - Create Again/request.json +++ b/postman/collection-dir/stripe/Payments/Payments - Create Again/request.json @@ -20,8 +20,8 @@ "raw_json_formatted": { "amount": 6540, "currency": "USD", - "confirm": true, - "capture_method": "manual", + "confirm": false, + "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 6540, "customer_id": "StripeCustomer", @@ -92,12 +92,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Payments/Payments - Create Yet Again/.event.meta.json b/postman/collection-dir/stripe/Payments/Payments - Create Yet Again/.event.meta.json new file mode 100644 index 00000000000..0731450e6b2 --- /dev/null +++ b/postman/collection-dir/stripe/Payments/Payments - Create Yet Again/.event.meta.json @@ -0,0 +1,3 @@ +{ + "eventOrder": ["event.test.js"] +} diff --git a/postman/collection-dir/stripe/Payments/Payments - Create Yet Again/event.test.js b/postman/collection-dir/stripe/Payments/Payments - Create Yet Again/event.test.js new file mode 100644 index 00000000000..a6947db94c0 --- /dev/null +++ b/postman/collection-dir/stripe/Payments/Payments - Create Yet Again/event.test.js @@ -0,0 +1,61 @@ +// 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.", + ); +} diff --git a/postman/collection-dir/stripe/Payments/Payments - Create Yet Again/request.json b/postman/collection-dir/stripe/Payments/Payments - Create Yet Again/request.json new file mode 100644 index 00000000000..a7304c0a2fb --- /dev/null +++ b/postman/collection-dir/stripe/Payments/Payments - Create Yet Again/request.json @@ -0,0 +1,99 @@ +{ + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "options": { + "raw": { + "language": "json" + } + }, + "raw_json_formatted": { + "amount": 6540, + "currency": "USD", + "confirm": true, + "capture_method": "manual", + "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", + "payment_method": "card", + "payment_method_type": "credit", + "payment_method_data": { + "card": { + "card_number": "4242424242424242", + "card_exp_month": "10", + "card_exp_year": "25", + "card_holder_name": "joseph Doe", + "card_cvc": "123" + } + }, + "billing": { + "address": { + "line1": "1467", + "line2": "Harrison Street", + "line3": "Harrison Street", + "city": "San Fransico", + "state": "California", + "zip": "94122", + "country": "US", + "first_name": "joseph", + "last_name": "Doe" + }, + "phone": { + "number": "8056594427", + "country_code": "+91" + } + }, + "shipping": { + "address": { + "line1": "1467", + "line2": "Harrison Street", + "line3": "Harrison Street", + "city": "San Fransico", + "state": "California", + "zip": "94122", + "country": "US", + "first_name": "joseph", + "last_name": "Doe" + }, + "phone": { + "number": "8056594427", + "country_code": "+91" + } + }, + "statement_descriptor_name": "joseph", + "statement_descriptor_suffix": "JS", + "metadata": { + "udf1": "value1", + "new_customer": "true", + "login_date": "2019-09-10T10:11:12Z" + }, + "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" +} diff --git a/postman/collection-dir/stripe/Payments/Payments - Create Yet Again/response.json b/postman/collection-dir/stripe/Payments/Payments - Create Yet Again/response.json new file mode 100644 index 00000000000..fe51488c706 --- /dev/null +++ b/postman/collection-dir/stripe/Payments/Payments - Create Yet Again/response.json @@ -0,0 +1 @@ +[] diff --git a/postman/collection-dir/stripe/Payments/Payments - Create/.event.meta.json b/postman/collection-dir/stripe/Payments/Payments - Create/.event.meta.json index 688c85746ef..220b1a6723d 100644 --- a/postman/collection-dir/stripe/Payments/Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Payments/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/stripe/Payments/Payments - Create/event.prerequest.js b/postman/collection-dir/stripe/Payments/Payments - Create/event.prerequest.js new file mode 100644 index 00000000000..e69de29bb2d diff --git a/postman/collection-dir/stripe/Payments/Payments - Create/event.test.js b/postman/collection-dir/stripe/Payments/Payments - Create/event.test.js index 007eb135e85..a6947db94c0 100644 --- a/postman/collection-dir/stripe/Payments/Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/Payments/Payments - Create/event.test.js @@ -1,43 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/Payments/Payments - Create/request.json b/postman/collection-dir/stripe/Payments/Payments - Create/request.json index 9fd202f473d..0b0e2569f1d 100644 --- a/postman/collection-dir/stripe/Payments/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Payments/Payments - Create/request.json @@ -92,12 +92,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Payments/Payments - Retrieve/.event.meta.json b/postman/collection-dir/stripe/Payments/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Payments/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/stripe/Payments/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Payments/Payments - Retrieve/event.test.js b/postman/collection-dir/stripe/Payments/Payments - Retrieve/event.test.js index 9682fa7eaca..0a8d91f45ff 100644 --- a/postman/collection-dir/stripe/Payments/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/stripe/Payments/Payments - Retrieve/event.test.js @@ -1,43 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/Payments/Payments - Retrieve/request.json b/postman/collection-dir/stripe/Payments/Payments - Retrieve/request.json index c71774083b2..ef0b213739d 100644 --- a/postman/collection-dir/stripe/Payments/Payments - Retrieve/request.json +++ b/postman/collection-dir/stripe/Payments/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/Payments/Payments - Update/.event.meta.json b/postman/collection-dir/stripe/Payments/Payments - Update/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Payments/Payments - Update/.event.meta.json +++ b/postman/collection-dir/stripe/Payments/Payments - Update/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Payments/Payments - Update/event.test.js b/postman/collection-dir/stripe/Payments/Payments - Update/event.test.js index e6041914348..0318f72c621 100644 --- a/postman/collection-dir/stripe/Payments/Payments - Update/event.test.js +++ b/postman/collection-dir/stripe/Payments/Payments - Update/event.test.js @@ -1,45 +1,64 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} - +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/Payments/Payments - Update/request.json b/postman/collection-dir/stripe/Payments/Payments - Update/request.json index e3b955f3bee..09e3dbb307e 100644 --- a/postman/collection-dir/stripe/Payments/Payments - Update/request.json +++ b/postman/collection-dir/stripe/Payments/Payments - Update/request.json @@ -74,13 +74,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/Payments/Session Token/.event.meta.json b/postman/collection-dir/stripe/Payments/Session Token/.event.meta.json index 688c85746ef..220b1a6723d 100644 --- a/postman/collection-dir/stripe/Payments/Session Token/.event.meta.json +++ b/postman/collection-dir/stripe/Payments/Session Token/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/stripe/Payments/Session Token/event.prerequest.js b/postman/collection-dir/stripe/Payments/Session Token/event.prerequest.js new file mode 100644 index 00000000000..e69de29bb2d diff --git a/postman/collection-dir/stripe/Payments/Session Token/event.test.js b/postman/collection-dir/stripe/Payments/Session Token/event.test.js index 5b9d1ebd1c7..ae591f10cd0 100644 --- a/postman/collection-dir/stripe/Payments/Session Token/event.test.js +++ b/postman/collection-dir/stripe/Payments/Session Token/event.test.js @@ -1,21 +1,32 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/session_tokens - 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/session_tokens - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/session_tokens - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); const responseJson = pm.response.json(); // Verify if the wallet_name in the response matches 'apple_pay' -pm.test("[POST]::/payments/session_tokens - Verify wallet_name is 'apple_pay'", function() { +pm.test( + "[POST]::/payments/session_tokens - Verify wallet_name is 'apple_pay'", + function () { pm.expect(responseJson.session_token[0].wallet_name).to.eql("apple_pay"); -}); + }, +); // Verify if the wallet_name in the response matches 'google_pay' -pm.test("[POST]::/payments/session_tokens - Verify wallet_name is 'google_pay'", function() { +pm.test( + "[POST]::/payments/session_tokens - Verify wallet_name is 'google_pay'", + function () { pm.expect(responseJson.session_token[1].wallet_name).to.eql("google_pay"); -}); \ No newline at end of file + }, +); diff --git a/postman/collection-dir/stripe/Payments/Session Token/request.json b/postman/collection-dir/stripe/Payments/Session Token/request.json index a07a04f4a67..e372f629aa8 100644 --- a/postman/collection-dir/stripe/Payments/Session Token/request.json +++ b/postman/collection-dir/stripe/Payments/Session Token/request.json @@ -31,12 +31,7 @@ }, "url": { "raw": "{{baseUrl}}/payments/session_tokens", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - "session_tokens" - ] + "host": ["{{baseUrl}}"], + "path": ["payments", "session_tokens"] } } diff --git a/postman/collection-dir/stripe/QuickStart/API Key - Create/.event.meta.json b/postman/collection-dir/stripe/QuickStart/API Key - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/QuickStart/API Key - Create/.event.meta.json +++ b/postman/collection-dir/stripe/QuickStart/API Key - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/QuickStart/API Key - Create/event.test.js b/postman/collection-dir/stripe/QuickStart/API Key - Create/event.test.js index bc42e83a761..4e27c5a5025 100644 --- a/postman/collection-dir/stripe/QuickStart/API Key - Create/event.test.js +++ b/postman/collection-dir/stripe/QuickStart/API Key - Create/event.test.js @@ -1,32 +1,46 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/api_keys/:merchant_id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/api_keys/:merchant_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/api_keys/:merchant_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; try { jsonData = pm.response.json(); -} catch(e) { -} +} catch (e) {} // pm.collectionVariables - Set api_key_id as variable for jsonData.key_id if (jsonData?.key_id) { - pm.collectionVariables.set("api_key_id", jsonData.key_id); - console.log("- use {{api_key_id}} as collection variable for value", jsonData.key_id); + pm.collectionVariables.set("api_key_id", jsonData.key_id); + console.log( + "- use {{api_key_id}} as collection variable for value", + jsonData.key_id, + ); } else { - console.log('INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value", jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/QuickStart/API Key - Create/request.json b/postman/collection-dir/stripe/QuickStart/API Key - Create/request.json index 29c2490d1bc..2210d14da0e 100644 --- a/postman/collection-dir/stripe/QuickStart/API Key - Create/request.json +++ b/postman/collection-dir/stripe/QuickStart/API Key - Create/request.json @@ -35,13 +35,8 @@ }, "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/stripe/QuickStart/Merchant Account - Create/.event.meta.json b/postman/collection-dir/stripe/QuickStart/Merchant Account - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/QuickStart/Merchant Account - Create/.event.meta.json +++ b/postman/collection-dir/stripe/QuickStart/Merchant Account - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/QuickStart/Merchant Account - Create/event.test.js b/postman/collection-dir/stripe/QuickStart/Merchant Account - Create/event.test.js index 6f4316a9078..70f5e50bbde 100644 --- a/postman/collection-dir/stripe/QuickStart/Merchant Account - Create/event.test.js +++ b/postman/collection-dir/stripe/QuickStart/Merchant Account - Create/event.test.js @@ -1,24 +1,33 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - 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]::/accounts - 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", + ); }); // 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 merchant_id as variable for jsonData.merchant_id if (jsonData?.merchant_id) { - pm.collectionVariables.set("merchant_id", jsonData.merchant_id); - console.log("- use {{merchant_id}} as collection variable for value",jsonData.merchant_id); + pm.collectionVariables.set("merchant_id", jsonData.merchant_id); + console.log( + "- use {{merchant_id}} as collection variable for value", + jsonData.merchant_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.", + ); +} /* // pm.collectionVariables - Set api_key as variable for jsonData.api_key @@ -32,8 +41,13 @@ if (jsonData?.api_key) { // pm.collectionVariables - Set publishable_key as variable for jsonData.publishable_key if (jsonData?.publishable_key) { - pm.collectionVariables.set("publishable_key", jsonData.publishable_key); - console.log("- use {{publishable_key}} as collection variable for value",jsonData.publishable_key); + pm.collectionVariables.set("publishable_key", jsonData.publishable_key); + console.log( + "- use {{publishable_key}} as collection variable for value", + jsonData.publishable_key, + ); } else { - console.log('INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/QuickStart/Merchant Account - Create/request.json b/postman/collection-dir/stripe/QuickStart/Merchant Account - Create/request.json index 5313e3e6b48..e0be5a59e72 100644 --- a/postman/collection-dir/stripe/QuickStart/Merchant Account - Create/request.json +++ b/postman/collection-dir/stripe/QuickStart/Merchant Account - Create/request.json @@ -84,12 +84,8 @@ }, "url": { "raw": "{{baseUrl}}/accounts", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "accounts" - ] + "host": ["{{baseUrl}}"], + "path": ["accounts"] }, "description": "Create a new account for a merchant. The merchant could be a seller or retailer or client who likes to receive and send payments." } diff --git a/postman/collection-dir/stripe/QuickStart/Payment Connector - Create/.event.meta.json b/postman/collection-dir/stripe/QuickStart/Payment Connector - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/QuickStart/Payment Connector - Create/.event.meta.json +++ b/postman/collection-dir/stripe/QuickStart/Payment Connector - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/QuickStart/Payment Connector - Create/event.test.js b/postman/collection-dir/stripe/QuickStart/Payment Connector - Create/event.test.js index b831702461e..88e92d8d84a 100644 --- a/postman/collection-dir/stripe/QuickStart/Payment Connector - Create/event.test.js +++ b/postman/collection-dir/stripe/QuickStart/Payment Connector - Create/event.test.js @@ -1,21 +1,39 @@ -// Validate status 2xx -pm.test("[POST]::/account/:account_id/connectors - 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.be.success; + }, +); // Validate if response header has matching content-type -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"); -}); +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){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id if (jsonData?.merchant_connector_id) { - pm.collectionVariables.set("merchant_connector_id", jsonData.merchant_connector_id); - console.log("- use {{merchant_connector_id}} as collection variable for value",jsonData.merchant_connector_id); + pm.collectionVariables.set( + "merchant_connector_id", + jsonData.merchant_connector_id, + ); + console.log( + "- use {{merchant_connector_id}} as collection variable for value", + jsonData.merchant_connector_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/QuickStart/Payment Connector - Create/request.json b/postman/collection-dir/stripe/QuickStart/Payment Connector - Create/request.json index c93ca591d38..ff1f8084a8d 100644 --- a/postman/collection-dir/stripe/QuickStart/Payment Connector - Create/request.json +++ b/postman/collection-dir/stripe/QuickStart/Payment Connector - Create/request.json @@ -259,10 +259,7 @@ { "type": "CARD", "parameters": { - "allowed_auth_methods": [ - "PAN_ONLY", - "CRYPTOGRAM_3DS" - ], + "allowed_auth_methods": ["PAN_ONLY", "CRYPTOGRAM_3DS"], "allowed_card_networks": [ "AMEX", "DISCOVER", @@ -296,15 +293,8 @@ }, "payment_request_data": { "label": "applepay pvt.ltd", - "supported_networks": [ - "visa", - "masterCard", - "amex", - "discover" - ], - "merchant_capabilities": [ - "supports3DS" - ] + "supported_networks": ["visa", "masterCard", "amex", "discover"], + "merchant_capabilities": ["supports3DS"] } } } @@ -312,14 +302,8 @@ }, "url": { "raw": "{{baseUrl}}/account/:account_id/connectors", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/stripe/QuickStart/Payments - Create/.event.meta.json b/postman/collection-dir/stripe/QuickStart/Payments - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/stripe/QuickStart/Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/QuickStart/Payments - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/stripe/QuickStart/Payments - Create/event.test.js b/postman/collection-dir/stripe/QuickStart/Payments - Create/event.test.js index 62142d52dca..a6947db94c0 100644 --- a/postman/collection-dir/stripe/QuickStart/Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/QuickStart/Payments - Create/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/QuickStart/Payments - Create/request.json b/postman/collection-dir/stripe/QuickStart/Payments - Create/request.json index da1e0039c81..e149698461e 100644 --- a/postman/collection-dir/stripe/QuickStart/Payments - Create/request.json +++ b/postman/collection-dir/stripe/QuickStart/Payments - Create/request.json @@ -92,12 +92,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/QuickStart/Payments - Retrieve/.event.meta.json b/postman/collection-dir/stripe/QuickStart/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/QuickStart/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/stripe/QuickStart/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/QuickStart/Payments - Retrieve/event.test.js b/postman/collection-dir/stripe/QuickStart/Payments - Retrieve/event.test.js index 4dd072b2222..d0a02af7436 100644 --- a/postman/collection-dir/stripe/QuickStart/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/stripe/QuickStart/Payments - Retrieve/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // 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.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/QuickStart/Payments - Retrieve/request.json b/postman/collection-dir/stripe/QuickStart/Payments - Retrieve/request.json index c71774083b2..ef0b213739d 100644 --- a/postman/collection-dir/stripe/QuickStart/Payments - Retrieve/request.json +++ b/postman/collection-dir/stripe/QuickStart/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/QuickStart/Refunds - Create/.event.meta.json b/postman/collection-dir/stripe/QuickStart/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/QuickStart/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/stripe/QuickStart/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/QuickStart/Refunds - Create/event.test.js b/postman/collection-dir/stripe/QuickStart/Refunds - Create/event.test.js index c862e8e68a7..dbc930608cb 100644 --- a/postman/collection-dir/stripe/QuickStart/Refunds - Create/event.test.js +++ b/postman/collection-dir/stripe/QuickStart/Refunds - Create/event.test.js @@ -1,21 +1,30 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/QuickStart/Refunds - Create/request.json b/postman/collection-dir/stripe/QuickStart/Refunds - Create/request.json index 4dbca4d01f2..0c13281ee15 100644 --- a/postman/collection-dir/stripe/QuickStart/Refunds - Create/request.json +++ b/postman/collection-dir/stripe/QuickStart/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/stripe/QuickStart/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/stripe/QuickStart/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/QuickStart/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/stripe/QuickStart/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/QuickStart/Refunds - Retrieve/event.test.js b/postman/collection-dir/stripe/QuickStart/Refunds - Retrieve/event.test.js index b1e1f12ba50..bbd8e544e2c 100644 --- a/postman/collection-dir/stripe/QuickStart/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/stripe/QuickStart/Refunds - Retrieve/event.test.js @@ -1,22 +1,30 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); - // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/QuickStart/Refunds - Retrieve/request.json b/postman/collection-dir/stripe/QuickStart/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/stripe/QuickStart/Refunds - Retrieve/request.json +++ b/postman/collection-dir/stripe/QuickStart/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/Refunds/Payments - Create/.event.meta.json b/postman/collection-dir/stripe/Refunds/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Refunds/Payments - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Refunds/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Refunds/Payments - Create/event.test.js b/postman/collection-dir/stripe/Refunds/Payments - Create/event.test.js index 007eb135e85..a6947db94c0 100644 --- a/postman/collection-dir/stripe/Refunds/Payments - Create/event.test.js +++ b/postman/collection-dir/stripe/Refunds/Payments - Create/event.test.js @@ -1,43 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/Refunds/Payments - Create/request.json b/postman/collection-dir/stripe/Refunds/Payments - Create/request.json index d964f30fcbe..482cd7e25e4 100644 --- a/postman/collection-dir/stripe/Refunds/Payments - Create/request.json +++ b/postman/collection-dir/stripe/Refunds/Payments - Create/request.json @@ -93,12 +93,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/stripe/Refunds/Refunds - Create/.event.meta.json b/postman/collection-dir/stripe/Refunds/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Refunds/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/stripe/Refunds/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Refunds/Refunds - Create/event.test.js b/postman/collection-dir/stripe/Refunds/Refunds - Create/event.test.js index c862e8e68a7..dbc930608cb 100644 --- a/postman/collection-dir/stripe/Refunds/Refunds - Create/event.test.js +++ b/postman/collection-dir/stripe/Refunds/Refunds - Create/event.test.js @@ -1,21 +1,30 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/Refunds/Refunds - Create/request.json b/postman/collection-dir/stripe/Refunds/Refunds - Create/request.json index 4dbca4d01f2..0c13281ee15 100644 --- a/postman/collection-dir/stripe/Refunds/Refunds - Create/request.json +++ b/postman/collection-dir/stripe/Refunds/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/stripe/Refunds/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/stripe/Refunds/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Refunds/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/stripe/Refunds/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Refunds/Refunds - Retrieve/event.test.js b/postman/collection-dir/stripe/Refunds/Refunds - Retrieve/event.test.js index 8815f33f244..bbd8e544e2c 100644 --- a/postman/collection-dir/stripe/Refunds/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/stripe/Refunds/Refunds - Retrieve/event.test.js @@ -1,21 +1,30 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/Refunds/Refunds - Retrieve/request.json b/postman/collection-dir/stripe/Refunds/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/stripe/Refunds/Refunds - Retrieve/request.json +++ b/postman/collection-dir/stripe/Refunds/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/Refunds/Refunds - Update/.event.meta.json b/postman/collection-dir/stripe/Refunds/Refunds - Update/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/stripe/Refunds/Refunds - Update/.event.meta.json +++ b/postman/collection-dir/stripe/Refunds/Refunds - Update/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/stripe/Refunds/Refunds - Update/event.test.js b/postman/collection-dir/stripe/Refunds/Refunds - Update/event.test.js index a3393fa77d7..26b243a6089 100644 --- a/postman/collection-dir/stripe/Refunds/Refunds - Update/event.test.js +++ b/postman/collection-dir/stripe/Refunds/Refunds - Update/event.test.js @@ -1,22 +1,30 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); - // 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("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.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/stripe/Refunds/Refunds - Update/request.json b/postman/collection-dir/stripe/Refunds/Refunds - Update/request.json index a4c991dc114..8b4c4a97755 100644 --- a/postman/collection-dir/stripe/Refunds/Refunds - Update/request.json +++ b/postman/collection-dir/stripe/Refunds/Refunds - Update/request.json @@ -28,13 +28,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/stripe/event.test.js b/postman/collection-dir/stripe/event.test.js deleted file mode 100644 index f3555826561..00000000000 --- a/postman/collection-dir/stripe/event.test.js +++ /dev/null @@ -1,11 +0,0 @@ -// 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("[LOG]::payment_id - " + jsonData.payment_id); -} - -console.log("[LOG]::x-request-id - " + pm.response.headers.get('x-request-id')); diff --git a/postman/collection-dir/trustpay/.event.meta.json b/postman/collection-dir/trustpay/.event.meta.json index 2df9d47d936..eb871bbcb9b 100644 --- a/postman/collection-dir/trustpay/.event.meta.json +++ b/postman/collection-dir/trustpay/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.prerequest.js", - "event.test.js" - ] + "eventOrder": ["event.prerequest.js", "event.test.js"] } diff --git a/postman/collection-dir/trustpay/.meta.json b/postman/collection-dir/trustpay/.meta.json index 91b6a65c5bc..d513035ce2d 100644 --- a/postman/collection-dir/trustpay/.meta.json +++ b/postman/collection-dir/trustpay/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Health check", - "Flow Testcases" - ] + "childrenOrder": ["Health check", "Flow Testcases"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/.meta.json b/postman/collection-dir/trustpay/Flow Testcases/.meta.json index 1bbce843680..023989e1e49 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/.meta.json @@ -1,7 +1,3 @@ { - "childrenOrder": [ - "QuickStart", - "Happy Cases", - "Variation Cases" - ] + "childrenOrder": ["QuickStart", "Happy Cases", "Variation Cases"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js index 72f142cc731..c48d8e2d054 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json index 4968685339c..e855d68d94a 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json @@ -100,12 +100,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario11-Bank Redirect-giropay/Payments - Confirm/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario11-Bank Redirect-giropay/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario11-Bank Redirect-giropay/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario11-Bank Redirect-giropay/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario11-Bank Redirect-giropay/Payments - Confirm/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario11-Bank Redirect-giropay/Payments - Confirm/event.test.js index ea2731cdcc4..f2050e61fc3 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario11-Bank Redirect-giropay/Payments - Confirm/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario11-Bank Redirect-giropay/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "giropay" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'giropay'", function() { - pm.expect(jsonData.payment_method_type).to.eql("giropay"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'giropay'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("giropay"); + }, + ); +} // Response body should have value "stripe" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'trustpay'", function() { - pm.expect(jsonData.connector).to.eql("trustpay"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'trustpay'", + function () { + pm.expect(jsonData.connector).to.eql("trustpay"); + }, + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario11-Bank Redirect-giropay/Payments - Confirm/request.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario11-Bank Redirect-giropay/Payments - Confirm/request.json index 70123c3aba7..caf10ddd35d 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario11-Bank Redirect-giropay/Payments - Confirm/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario11-Bank Redirect-giropay/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_redirect", "payment_method_type": "giropay", "payment_method_data": { @@ -36,14 +57,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario11-Bank Redirect-giropay/Payments - Create/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario11-Bank Redirect-giropay/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario11-Bank Redirect-giropay/Payments - Create/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario11-Bank Redirect-giropay/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario11-Bank Redirect-giropay/Payments - Create/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario11-Bank Redirect-giropay/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario11-Bank Redirect-giropay/Payments - Create/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario11-Bank Redirect-giropay/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario11-Bank Redirect-giropay/Payments - Create/request.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario11-Bank Redirect-giropay/Payments - Create/request.json index 87d07a6016b..0b0c56d2660 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario11-Bank Redirect-giropay/Payments - Create/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario11-Bank Redirect-giropay/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario11-Bank Redirect-giropay/Payments - Retrieve/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario11-Bank Redirect-giropay/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario11-Bank Redirect-giropay/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario11-Bank Redirect-giropay/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario11-Bank Redirect-giropay/Payments - Retrieve/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario11-Bank Redirect-giropay/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario11-Bank Redirect-giropay/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario11-Bank Redirect-giropay/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario11-Bank Redirect-giropay/Payments - Retrieve/request.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario11-Bank Redirect-giropay/Payments - Retrieve/request.json index 6f4d51c5945..61fcdaec2d2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario11-Bank Redirect-giropay/Payments - Retrieve/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario11-Bank Redirect-giropay/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js index bb50904fd89..f92fba3d044 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json index 2e199785b69..d999cf2d649 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "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", @@ -34,14 +55,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js index 5698484c741..55dc35b9128 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json index 7186bddbe07..119353069bd 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js index 03ccae1adb0..aced67dbfb7 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js index 5d9e5785e6e..6d812bc75fe 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id/confirm - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id/confirm - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json index 128505cc7b2..d30e00868a5 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "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", @@ -44,14 +65,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json index b28abd0c309..e3b1e235042 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json @@ -67,12 +67,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js index 03ccae1adb0..aced67dbfb7 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Create/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Create/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Create/event.test.js index 1388cde7c89..39cbb3ee90e 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Create/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Create/event.test.js @@ -1,54 +1,80 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", function() { - pm.expect(jsonData.status).to.eql("requires_customer_action"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", + function () { + pm.expect(jsonData.status).to.eql("requires_customer_action"); + }, + ); +} // Response body should have "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; -}); +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; + }, +); diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Create/request.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Create/request.json index 052d23a8f12..acab381b5dc 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Create/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Create/request.json @@ -101,12 +101,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Retrieve/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Retrieve/event.test.js index 08ad2d6a233..02ab01502c1 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + 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"); + }, + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Retrieve/request.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Retrieve/request.json index 6f4d51c5945..61fcdaec2d2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Confirm/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Confirm/event.test.js index edf87c9ccdf..1fa0afa6402 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Confirm/event.test.js @@ -1,57 +1,83 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments/:id/confirm - Content check if 'next_action.redirect_to_url' exists", function() { - pm.expect((typeof jsonData.next_action.redirect_to_url !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments/:id/confirm - Content check if 'next_action.redirect_to_url' exists", + function () { + pm.expect(typeof jsonData.next_action.redirect_to_url !== "undefined").to.be + .true; + }, +); diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Confirm/request.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Confirm/request.json index ccfdf513db5..9fef5309c3a 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Confirm/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "return_url": "https://integ.hyperswitch.io/home", "payment_method": "card", "payment_method_data": { @@ -47,14 +68,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Create/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Create/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Create/event.test.js index f495cd783d4..83b8880ddbd 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Create/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Create/request.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Create/request.json index 0eb2d9f30cf..3b4c8f74e7f 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Create/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Create/request.json @@ -78,12 +78,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Retrieve/request.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Retrieve/request.json index 6f4d51c5945..61fcdaec2d2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Payments - Create/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Payments - Create/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Payments - Create/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Payments - Create/request.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Payments - Create/request.json index c3dddef3a2d..94473ddb1ec 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Payments - Create/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Payments - Create/request.json @@ -100,12 +100,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Payments - Retrieve/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Payments - Retrieve/request.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Refunds - Create/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Refunds - Create/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Refunds - Create/event.test.js index 1c34027de1d..f89b9b86fef 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Refunds - Create/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Refunds - Create/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Refunds - Create/request.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Refunds - Create/request.json index 5e306df7a55..5f4c58816d5 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Refunds - Create/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Refunds - Retrieve/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Refunds - Retrieve/event.test.js index 07a9529b82e..6cb4312a60a 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Refunds - Retrieve/event.test.js @@ -1,33 +1,50 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + 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 "6540" for "amount" if (jsonData?.status) { -pm.test("[POST]::/refunds - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); -})}; + pm.test( + "[POST]::/refunds - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Refunds - Retrieve/request.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Refunds - Retrieve/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario6-Refund full payment/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-Ideal/Payments - Confirm/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-Ideal/Payments - Confirm/event.test.js index 980db8750be..5d6e9942026 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-Ideal/Payments - Confirm/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-Ideal/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "ideal" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'ideal'", function() { - pm.expect(jsonData.payment_method_type).to.eql("ideal"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'ideal'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("ideal"); + }, + ); +} // Response body should have value "stripe" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'trustpay'", function() { - pm.expect(jsonData.connector).to.eql("trustpay"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'trustpay'", + function () { + pm.expect(jsonData.connector).to.eql("trustpay"); + }, + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-Ideal/Payments - Confirm/request.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-Ideal/Payments - Confirm/request.json index 6c44ab9d4e0..10b88b51748 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-Ideal/Payments - Confirm/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-Ideal/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_redirect", "payment_method_type": "ideal", "payment_method_data": { @@ -36,14 +57,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-Ideal/Payments - Create/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-Ideal/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-Ideal/Payments - Create/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-Ideal/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-Ideal/Payments - Create/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-Ideal/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-Ideal/Payments - Create/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-Ideal/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-Ideal/Payments - Create/request.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-Ideal/Payments - Create/request.json index 87d07a6016b..0b0c56d2660 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-Ideal/Payments - Create/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-Ideal/Payments - Create/request.json @@ -81,12 +81,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-Ideal/Payments - Retrieve/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-Ideal/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-Ideal/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-Ideal/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-Ideal/Payments - Retrieve/request.json b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-Ideal/Payments - Retrieve/request.json index 6f4d51c5945..61fcdaec2d2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-Ideal/Payments - Retrieve/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Happy Cases/Scenario8-Bank Redirect-Ideal/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/API Key - Create/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/API Key - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/API Key - Create/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/API Key - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/API Key - Create/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/API Key - Create/event.test.js index bc42e83a761..4e27c5a5025 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/API Key - Create/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/API Key - Create/event.test.js @@ -1,32 +1,46 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/api_keys/:merchant_id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/api_keys/:merchant_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/api_keys/:merchant_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; try { jsonData = pm.response.json(); -} catch(e) { -} +} catch (e) {} // pm.collectionVariables - Set api_key_id as variable for jsonData.key_id if (jsonData?.key_id) { - pm.collectionVariables.set("api_key_id", jsonData.key_id); - console.log("- use {{api_key_id}} as collection variable for value", jsonData.key_id); + pm.collectionVariables.set("api_key_id", jsonData.key_id); + console.log( + "- use {{api_key_id}} as collection variable for value", + jsonData.key_id, + ); } else { - console.log('INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value", jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/API Key - Create/request.json b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/API Key - Create/request.json index 29c2490d1bc..2210d14da0e 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/API Key - Create/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/API Key - Create/request.json @@ -35,13 +35,8 @@ }, "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js index 6f4316a9078..70f5e50bbde 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js @@ -1,24 +1,33 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - 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]::/accounts - 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", + ); }); // 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 merchant_id as variable for jsonData.merchant_id if (jsonData?.merchant_id) { - pm.collectionVariables.set("merchant_id", jsonData.merchant_id); - console.log("- use {{merchant_id}} as collection variable for value",jsonData.merchant_id); + pm.collectionVariables.set("merchant_id", jsonData.merchant_id); + console.log( + "- use {{merchant_id}} as collection variable for value", + jsonData.merchant_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.", + ); +} /* // pm.collectionVariables - Set api_key as variable for jsonData.api_key @@ -32,8 +41,13 @@ if (jsonData?.api_key) { // pm.collectionVariables - Set publishable_key as variable for jsonData.publishable_key if (jsonData?.publishable_key) { - pm.collectionVariables.set("publishable_key", jsonData.publishable_key); - console.log("- use {{publishable_key}} as collection variable for value",jsonData.publishable_key); + pm.collectionVariables.set("publishable_key", jsonData.publishable_key); + console.log( + "- use {{publishable_key}} as collection variable for value", + jsonData.publishable_key, + ); } else { - console.log('INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.", + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Merchant Account - Create/request.json b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Merchant Account - Create/request.json index 45a28d21b7c..6e18cb498f5 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Merchant Account - Create/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Merchant Account - Create/request.json @@ -84,12 +84,8 @@ }, "url": { "raw": "{{baseUrl}}/accounts", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "accounts" - ] + "host": ["{{baseUrl}}"], + "path": ["accounts"] }, "description": "Create a new account for a merchant. The merchant could be a seller or retailer or client who likes to receive and send payments." } diff --git a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js index b831702461e..88e92d8d84a 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js @@ -1,21 +1,39 @@ -// Validate status 2xx -pm.test("[POST]::/account/:account_id/connectors - 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.be.success; + }, +); // Validate if response header has matching content-type -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"); -}); +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){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id if (jsonData?.merchant_connector_id) { - pm.collectionVariables.set("merchant_connector_id", jsonData.merchant_connector_id); - console.log("- use {{merchant_connector_id}} as collection variable for value",jsonData.merchant_connector_id); + pm.collectionVariables.set( + "merchant_connector_id", + jsonData.merchant_connector_id, + ); + console.log( + "- use {{merchant_connector_id}} as collection variable for value", + jsonData.merchant_connector_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.", + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payment Connector - Create/request.json b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payment Connector - Create/request.json index 8dd2eaf24be..b6c15ab9af2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payment Connector - Create/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payment Connector - Create/request.json @@ -142,14 +142,8 @@ }, "url": { "raw": "{{baseUrl}}/account/:account_id/connectors", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payments - Create/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payments - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payments - Create/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payments - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payments - Create/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payments - Create/event.test.js index 62142d52dca..a6947db94c0 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payments - Create/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payments - Create/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payments - Create/request.json b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payments - Create/request.json index 0e40d5e74fd..2c81f99e7e7 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payments - Create/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payments - Create/request.json @@ -100,12 +100,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js index 4dd072b2222..d0a02af7436 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // 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.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payments - Retrieve/request.json b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payments - Retrieve/request.json index c71774083b2..ef0b213739d 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payments - Retrieve/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Refunds - Create/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Refunds - Create/event.test.js index c862e8e68a7..dbc930608cb 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Refunds - Create/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Refunds - Create/event.test.js @@ -1,21 +1,30 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/refunds - 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]::/refunds - 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", + ); }); // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Refunds - Create/request.json b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Refunds - Create/request.json index 4dbca4d01f2..0c13281ee15 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Refunds - Create/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Refunds - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js index b1e1f12ba50..bbd8e544e2c 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Refunds - Retrieve/event.test.js @@ -1,22 +1,30 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/refunds/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/refunds/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); - // 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("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.'); -}; + console.log( + "INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.", + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Refunds - Retrieve/request.json b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Refunds - Retrieve/request.json index 6c28619e856..c4271891fbf 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Refunds - Retrieve/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/QuickStart/Refunds - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/refunds/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["refunds", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js index 7d118e2f5e5..edb1f073bee 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js @@ -1,56 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); - // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json index f64e5c46f9b..3880c506f11 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json @@ -100,12 +100,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js index 0e6401222ff..52680771c31 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js @@ -1,55 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector_error'", function() { - pm.expect(jsonData.error.type).to.eql("connector_error"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'", + function () { + pm.expect(jsonData.error.type).to.eql("connector_error"); + }, + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json index dec8c073ddd..4799f67eae7 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json @@ -100,12 +100,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid/event.test.js index 7d118e2f5e5..edb1f073bee 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid/event.test.js @@ -1,56 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); - // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid/request.json b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid/request.json index f551f988609..8694da7d8d1 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid/request.json @@ -100,12 +100,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js index ab9532fab05..c1dffb25d86 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js @@ -1,55 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json index a1411da16e0..6e9755b5ce3 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json @@ -100,12 +100,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json index 90b19864ee1..f2bee31ef66 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Confirm" - ] + "childrenOrder": ["Payments - Create", "Payments - Confirm"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js index 1e8ba8cc3a6..e8d6b2216c5 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js @@ -1,58 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); -}); - - +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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json index b28abd0c309..e3b1e235042 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json @@ -67,12 +67,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario3-Capture the succeeded payment/.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario3-Capture the succeeded payment/.meta.json index cafd3a6808e..6df7c0a1943 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario3-Capture the succeeded payment/.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario3-Capture the succeeded payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Capture" - ] + "childrenOrder": ["Payments - Create", "Payments - Capture"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario3-Capture the succeeded payment/Payments - Capture/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario3-Capture the succeeded payment/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario3-Capture the succeeded payment/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario3-Capture the succeeded payment/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario3-Capture the succeeded payment/Payments - Capture/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario3-Capture the succeeded payment/Payments - Capture/event.test.js index c3e7afc6760..46bf201d1ce 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario3-Capture the succeeded payment/Payments - Capture/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario3-Capture the succeeded payment/Payments - Capture/event.test.js @@ -1,59 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario3-Capture the succeeded payment/Payments - Capture/request.json b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario3-Capture the succeeded payment/Payments - Capture/request.json index 766a8330d6e..6c934a9132c 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario3-Capture the succeeded payment/Payments - Capture/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario3-Capture the succeeded payment/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario3-Capture the succeeded payment/Payments - Create/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario3-Capture the succeeded payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario3-Capture the succeeded payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario3-Capture the succeeded payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario3-Capture the succeeded payment/Payments - Create/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario3-Capture the succeeded payment/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario3-Capture the succeeded payment/Payments - Create/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario3-Capture the succeeded payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario3-Capture the succeeded payment/Payments - Create/request.json b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario3-Capture the succeeded payment/Payments - Create/request.json index 598a3f9c93d..6a647a14d94 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario3-Capture the succeeded payment/Payments - Create/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario3-Capture the succeeded payment/Payments - Create/request.json @@ -89,12 +89,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario4-Refund exceeds amount/Payments - Create/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario4-Refund exceeds amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario4-Refund exceeds amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario4-Refund exceeds amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario4-Refund exceeds amount/Payments - Create/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario4-Refund exceeds amount/Payments - Create/event.test.js index fdc1e9d3d65..c48d8e2d054 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario4-Refund exceeds amount/Payments - Create/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario4-Refund exceeds amount/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario4-Refund exceeds amount/Payments - Create/request.json b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario4-Refund exceeds amount/Payments - Create/request.json index 598a3f9c93d..6a647a14d94 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario4-Refund exceeds amount/Payments - Create/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario4-Refund exceeds amount/Payments - Create/request.json @@ -89,12 +89,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario4-Refund exceeds amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario4-Refund exceeds amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario4-Refund exceeds amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario4-Refund exceeds amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario4-Refund exceeds amount/Payments - Retrieve/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario4-Refund exceeds amount/Payments - Retrieve/event.test.js index 78065ab694b..0652a2d92fd 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario4-Refund exceeds amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario4-Refund exceeds amount/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() { - pm.expect(jsonData.status).to.eql("succeeded"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", + function () { + pm.expect(jsonData.status).to.eql("succeeded"); + }, + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario4-Refund exceeds amount/Payments - Retrieve/request.json b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario4-Refund exceeds amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario4-Refund exceeds amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario4-Refund exceeds amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario4-Refund exceeds amount/Refunds - Create/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario4-Refund exceeds amount/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario4-Refund exceeds amount/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario4-Refund exceeds amount/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario4-Refund exceeds amount/Refunds - Create/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario4-Refund exceeds amount/Refunds - Create/event.test.js index 9537daf6187..776dbd70712 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario4-Refund exceeds amount/Refunds - Create/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario4-Refund exceeds amount/Refunds - Create/event.test.js @@ -1,33 +1,48 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/refunds - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + 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; -}); +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"); -})}; - + 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"); + }, + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario4-Refund exceeds amount/Refunds - Create/request.json b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario4-Refund exceeds amount/Refunds - Create/request.json index 326319e8fdf..10de81bed08 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario4-Refund exceeds amount/Refunds - Create/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario4-Refund exceeds amount/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js index 65232a76373..55dc35b9128 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; - - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json index 06217f8a1bc..21769d17e34 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json @@ -89,12 +89,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js index 42bf3e0ac45..fdb8a946f3d 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js index 30888b5cc0c..d3c4451760d 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/event.test.js @@ -1,32 +1,48 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/refunds - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); + 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 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("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.'); -}; + 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; -}); +pm.test( + "[POST]::/payments/:id/confirm - Content check if 'error' exists", + function () { + pm.expect(typeof jsonData.error !== "undefined").to.be.true; + }, +); // Response body should have value "invalid_request" for "error type" if (jsonData?.error?.type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; + pm.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"); + }, + ); +} diff --git a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json index d18aaf8befd..9fe125ce8ea 100644 --- a/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json +++ b/postman/collection-dir/trustpay/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Refunds - Create/request.json @@ -31,12 +31,8 @@ }, "url": { "raw": "{{baseUrl}}/refunds", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "refunds" - ] + "host": ["{{baseUrl}}"], + "path": ["refunds"] }, "description": "To create a refund against an already processed payment" } diff --git a/postman/collection-dir/trustpay/Health check/.meta.json b/postman/collection-dir/trustpay/Health check/.meta.json index 66ee7e50cab..579f9fd541c 100644 --- a/postman/collection-dir/trustpay/Health check/.meta.json +++ b/postman/collection-dir/trustpay/Health check/.meta.json @@ -1,5 +1,3 @@ { - "childrenOrder": [ - "New Request" - ] + "childrenOrder": ["New Request"] } diff --git a/postman/collection-dir/trustpay/Health check/New Request/.event.meta.json b/postman/collection-dir/trustpay/Health check/New Request/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/trustpay/Health check/New Request/.event.meta.json +++ b/postman/collection-dir/trustpay/Health check/New Request/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/trustpay/Health check/New Request/event.test.js b/postman/collection-dir/trustpay/Health check/New Request/event.test.js index 325a8c8a479..b490b8be090 100644 --- a/postman/collection-dir/trustpay/Health check/New Request/event.test.js +++ b/postman/collection-dir/trustpay/Health check/New Request/event.test.js @@ -1,4 +1,4 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - Status code is 2xx", function () { - pm.response.to.be.success; -}); \ No newline at end of file + pm.response.to.be.success; +}); diff --git a/postman/collection-dir/trustpay/Health check/New Request/request.json b/postman/collection-dir/trustpay/Health check/New Request/request.json index 4cc8d4b1a96..e40e9396178 100644 --- a/postman/collection-dir/trustpay/Health check/New Request/request.json +++ b/postman/collection-dir/trustpay/Health check/New Request/request.json @@ -10,11 +10,7 @@ ], "url": { "raw": "{{baseUrl}}/health", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "health" - ] + "host": ["{{baseUrl}}"], + "path": ["health"] } } diff --git a/postman/collection-dir/trustpay/event.test.js b/postman/collection-dir/trustpay/event.test.js index 69037688f22..fb52caec30f 100644 --- a/postman/collection-dir/trustpay/event.test.js +++ b/postman/collection-dir/trustpay/event.test.js @@ -1,11 +1,13 @@ // 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("[LOG]::payment_id - " + jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log("[LOG]::payment_id - " + jsonData.payment_id); } -console.log("[LOG]::x-request-id - " + pm.response.headers.get('x-request-id')); \ No newline at end of file +console.log("[LOG]::x-request-id - " + pm.response.headers.get("x-request-id")); diff --git a/postman/collection-dir/worldline/.event.meta.json b/postman/collection-dir/worldline/.event.meta.json index 2df9d47d936..eb871bbcb9b 100644 --- a/postman/collection-dir/worldline/.event.meta.json +++ b/postman/collection-dir/worldline/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.prerequest.js", - "event.test.js" - ] + "eventOrder": ["event.prerequest.js", "event.test.js"] } diff --git a/postman/collection-dir/worldline/.meta.json b/postman/collection-dir/worldline/.meta.json index 91b6a65c5bc..d513035ce2d 100644 --- a/postman/collection-dir/worldline/.meta.json +++ b/postman/collection-dir/worldline/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Health check", - "Flow Testcases" - ] + "childrenOrder": ["Health check", "Flow Testcases"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/.meta.json b/postman/collection-dir/worldline/Flow Testcases/.meta.json index 1bbce843680..023989e1e49 100644 --- a/postman/collection-dir/worldline/Flow Testcases/.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/.meta.json @@ -1,7 +1,3 @@ { - "childrenOrder": [ - "QuickStart", - "Happy Cases", - "Variation Cases" - ] + "childrenOrder": ["QuickStart", "Happy Cases", "Variation Cases"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js index 82e60ba1b95..2b4d94d8d5a 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json index 9473bdd5504..d7582d82dde 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js index 3569ae6c760..6b654b2968a 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "Succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js index 0ab0b7893e4..394702b1fa1 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js index 5698484c741..55dc35b9128 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json index 5af0c87ad85..1543e9736ce 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js index da20606cc59..72b777a956e 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js index 19bfef45eb0..c25f2c03733 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id/confirm - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id/confirm - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json index 9141c8627cd..be7b2947333 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "card", "payment_method_data": { "card": { @@ -32,14 +53,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json index b28abd0c309..e3b1e235042 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json @@ -67,12 +67,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js index da20606cc59..72b777a956e 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments:id - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments:id - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js index 0184786f838..fa72b8541ff 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js @@ -1,68 +1,94 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/capture - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); - -// Validate if response has JSON Body +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.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} - +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]:://payments/:id/capture - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; + pm.test( + "[POST]:://payments/:id/capture - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} // Response body should have value "6540" for "amount" -if (jsonData?.amount){ - pm.test("[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", function() { - pm.expect(jsonData.amount).to.eql(6540); - } ) -} +if (jsonData?.amount) { + pm.test( + "[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'", + function () { + pm.expect(jsonData.amount).to.eql(6540); + }, + ); +} // Response body should have value "6000" for "amount_received" if (jsonData?.amount_received) { -pm.test("[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", function() { - pm.expect(jsonData.amount_received).to.eql(6000); -})}; - - - - + pm.test( + "[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'", + function () { + pm.expect(jsonData.amount_received).to.eql(6000); + }, + ); +} diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json index 8975575ca40..9fe257ed85e 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js index b0e69cad2c2..d683186aa00 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json index a69411a174b..73efadc86e6 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js index 6fee033b3ed..c5914be3250 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js index 9632bd19048..dcf3f191643 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/event.test.js @@ -1,43 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/cancel - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type 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(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "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"); -})}; - - - + pm.test( + "[POST]::/payments/:id/cancel - Content check if value for 'status' matches 'cancelled'", + function () { + pm.expect(jsonData.status).to.eql("cancelled"); + }, + ); +} diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js index b0e69cad2c2..d683186aa00 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json index a69411a174b..73efadc86e6 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js index f4e0ab9b2aa..5e52e13a59e 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set 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 "cancelled" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'", function() { - pm.expect(jsonData.status).to.eql("cancelled"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'", + function () { + pm.expect(jsonData.status).to.eql("cancelled"); + }, + ); +} diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario6-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario6-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario6-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario6-Bank Redirect-Ideal/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario6-Bank Redirect-Ideal/Payments - Confirm/event.test.js b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario6-Bank Redirect-Ideal/Payments - Confirm/event.test.js index 4e2639c786e..c2fe7017fd3 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario6-Bank Redirect-Ideal/Payments - Confirm/event.test.js +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario6-Bank Redirect-Ideal/Payments - Confirm/event.test.js @@ -1,71 +1,103 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/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 - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); + +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // 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; -}); +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; + }, +); // Response body should have value "ideal" for "payment_method_type" if (jsonData?.payment_method_type) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'ideal'", function() { - pm.expect(jsonData.payment_method_type).to.eql("ideal"); -})}; - + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'ideal'", + function () { + pm.expect(jsonData.payment_method_type).to.eql("ideal"); + }, + ); +} // Response body should have value "stripe" for "connector" if (jsonData?.connector) { -pm.test("[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'worldline'", function() { - pm.expect(jsonData.connector).to.eql("worldline"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'worldline'", + function () { + pm.expect(jsonData.connector).to.eql("worldline"); + }, + ); +} diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario6-Bank Redirect-Ideal/Payments - Confirm/request.json b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario6-Bank Redirect-Ideal/Payments - Confirm/request.json index 57e0e2560de..52aee28ab90 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario6-Bank Redirect-Ideal/Payments - Confirm/request.json +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario6-Bank Redirect-Ideal/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "client_secret": "{{client_secret}}", "payment_method": "bank_redirect", "payment_method_type": "ideal", "payment_method_data": { @@ -36,14 +57,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario6-Bank Redirect-Ideal/Payments - Create/.event.meta.json b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario6-Bank Redirect-Ideal/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario6-Bank Redirect-Ideal/Payments - Create/.event.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario6-Bank Redirect-Ideal/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario6-Bank Redirect-Ideal/Payments - Create/event.test.js b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario6-Bank Redirect-Ideal/Payments - Create/event.test.js index af1dfa8aabd..45b5cc9d8fa 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario6-Bank Redirect-Ideal/Payments - Create/event.test.js +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario6-Bank Redirect-Ideal/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_payment_method" 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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario6-Bank Redirect-Ideal/Payments - Create/request.json b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario6-Bank Redirect-Ideal/Payments - Create/request.json index 17fb6c77a28..e95229ddf26 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario6-Bank Redirect-Ideal/Payments - Create/request.json +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario6-Bank Redirect-Ideal/Payments - Create/request.json @@ -93,12 +93,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario6-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario6-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario6-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario6-Bank Redirect-Ideal/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario6-Bank Redirect-Ideal/Payments - Retrieve/event.test.js b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario6-Bank Redirect-Ideal/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario6-Bank Redirect-Ideal/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario6-Bank Redirect-Ideal/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario6-Bank Redirect-Ideal/Payments - Retrieve/request.json b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario6-Bank Redirect-Ideal/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario6-Bank Redirect-Ideal/Payments - Retrieve/request.json +++ b/postman/collection-dir/worldline/Flow Testcases/Happy Cases/Scenario6-Bank Redirect-Ideal/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/worldline/Flow Testcases/QuickStart/API Key - Create/.event.meta.json b/postman/collection-dir/worldline/Flow Testcases/QuickStart/API Key - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/worldline/Flow Testcases/QuickStart/API Key - Create/.event.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/QuickStart/API Key - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/QuickStart/API Key - Create/event.test.js b/postman/collection-dir/worldline/Flow Testcases/QuickStart/API Key - Create/event.test.js index bc42e83a761..4e27c5a5025 100644 --- a/postman/collection-dir/worldline/Flow Testcases/QuickStart/API Key - Create/event.test.js +++ b/postman/collection-dir/worldline/Flow Testcases/QuickStart/API Key - Create/event.test.js @@ -1,32 +1,46 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/api_keys/:merchant_id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/api_keys/:merchant_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/api_keys/:merchant_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; try { jsonData = pm.response.json(); -} catch(e) { -} +} catch (e) {} // pm.collectionVariables - Set api_key_id as variable for jsonData.key_id if (jsonData?.key_id) { - pm.collectionVariables.set("api_key_id", jsonData.key_id); - console.log("- use {{api_key_id}} as collection variable for value", jsonData.key_id); + pm.collectionVariables.set("api_key_id", jsonData.key_id); + console.log( + "- use {{api_key_id}} as collection variable for value", + jsonData.key_id, + ); } else { - console.log('INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value", jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} diff --git a/postman/collection-dir/worldline/Flow Testcases/QuickStart/API Key - Create/request.json b/postman/collection-dir/worldline/Flow Testcases/QuickStart/API Key - Create/request.json index 29c2490d1bc..2210d14da0e 100644 --- a/postman/collection-dir/worldline/Flow Testcases/QuickStart/API Key - Create/request.json +++ b/postman/collection-dir/worldline/Flow Testcases/QuickStart/API Key - Create/request.json @@ -35,13 +35,8 @@ }, "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/worldline/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json b/postman/collection-dir/worldline/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/worldline/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js b/postman/collection-dir/worldline/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js index 538b393c084..7de0d5beb31 100644 --- a/postman/collection-dir/worldline/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js +++ b/postman/collection-dir/worldline/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js @@ -1,37 +1,56 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - 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]::/accounts - 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", + ); }); // 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 merchant_id as variable for jsonData.merchant_id if (jsonData?.merchant_id) { - pm.collectionVariables.set("merchant_id", jsonData.merchant_id); - console.log("- use {{merchant_id}} as collection variable for value",jsonData.merchant_id); + pm.collectionVariables.set("merchant_id", jsonData.merchant_id); + console.log( + "- use {{merchant_id}} as collection variable for value", + jsonData.merchant_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value",jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} // pm.collectionVariables - Set publishable_key as variable for jsonData.publishable_key if (jsonData?.publishable_key) { - pm.collectionVariables.set("publishable_key", jsonData.publishable_key); - console.log("- use {{publishable_key}} as collection variable for value",jsonData.publishable_key); + pm.collectionVariables.set("publishable_key", jsonData.publishable_key); + console.log( + "- use {{publishable_key}} as collection variable for value", + jsonData.publishable_key, + ); } else { - console.log('INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.", + ); +} diff --git a/postman/collection-dir/worldline/Flow Testcases/QuickStart/Merchant Account - Create/request.json b/postman/collection-dir/worldline/Flow Testcases/QuickStart/Merchant Account - Create/request.json index b1205d1e7ae..031e0337fcd 100644 --- a/postman/collection-dir/worldline/Flow Testcases/QuickStart/Merchant Account - Create/request.json +++ b/postman/collection-dir/worldline/Flow Testcases/QuickStart/Merchant Account - Create/request.json @@ -84,12 +84,8 @@ }, "url": { "raw": "{{baseUrl}}/accounts", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "accounts" - ] + "host": ["{{baseUrl}}"], + "path": ["accounts"] }, "description": "Create a new account for a merchant. The merchant could be a seller or retailer or client who likes to receive and send payments." } diff --git a/postman/collection-dir/worldline/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json b/postman/collection-dir/worldline/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/worldline/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js b/postman/collection-dir/worldline/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js index b831702461e..88e92d8d84a 100644 --- a/postman/collection-dir/worldline/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js +++ b/postman/collection-dir/worldline/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js @@ -1,21 +1,39 @@ -// Validate status 2xx -pm.test("[POST]::/account/:account_id/connectors - 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.be.success; + }, +); // Validate if response header has matching content-type -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"); -}); +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){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id if (jsonData?.merchant_connector_id) { - pm.collectionVariables.set("merchant_connector_id", jsonData.merchant_connector_id); - console.log("- use {{merchant_connector_id}} as collection variable for value",jsonData.merchant_connector_id); + pm.collectionVariables.set( + "merchant_connector_id", + jsonData.merchant_connector_id, + ); + console.log( + "- use {{merchant_connector_id}} as collection variable for value", + jsonData.merchant_connector_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.", + ); +} diff --git a/postman/collection-dir/worldline/Flow Testcases/QuickStart/Payment Connector - Create/request.json b/postman/collection-dir/worldline/Flow Testcases/QuickStart/Payment Connector - Create/request.json index 82eed44ec76..c27d267f44d 100644 --- a/postman/collection-dir/worldline/Flow Testcases/QuickStart/Payment Connector - Create/request.json +++ b/postman/collection-dir/worldline/Flow Testcases/QuickStart/Payment Connector - Create/request.json @@ -107,14 +107,8 @@ }, "url": { "raw": "{{baseUrl}}/account/:account_id/connectors", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/worldline/Flow Testcases/QuickStart/Payments - Create/.event.meta.json b/postman/collection-dir/worldline/Flow Testcases/QuickStart/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/worldline/Flow Testcases/QuickStart/Payments - Create/.event.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/QuickStart/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/QuickStart/Payments - Create/event.test.js b/postman/collection-dir/worldline/Flow Testcases/QuickStart/Payments - Create/event.test.js index 62142d52dca..a6947db94c0 100644 --- a/postman/collection-dir/worldline/Flow Testcases/QuickStart/Payments - Create/event.test.js +++ b/postman/collection-dir/worldline/Flow Testcases/QuickStart/Payments - Create/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/worldline/Flow Testcases/QuickStart/Payments - Create/request.json b/postman/collection-dir/worldline/Flow Testcases/QuickStart/Payments - Create/request.json index 64f880551a0..d54ac18d3c5 100644 --- a/postman/collection-dir/worldline/Flow Testcases/QuickStart/Payments - Create/request.json +++ b/postman/collection-dir/worldline/Flow Testcases/QuickStart/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/worldline/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json b/postman/collection-dir/worldline/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/worldline/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js b/postman/collection-dir/worldline/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js index 4dd072b2222..d0a02af7436 100644 --- a/postman/collection-dir/worldline/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/worldline/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // 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.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/worldline/Flow Testcases/QuickStart/Payments - Retrieve/request.json b/postman/collection-dir/worldline/Flow Testcases/QuickStart/Payments - Retrieve/request.json index c71774083b2..ef0b213739d 100644 --- a/postman/collection-dir/worldline/Flow Testcases/QuickStart/Payments - Retrieve/request.json +++ b/postman/collection-dir/worldline/Flow Testcases/QuickStart/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js index 08f14e045be..edb1f073bee 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js @@ -1,54 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json index ad281c58256..9cbdbc8e22f 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js index 7d118e2f5e5..edb1f073bee 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js @@ -1,56 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); - // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'invalid_request'", function() { - pm.expect(jsonData.error.type).to.eql("invalid_request"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json index 99a24fb4f26..8a9df91718d 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js index 0e6401222ff..52680771c31 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js @@ -1,55 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector_error'", function() { - pm.expect(jsonData.error.type).to.eql("connector_error"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'", + function () { + pm.expect(jsonData.error.type).to.eql("connector_error"); + }, + ); +} diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json index 0a16b975817..c7ad4cb2749 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json @@ -75,12 +75,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js index 630c4f25cae..3976f7f496a 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js @@ -1,55 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector'", function() { - pm.expect(jsonData.error.type).to.eql("connector"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector'", + function () { + pm.expect(jsonData.error.type).to.eql("connector"); + }, + ); +} diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json index 79a70e782fc..d68379f9444 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json index 90b19864ee1..f2bee31ef66 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Confirm" - ] + "childrenOrder": ["Payments - Create", "Payments - Confirm"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js index 1e8ba8cc3a6..e8d6b2216c5 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js @@ -1,58 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); -}); - - +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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json index 17048792420..ec45ef29bb6 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -17,18 +37,14 @@ "language": "json" } }, - "raw_json_formatted": {} + "raw_json_formatted": { + "client_secret": "{{client_secret}}" + } }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json index b28abd0c309..e3b1e235042 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json @@ -67,12 +67,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js index c3e7afc6760..46bf201d1ce 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/event.test.js @@ -1,59 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json index 766a8330d6e..6c934a9132c 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js index b0e69cad2c2..d683186aa00 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", function() { - pm.expect(jsonData.status).to.eql("requires_capture"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json index a69411a174b..73efadc86e6 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js index 6b03e0b9ee6..34beacf976b 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_capture" for "status" 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"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_capture'", + function () { + pm.expect(jsonData.status).to.eql("requires_capture"); + }, + ); +} diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json index cafd3a6808e..6df7c0a1943 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Capture" - ] + "childrenOrder": ["Payments - Create", "Payments - Capture"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js index c3e7afc6760..46bf201d1ce 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/event.test.js @@ -1,59 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/capture - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/capture - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/payments/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/capture - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}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 "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/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"); -})}; - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json index 766a8330d6e..6c934a9132c 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Capture/request.json @@ -25,14 +25,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/capture", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "capture" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "capture"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js index 8700f722388..2b4d94d8d5a 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json index 9473bdd5504..d7582d82dde 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json index afba25ab6d6..5ff1a7cb4e8 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Cancel" - ] + "childrenOrder": ["Payments - Create", "Payments - Cancel"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js index d7879c70d87..0f869a6dfb8 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/event.test.js @@ -1,50 +1,69 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments/:id/cancel - Status code is 4xx", function () { - pm.response.to.be.error; + 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/: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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/cancel - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; - - - - - + 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"); + }, + ); +} diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json index f64e37a125a..3a1d8aa178f 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Cancel/request.json @@ -23,14 +23,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/cancel", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "cancel" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "cancel"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js index 8700f722388..2b4d94d8d5a 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js @@ -1,50 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "succeeded" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'processing'", function() { - pm.expect(jsonData.status).to.eql("processing"); -})}; - + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'processing'", + function () { + pm.expect(jsonData.status).to.eql("processing"); + }, + ); +} diff --git a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json index 9473bdd5504..d7582d82dde 100644 --- a/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json +++ b/postman/collection-dir/worldline/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/worldline/Health check/.meta.json b/postman/collection-dir/worldline/Health check/.meta.json index 66ee7e50cab..579f9fd541c 100644 --- a/postman/collection-dir/worldline/Health check/.meta.json +++ b/postman/collection-dir/worldline/Health check/.meta.json @@ -1,5 +1,3 @@ { - "childrenOrder": [ - "New Request" - ] + "childrenOrder": ["New Request"] } diff --git a/postman/collection-dir/worldline/Health check/New Request/.event.meta.json b/postman/collection-dir/worldline/Health check/New Request/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/worldline/Health check/New Request/.event.meta.json +++ b/postman/collection-dir/worldline/Health check/New Request/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/worldline/Health check/New Request/event.test.js b/postman/collection-dir/worldline/Health check/New Request/event.test.js index 325a8c8a479..b490b8be090 100644 --- a/postman/collection-dir/worldline/Health check/New Request/event.test.js +++ b/postman/collection-dir/worldline/Health check/New Request/event.test.js @@ -1,4 +1,4 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - Status code is 2xx", function () { - pm.response.to.be.success; -}); \ No newline at end of file + pm.response.to.be.success; +}); diff --git a/postman/collection-dir/worldline/Health check/New Request/request.json b/postman/collection-dir/worldline/Health check/New Request/request.json index 4cc8d4b1a96..e40e9396178 100644 --- a/postman/collection-dir/worldline/Health check/New Request/request.json +++ b/postman/collection-dir/worldline/Health check/New Request/request.json @@ -10,11 +10,7 @@ ], "url": { "raw": "{{baseUrl}}/health", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "health" - ] + "host": ["{{baseUrl}}"], + "path": ["health"] } } diff --git a/postman/collection-dir/worldline/event.test.js b/postman/collection-dir/worldline/event.test.js index 69037688f22..fb52caec30f 100644 --- a/postman/collection-dir/worldline/event.test.js +++ b/postman/collection-dir/worldline/event.test.js @@ -1,11 +1,13 @@ // 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("[LOG]::payment_id - " + jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log("[LOG]::payment_id - " + jsonData.payment_id); } -console.log("[LOG]::x-request-id - " + pm.response.headers.get('x-request-id')); \ No newline at end of file +console.log("[LOG]::x-request-id - " + pm.response.headers.get("x-request-id")); diff --git a/postman/collection-dir/zen/.event.meta.json b/postman/collection-dir/zen/.event.meta.json index 2df9d47d936..eb871bbcb9b 100644 --- a/postman/collection-dir/zen/.event.meta.json +++ b/postman/collection-dir/zen/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.prerequest.js", - "event.test.js" - ] + "eventOrder": ["event.prerequest.js", "event.test.js"] } diff --git a/postman/collection-dir/zen/.meta.json b/postman/collection-dir/zen/.meta.json index 91b6a65c5bc..d513035ce2d 100644 --- a/postman/collection-dir/zen/.meta.json +++ b/postman/collection-dir/zen/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Health check", - "Flow Testcases" - ] + "childrenOrder": ["Health check", "Flow Testcases"] } diff --git a/postman/collection-dir/zen/Flow Testcases/.meta.json b/postman/collection-dir/zen/Flow Testcases/.meta.json index 1bbce843680..023989e1e49 100644 --- a/postman/collection-dir/zen/Flow Testcases/.meta.json +++ b/postman/collection-dir/zen/Flow Testcases/.meta.json @@ -1,7 +1,3 @@ { - "childrenOrder": [ - "QuickStart", - "Happy Cases", - "Variation Cases" - ] + "childrenOrder": ["QuickStart", "Happy Cases", "Variation Cases"] } diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js index 1baf6b854b7..5e6a7972fd7 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", function() { - pm.expect(jsonData.status).to.eql("requires_customer_action"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", + function () { + pm.expect(jsonData.status).to.eql("requires_customer_action"); + }, + ); +} diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json index d0b0c5f1656..0bf606d869e 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json @@ -101,12 +101,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js index 08ad2d6a233..02ab01502c1 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + 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"); + }, + ); +} diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js index 926fbad9ca3..6c20960e9dc 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json index 7fb38dbd54d..778f8872687 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "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", @@ -41,14 +62,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js index 5698484c741..55dc35b9128 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json index 1a3597d5a86..caa19cc5c67 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json @@ -94,12 +94,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js index 8d2e2e5d1cc..3a866564a45 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js @@ -1,52 +1,74 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json index c4a53e95984..f73a2268a38 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "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", @@ -51,14 +72,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json index e460432249b..c2d7c7bf9c0 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Create/request.json @@ -84,12 +84,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/.meta.json b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/.meta.json index 60051ecca22..69b505c6d86 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/.meta.json +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Retrieve" - ] + "childrenOrder": ["Payments - Create", "Payments - Retrieve"] } diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Create/.event.meta.json b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Create/.event.meta.json +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Create/event.test.js b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Create/event.test.js index 1388cde7c89..39cbb3ee90e 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Create/event.test.js +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Create/event.test.js @@ -1,54 +1,80 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.status) { -pm.test("[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", function() { - pm.expect(jsonData.status).to.eql("requires_customer_action"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'", + function () { + pm.expect(jsonData.status).to.eql("requires_customer_action"); + }, + ); +} // Response body should have "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; -}); +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; + }, +); diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Create/request.json b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Create/request.json index 402e3f58636..ee354325323 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Create/request.json +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Create/request.json @@ -101,12 +101,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Retrieve/event.test.js b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Retrieve/event.test.js index 08ad2d6a233..02ab01502c1 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Retrieve/event.test.js @@ -1,51 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); - -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + 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"); + }, + ); +} diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Retrieve/request.json b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Retrieve/request.json +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario4-Create 3DS payment/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Confirm/event.test.js b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Confirm/event.test.js index edf87c9ccdf..1fa0afa6402 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Confirm/event.test.js +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Confirm/event.test.js @@ -1,57 +1,83 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/payments/:id/confirm - 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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_customer_action" for "status" if (jsonData?.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.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"); + }, + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments/:id/confirm - Content check if 'next_action.redirect_to_url' exists", function() { - pm.expect((typeof jsonData.next_action.redirect_to_url !== "undefined")).to.be.true; -}); \ No newline at end of file +pm.test( + "[POST]::/payments/:id/confirm - Content check if 'next_action.redirect_to_url' exists", + function () { + pm.expect(typeof jsonData.next_action.redirect_to_url !== "undefined").to.be + .true; + }, +); diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Confirm/request.json b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Confirm/request.json index 7fb38dbd54d..778f8872687 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Confirm/request.json +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "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", @@ -41,14 +62,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Create/.event.meta.json b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Create/.event.meta.json +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Create/event.test.js b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Create/event.test.js index 5698484c741..55dc35b9128 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Create/event.test.js +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; + pm.test( + "[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'", + function () { + pm.expect(jsonData.status).to.eql("requires_confirmation"); + }, + ); +} diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Create/request.json b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Create/request.json index 1a3597d5a86..caa19cc5c67 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Create/request.json +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Create/request.json @@ -94,12 +94,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js index cccd288c0c1..9053ddab13b 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Retrieve/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Retrieve/request.json b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Retrieve/request.json index b9ebc1be4aa..6cd4b7d96c5 100644 --- a/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Retrieve/request.json +++ b/postman/collection-dir/zen/Flow Testcases/Happy Cases/Scenario5-Create 3DS payment with confrm false/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id?force_sync=true", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "query": [ { "key": "force_sync", diff --git a/postman/collection-dir/zen/Flow Testcases/QuickStart/API Key - Create/.event.meta.json b/postman/collection-dir/zen/Flow Testcases/QuickStart/API Key - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/zen/Flow Testcases/QuickStart/API Key - Create/.event.meta.json +++ b/postman/collection-dir/zen/Flow Testcases/QuickStart/API Key - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/zen/Flow Testcases/QuickStart/API Key - Create/event.test.js b/postman/collection-dir/zen/Flow Testcases/QuickStart/API Key - Create/event.test.js index bc42e83a761..4e27c5a5025 100644 --- a/postman/collection-dir/zen/Flow Testcases/QuickStart/API Key - Create/event.test.js +++ b/postman/collection-dir/zen/Flow Testcases/QuickStart/API Key - Create/event.test.js @@ -1,32 +1,46 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/api_keys/:merchant_id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type -pm.test("[POST]::/api_keys/:merchant_id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); -}); +pm.test( + "[POST]::/api_keys/:merchant_id - Content-Type is application/json", + function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); + }, +); // Set response object as internal variable let jsonData = {}; try { jsonData = pm.response.json(); -} catch(e) { -} +} catch (e) {} // pm.collectionVariables - Set api_key_id as variable for jsonData.key_id if (jsonData?.key_id) { - pm.collectionVariables.set("api_key_id", jsonData.key_id); - console.log("- use {{api_key_id}} as collection variable for value", jsonData.key_id); + pm.collectionVariables.set("api_key_id", jsonData.key_id); + console.log( + "- use {{api_key_id}} as collection variable for value", + jsonData.key_id, + ); } else { - console.log('INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value", jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} diff --git a/postman/collection-dir/zen/Flow Testcases/QuickStart/API Key - Create/request.json b/postman/collection-dir/zen/Flow Testcases/QuickStart/API Key - Create/request.json index 29c2490d1bc..2210d14da0e 100644 --- a/postman/collection-dir/zen/Flow Testcases/QuickStart/API Key - Create/request.json +++ b/postman/collection-dir/zen/Flow Testcases/QuickStart/API Key - Create/request.json @@ -35,13 +35,8 @@ }, "url": { "raw": "{{baseUrl}}/api_keys/:merchant_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api_keys", - ":merchant_id" - ], + "host": ["{{baseUrl}}"], + "path": ["api_keys", ":merchant_id"], "variable": [ { "key": "merchant_id", diff --git a/postman/collection-dir/zen/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json b/postman/collection-dir/zen/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/zen/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json +++ b/postman/collection-dir/zen/Flow Testcases/QuickStart/Merchant Account - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/zen/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js b/postman/collection-dir/zen/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js index 538b393c084..7de0d5beb31 100644 --- a/postman/collection-dir/zen/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js +++ b/postman/collection-dir/zen/Flow Testcases/QuickStart/Merchant Account - Create/event.test.js @@ -1,37 +1,56 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - 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]::/accounts - 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", + ); }); // 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 merchant_id as variable for jsonData.merchant_id if (jsonData?.merchant_id) { - pm.collectionVariables.set("merchant_id", jsonData.merchant_id); - console.log("- use {{merchant_id}} as collection variable for value",jsonData.merchant_id); + pm.collectionVariables.set("merchant_id", jsonData.merchant_id); + console.log( + "- use {{merchant_id}} as collection variable for value", + jsonData.merchant_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.", + ); +} // pm.collectionVariables - Set api_key as variable for jsonData.api_key if (jsonData?.api_key) { - pm.collectionVariables.set("api_key", jsonData.api_key); - console.log("- use {{api_key}} as collection variable for value",jsonData.api_key); + pm.collectionVariables.set("api_key", jsonData.api_key); + console.log( + "- use {{api_key}} as collection variable for value", + jsonData.api_key, + ); } else { - console.log('INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.", + ); +} // pm.collectionVariables - Set publishable_key as variable for jsonData.publishable_key if (jsonData?.publishable_key) { - pm.collectionVariables.set("publishable_key", jsonData.publishable_key); - console.log("- use {{publishable_key}} as collection variable for value",jsonData.publishable_key); + pm.collectionVariables.set("publishable_key", jsonData.publishable_key); + console.log( + "- use {{publishable_key}} as collection variable for value", + jsonData.publishable_key, + ); } else { - console.log('INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.", + ); +} diff --git a/postman/collection-dir/zen/Flow Testcases/QuickStart/Merchant Account - Create/request.json b/postman/collection-dir/zen/Flow Testcases/QuickStart/Merchant Account - Create/request.json index ffeea3410a4..dcbf46ee538 100644 --- a/postman/collection-dir/zen/Flow Testcases/QuickStart/Merchant Account - Create/request.json +++ b/postman/collection-dir/zen/Flow Testcases/QuickStart/Merchant Account - Create/request.json @@ -84,12 +84,8 @@ }, "url": { "raw": "{{baseUrl}}/accounts", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "accounts" - ] + "host": ["{{baseUrl}}"], + "path": ["accounts"] }, "description": "Create a new account for a merchant. The merchant could be a seller or retailer or client who likes to receive and send payments." } diff --git a/postman/collection-dir/zen/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json b/postman/collection-dir/zen/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json index 4ac527d834a..220b1a6723d 100644 --- a/postman/collection-dir/zen/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json +++ b/postman/collection-dir/zen/Flow Testcases/QuickStart/Payment Connector - Create/.event.meta.json @@ -1,6 +1,3 @@ { - "eventOrder": [ - "event.test.js", - "event.prerequest.js" - ] + "eventOrder": ["event.test.js", "event.prerequest.js"] } diff --git a/postman/collection-dir/zen/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js b/postman/collection-dir/zen/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js index b831702461e..88e92d8d84a 100644 --- a/postman/collection-dir/zen/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js +++ b/postman/collection-dir/zen/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js @@ -1,21 +1,39 @@ -// Validate status 2xx -pm.test("[POST]::/account/:account_id/connectors - 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.be.success; + }, +); // Validate if response header has matching content-type -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"); -}); +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){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id if (jsonData?.merchant_connector_id) { - pm.collectionVariables.set("merchant_connector_id", jsonData.merchant_connector_id); - console.log("- use {{merchant_connector_id}} as collection variable for value",jsonData.merchant_connector_id); + pm.collectionVariables.set( + "merchant_connector_id", + jsonData.merchant_connector_id, + ); + console.log( + "- use {{merchant_connector_id}} as collection variable for value", + jsonData.merchant_connector_id, + ); } else { - console.log('INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.", + ); +} diff --git a/postman/collection-dir/zen/Flow Testcases/QuickStart/Payment Connector - Create/request.json b/postman/collection-dir/zen/Flow Testcases/QuickStart/Payment Connector - Create/request.json index 4872b4a79f6..4d8d2f19ed0 100644 --- a/postman/collection-dir/zen/Flow Testcases/QuickStart/Payment Connector - Create/request.json +++ b/postman/collection-dir/zen/Flow Testcases/QuickStart/Payment Connector - Create/request.json @@ -73,14 +73,8 @@ }, "url": { "raw": "{{baseUrl}}/account/:account_id/connectors", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - ":account_id", - "connectors" - ], + "host": ["{{baseUrl}}"], + "path": ["account", ":account_id", "connectors"], "variable": [ { "key": "account_id", diff --git a/postman/collection-dir/zen/Flow Testcases/QuickStart/Payments - Create/.event.meta.json b/postman/collection-dir/zen/Flow Testcases/QuickStart/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/zen/Flow Testcases/QuickStart/Payments - Create/.event.meta.json +++ b/postman/collection-dir/zen/Flow Testcases/QuickStart/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/zen/Flow Testcases/QuickStart/Payments - Create/event.test.js b/postman/collection-dir/zen/Flow Testcases/QuickStart/Payments - Create/event.test.js index 62142d52dca..a6947db94c0 100644 --- a/postman/collection-dir/zen/Flow Testcases/QuickStart/Payments - Create/event.test.js +++ b/postman/collection-dir/zen/Flow Testcases/QuickStart/Payments - Create/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/zen/Flow Testcases/QuickStart/Payments - Create/request.json b/postman/collection-dir/zen/Flow Testcases/QuickStart/Payments - Create/request.json index 402e3f58636..ee354325323 100644 --- a/postman/collection-dir/zen/Flow Testcases/QuickStart/Payments - Create/request.json +++ b/postman/collection-dir/zen/Flow Testcases/QuickStart/Payments - Create/request.json @@ -101,12 +101,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/zen/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json b/postman/collection-dir/zen/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/zen/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json +++ b/postman/collection-dir/zen/Flow Testcases/QuickStart/Payments - Retrieve/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/zen/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js b/postman/collection-dir/zen/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js index 4dd072b2222..d0a02af7436 100644 --- a/postman/collection-dir/zen/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/zen/Flow Testcases/QuickStart/Payments - Retrieve/event.test.js @@ -1,44 +1,61 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[GET]::/payments/:id - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[GET]::/payments/:id - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // 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.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} diff --git a/postman/collection-dir/zen/Flow Testcases/QuickStart/Payments - Retrieve/request.json b/postman/collection-dir/zen/Flow Testcases/QuickStart/Payments - Retrieve/request.json index c71774083b2..ef0b213739d 100644 --- a/postman/collection-dir/zen/Flow Testcases/QuickStart/Payments - Retrieve/request.json +++ b/postman/collection-dir/zen/Flow Testcases/QuickStart/Payments - Retrieve/request.json @@ -8,13 +8,8 @@ ], "url": { "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json +++ b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js index e9dd0a7e18a..725102a94cb 100644 --- a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js +++ b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/event.test.js @@ -1,54 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 "invalid_request 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"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json index ad281c58256..9cbdbc8e22f 100644 --- a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json +++ b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json +++ b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js index dc599602940..725102a94cb 100644 --- a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js +++ b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/event.test.js @@ -1,56 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); - // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "next_action.redirect_to_url" -pm.test("[POST]::/payments - 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 "invalid_request 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"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json index 99a24fb4f26..8a9df91718d 100644 --- a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json +++ b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json +++ b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js index 0e6401222ff..52680771c31 100644 --- a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js +++ b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/event.test.js @@ -1,55 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 - Content check if value for 'error.type' matches 'connector_error'", function() { - pm.expect(jsonData.error.type).to.eql("connector_error"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'", + function () { + pm.expect(jsonData.error.type).to.eql("connector_error"); + }, + ); +} diff --git a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json index 0a16b975817..c7ad4cb2749 100644 --- a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json +++ b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json @@ -75,12 +75,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json +++ b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js index 4c6ae2dd574..c7b67c24003 100644 --- a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js +++ b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/event.test.js @@ -1,55 +1,76 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + pm.response.to.be.error; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "error" -pm.test("[POST]::/payments - 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 "invalid_request 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"); -})}; \ No newline at end of file + pm.test( + "[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'", + function () { + pm.expect(jsonData.error.type).to.eql("invalid_request"); + }, + ); +} diff --git a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json index e9f6c05aab2..df6746f6032 100644 --- a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json +++ b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json @@ -77,12 +77,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json index 90b19864ee1..f2bee31ef66 100644 --- a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json +++ b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/.meta.json @@ -1,6 +1,3 @@ { - "childrenOrder": [ - "Payments - Create", - "Payments - Confirm" - ] + "childrenOrder": ["Payments - Create", "Payments - Confirm"] } diff --git a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json +++ b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js index 1e8ba8cc3a6..e8d6b2216c5 100644 --- a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js +++ b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js @@ -1,58 +1,82 @@ -// Validate status 4xx +// Validate status 4xx pm.test("[POST]::/payments - Status code is 4xx", function () { - pm.response.to.be.error; + 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"); -}); - - +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 +// Validate if response has JSON Body pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); - // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have "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/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"); -})}; \ No newline at end of file + 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"); + }, + ); +} diff --git a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json index 2c59bd1ffca..b1ca53a889a 100644 --- a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json +++ b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/request.json @@ -1,4 +1,24 @@ { + "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": [ { @@ -18,6 +38,7 @@ } }, "raw_json_formatted": { + "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", @@ -34,14 +55,8 @@ }, "url": { "raw": "{{baseUrl}}/payments/:id/confirm", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id", - "confirm" - ], + "host": ["{{baseUrl}}"], + "path": ["payments", ":id", "confirm"], "variable": [ { "key": "id", diff --git a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json +++ b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js index eecbfd020ff..0444324000a 100644 --- a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js +++ b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/event.test.js @@ -1,49 +1,71 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json", + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id, + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id, + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret, + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + ); +} // Response body should have value "requires_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 - Content check if value for 'status' matches 'requires_payment_method'", + function () { + pm.expect(jsonData.status).to.eql("requires_payment_method"); + }, + ); +} diff --git a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json index e460432249b..c2d7c7bf9c0 100644 --- a/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json +++ b/postman/collection-dir/zen/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Create/request.json @@ -84,12 +84,8 @@ }, "url": { "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "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" } diff --git a/postman/collection-dir/zen/Health check/.meta.json b/postman/collection-dir/zen/Health check/.meta.json index 66ee7e50cab..579f9fd541c 100644 --- a/postman/collection-dir/zen/Health check/.meta.json +++ b/postman/collection-dir/zen/Health check/.meta.json @@ -1,5 +1,3 @@ { - "childrenOrder": [ - "New Request" - ] + "childrenOrder": ["New Request"] } diff --git a/postman/collection-dir/zen/Health check/New Request/.event.meta.json b/postman/collection-dir/zen/Health check/New Request/.event.meta.json index 688c85746ef..0731450e6b2 100644 --- a/postman/collection-dir/zen/Health check/New Request/.event.meta.json +++ b/postman/collection-dir/zen/Health check/New Request/.event.meta.json @@ -1,5 +1,3 @@ { - "eventOrder": [ - "event.test.js" - ] + "eventOrder": ["event.test.js"] } diff --git a/postman/collection-dir/zen/Health check/New Request/event.test.js b/postman/collection-dir/zen/Health check/New Request/event.test.js index 325a8c8a479..b490b8be090 100644 --- a/postman/collection-dir/zen/Health check/New Request/event.test.js +++ b/postman/collection-dir/zen/Health check/New Request/event.test.js @@ -1,4 +1,4 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/accounts - Status code is 2xx", function () { - pm.response.to.be.success; -}); \ No newline at end of file + pm.response.to.be.success; +}); diff --git a/postman/collection-dir/zen/Health check/New Request/request.json b/postman/collection-dir/zen/Health check/New Request/request.json index 7a5b11d3a33..9b836ff05cb 100644 --- a/postman/collection-dir/zen/Health check/New Request/request.json +++ b/postman/collection-dir/zen/Health check/New Request/request.json @@ -13,11 +13,7 @@ ], "url": { "raw": "{{baseUrl}}/health", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "health" - ] + "host": ["{{baseUrl}}"], + "path": ["health"] } } diff --git a/postman/collection-dir/zen/event.test.js b/postman/collection-dir/zen/event.test.js index 69037688f22..fb52caec30f 100644 --- a/postman/collection-dir/zen/event.test.js +++ b/postman/collection-dir/zen/event.test.js @@ -1,11 +1,13 @@ // 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("[LOG]::payment_id - " + jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log("[LOG]::payment_id - " + jsonData.payment_id); } -console.log("[LOG]::x-request-id - " + pm.response.headers.get('x-request-id')); \ No newline at end of file +console.log("[LOG]::x-request-id - " + pm.response.headers.get("x-request-id"));
ci
Modify confirm call to use client-secret instead of relying on API calls (#2127)
0fa8ad1b7c27010bf83e4035de9881d29e192e8a
2023-11-27 15:58:36
Sanchith Hegde
docs(try_local_system): add instructions to run using Docker Compose by pulling standalone images (#2984)
false
diff --git a/README.md b/README.md index e820b93e63c..db8e820ef14 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,6 @@ <img src="./docs/imgs/hyperswitch-logo-light.svg#gh-light-mode-only" alt="Hyperswitch-Logo" width="40%" /> </p> - <h1 align="center">The open-source payments switch</h1> <div align="center" > @@ -35,7 +34,6 @@ The single API to access payment ecosystems across 130+ countries</div> </a> </p> - <hr> <img src="./docs/imgs/switch.png" /> @@ -57,14 +55,14 @@ Using Hyperswitch, you can: <h2 id="Quick Start Guide">⚡️ Quick Start Guide</h2> </a> -<h3> One-click deployment on AWS cloud </h3> +### One-click deployment on AWS cloud -The fastest and easiest way to try hyperswitch is via our CDK scripts +The fastest and easiest way to try Hyperswitch is via our CDK scripts 1. Click on the following button for a quick standalone deployment on AWS, suitable for prototyping. No code or setup is required in your system and the deployment is covered within the AWS free-tier setup. -&emsp;&emsp; <a href="https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/new?stackName=HyperswitchBootstarp&templateURL=https://hyperswitch-synth.s3.eu-central-1.amazonaws.com/hs-starter-config.yaml"><img src="./docs/imgs/aws_button.png" height="35"></a> + <a href="https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/new?stackName=HyperswitchBootstarp&templateURL=https://hyperswitch-synth.s3.eu-central-1.amazonaws.com/hs-starter-config.yaml"><img src="./docs/imgs/aws_button.png" height="35"></a> 2. Sign-in to your AWS console. @@ -72,12 +70,27 @@ The fastest and easiest way to try hyperswitch is via our CDK scripts For an early access to the production-ready setup fill this <a href="https://forms.gle/v6ru55XDZFufVPnu9">Early Access Form</a> +### Run it on your system + +You can run Hyperswitch on your system using Docker Compose after cloning this repository: + +```shell +docker compose up -d +``` + +This will start the payments router, the primary component within Hyperswitch. + +Check out the [local setup guide][local-setup-guide] for a more comprehensive +setup, which includes the [scheduler and monitoring services][docker-compose-scheduler-monitoring]. + +[local-setup-guide]: /docs/try_local_system.md +[docker-compose-scheduler-monitoring]: /docs/try_local_system.md#run-the-scheduler-and-monitoring-services + <a href="#Fast-Integration-for-Stripe-Users"> <h2 id="Fast Integration for Stripe Users">🔌 Fast Integration for Stripe Users</h2> </a> -If you are already using Stripe, integrating with Hyperswitch is fun, fast & -easy. +If you are already using Stripe, integrating with Hyperswitch is fun, fast & easy. Try the steps below to get a feel for how quick the setup is: 1. Get API keys from our [dashboard]. @@ -96,9 +109,7 @@ Try the steps below to get a feel for how quick the setup is: As of Sept 2023, we support 50+ payment processors and multiple global payment methods. In addition, we are continuously integrating new processors based on their reach and community requests. Our target is to support 100+ processors by H2 2023. -You can find the latest list of payment processors, supported methods, and -features -[here][supported-connectors-and-features]. +You can find the latest list of payment processors, supported methods, and features [here][supported-connectors-and-features]. [supported-connectors-and-features]: https://hyperswitch.io/pm-list @@ -252,12 +263,11 @@ We welcome contributions from the community. Please read through our Included are directions for opening issues, coding standards, and notes on development. -- We appreciate all types of contributions: code, documentation, demo creation, or something new way you want to contribute to us. We will reward every contribution with a Hyperswitch branded t-shirt. -- 🦀 **Important note for Rust developers**: We aim for contributions from the community -across a broad range of tracks. Hence, we have prioritised simplicity and code -readability over purely idiomatic code. For example, some of the code in core -functions (e.g., `payments_core`) is written to be more readable than -pure-idiomatic. +- We appreciate all types of contributions: code, documentation, demo creation, or some new way you want to contribute to us. + We will reward every contribution with a Hyperswitch branded t-shirt. +- 🦀 **Important note for Rust developers**: We aim for contributions from the community across a broad range of tracks. + Hence, we have prioritised simplicity and code readability over purely idiomatic code. + For example, some of the code in core functions (e.g., `payments_core`) is written to be more readable than pure-idiomatic. <a href="#Community"> <h2 id="Community">👥 Community</h2> @@ -269,7 +279,6 @@ Get updates on Hyperswitch development and chat with the community: - [Slack workspace][slack] for questions related to integrating hyperswitch, integrating a connector in hyperswitch, etc. - [GitHub Discussions][github-discussions] to drop feature requests or suggest anything payments-related you need for your stack. -[blog]: https://hyperswitch.io/blog [discord]: https://discord.gg/wJZ7DVW8mm [slack]: https://join.slack.com/t/hyperswitch-io/shared_invite/zt-1k6cz4lee-SAJzhz6bjmpp4jZCDOtOIg [github-discussions]: https://github.com/juspay/hyperswitch/discussions @@ -314,7 +323,6 @@ Check the [CHANGELOG.md](./CHANGELOG.md) file for details. This product is licensed under the [Apache 2.0 License](LICENSE). - <a href="#Thanks to all contributors"> <h2 id="Thanks to all contributors">✨ Thanks to all contributors</h2> </a> diff --git a/docker-compose-development.yml b/docker-compose-development.yml new file mode 100644 index 00000000000..500f397cfa3 --- /dev/null +++ b/docker-compose-development.yml @@ -0,0 +1,301 @@ +version: "3.8" + +volumes: + cargo_cache: + pg_data: + router_build_cache: + scheduler_build_cache: + drainer_build_cache: + redisinsight_store: + +networks: + router_net: + +services: + ### Dependencies + pg: + image: postgres:latest + ports: + - "5432:5432" + networks: + - router_net + volumes: + - pg_data:/VAR/LIB/POSTGRESQL/DATA + environment: + - POSTGRES_USER=db_user + - POSTGRES_PASSWORD=db_pass + - POSTGRES_DB=hyperswitch_db + + redis-standalone: + image: redis:7 + labels: + - redis + networks: + - router_net + ports: + - "6379" + + migration_runner: + image: rust:latest + command: "bash -c 'cargo install diesel_cli --no-default-features --features postgres && diesel migration --database-url postgres://$${DATABASE_USER}:$${DATABASE_PASSWORD}@$${DATABASE_HOST}:$${DATABASE_PORT}/$${DATABASE_NAME} run'" + working_dir: /app + networks: + - router_net + volumes: + - ./:/app + environment: + - DATABASE_USER=db_user + - DATABASE_PASSWORD=db_pass + - DATABASE_HOST=pg + - DATABASE_PORT=5432 + - DATABASE_NAME=hyperswitch_db + + ### Application services + hyperswitch-server: + image: rust:latest + command: cargo run --bin router -- -f ./config/docker_compose.toml + working_dir: /app + ports: + - "8080:8080" + networks: + - router_net + volumes: + - ./:/app + - cargo_cache:/cargo_cache + - router_build_cache:/cargo_build_cache + environment: + - CARGO_HOME=/cargo_cache + - CARGO_TARGET_DIR=/cargo_build_cache + labels: + logs: "promtail" + healthcheck: + test: curl --fail http://localhost:8080/health || exit 1 + interval: 120s + retries: 4 + start_period: 20s + timeout: 10s + + hyperswitch-producer: + image: rust:latest + command: cargo run --bin scheduler -- -f ./config/docker_compose.toml + working_dir: /app + networks: + - router_net + profiles: + - scheduler + volumes: + - ./:/app + - cargo_cache:/cargo_cache + - scheduler_build_cache:/cargo_build_cache + environment: + - CARGO_HOME=/cargo_cache + - CARGO_TARGET_DIR=/cargo_build_cache + - SCHEDULER_FLOW=producer + depends_on: + hyperswitch-consumer: + condition: service_healthy + labels: + logs: "promtail" + + hyperswitch-consumer: + image: rust:latest + command: cargo run --bin scheduler -- -f ./config/docker_compose.toml + working_dir: /app + networks: + - router_net + profiles: + - scheduler + volumes: + - ./:/app + - cargo_cache:/cargo_cache + - scheduler_build_cache:/cargo_build_cache + environment: + - CARGO_HOME=/cargo_cache + - CARGO_TARGET_DIR=/cargo_build_cache + - SCHEDULER_FLOW=consumer + depends_on: + hyperswitch-server: + condition: service_started + labels: + logs: "promtail" + healthcheck: + test: (ps -e | grep scheduler) || exit 1 + interval: 120s + retries: 4 + start_period: 30s + timeout: 10s + + hyperswitch-drainer: + image: rust:latest + command: cargo run --bin drainer -- -f ./config/docker_compose.toml + working_dir: /app + deploy: + replicas: ${DRAINER_INSTANCE_COUNT:-1} + networks: + - router_net + profiles: + - full_kv + volumes: + - ./:/app + - cargo_cache:/cargo_cache + - drainer_build_cache:/cargo_build_cache + environment: + - CARGO_HOME=/cargo_cache + - CARGO_TARGET_DIR=/cargo_build_cache + restart: unless-stopped + depends_on: + hyperswitch-server: + condition: service_started + labels: + logs: "promtail" + + ### Clustered Redis setup + redis-cluster: + image: redis:7 + deploy: + replicas: ${REDIS_CLUSTER_COUNT:-3} + command: redis-server /usr/local/etc/redis/redis.conf + profiles: + - clustered_redis + volumes: + - ./config/redis.conf:/usr/local/etc/redis/redis.conf + labels: + - redis + networks: + - router_net + ports: + - "6379" + - "16379" + + redis-init: + image: redis:7 + profiles: + - clustered_redis + depends_on: + - redis-cluster + networks: + - router_net + command: "bash -c 'export COUNT=${REDIS_CLUSTER_COUNT:-3} + + \ if [ $$COUNT -lt 3 ] + + \ then + + \ echo \"Minimum 3 nodes are needed for redis cluster\" + + \ exit 1 + + \ fi + + \ HOSTS=\"\" + + \ for ((c=1; c<=$$COUNT;c++)) + + \ do + + \ NODE=$COMPOSE_PROJECT_NAME-redis-cluster-$$c:6379 + + \ echo $$NODE + + \ HOSTS=\"$$HOSTS $$NODE\" + + \ done + + \ echo Creating a cluster with $$HOSTS + + \ redis-cli --cluster create $$HOSTS --cluster-yes + + \ '" + + ### Monitoring + grafana: + image: grafana/grafana:latest + ports: + - "3000:3000" + networks: + - router_net + profiles: + - monitoring + restart: unless-stopped + environment: + - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin + - GF_AUTH_ANONYMOUS_ENABLED=true + - GF_AUTH_BASIC_ENABLED=false + volumes: + - ./config/grafana.ini:/etc/grafana/grafana.ini + - ./config/grafana-datasource.yaml:/etc/grafana/provisioning/datasources/datasource.yml + + promtail: + image: grafana/promtail:latest + volumes: + - ./logs:/var/log/router + - ./config:/etc/promtail + - /var/run/docker.sock:/var/run/docker.sock + command: -config.file=/etc/promtail/promtail.yaml + profiles: + - monitoring + networks: + - router_net + + loki: + image: grafana/loki:latest + ports: + - "3100" + command: -config.file=/etc/loki/loki.yaml + networks: + - router_net + profiles: + - monitoring + volumes: + - ./config:/etc/loki + + otel-collector: + image: otel/opentelemetry-collector-contrib:latest + command: --config=/etc/otel-collector.yaml + networks: + - router_net + profiles: + - monitoring + volumes: + - ./config/otel-collector.yaml:/etc/otel-collector.yaml + ports: + - "4317" + - "8888" + - "8889" + + prometheus: + image: prom/prometheus:latest + networks: + - router_net + profiles: + - monitoring + volumes: + - ./config/prometheus.yaml:/etc/prometheus/prometheus.yml + ports: + - "9090" + restart: unless-stopped + + tempo: + image: grafana/tempo:latest + command: -config.file=/etc/tempo.yaml + volumes: + - ./config/tempo.yaml:/etc/tempo.yaml + networks: + - router_net + profiles: + - monitoring + ports: + - "3200" # tempo + - "4317" # otlp grpc + restart: unless-stopped + + redis-insight: + image: redislabs/redisinsight:latest + networks: + - router_net + profiles: + - full_kv + ports: + - "8001:8001" + volumes: + - redisinsight_store:/db diff --git a/docker-compose.yml b/docker-compose.yml index f4dce575132..fd18906143f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,76 +1,16 @@ -version: "3.7" +version: "3.8" volumes: - cargo_cache: pg_data: - cargo_build_cache: - p_cargo_build_cache: - c_cargo_build_cache: redisinsight_store: - networks: router_net: - services: - promtail: - image: grafana/promtail:latest - volumes: - - ./logs:/var/log/router - - ./config:/etc/promtail - - /var/run/docker.sock:/var/run/docker.sock - command: -config.file=/etc/promtail/promtail.yaml - profiles: - - monitoring - networks: - - router_net - - loki: - image: grafana/loki:latest - ports: - - "3100" - command: -config.file=/etc/loki/loki.yaml - networks: - - router_net - profiles: - - monitoring - volumes: - - ./config:/etc/loki - - otel-collector: - image: otel/opentelemetry-collector-contrib:latest - command: --config=/etc/otel-collector.yaml - networks: - - router_net - profiles: - - monitoring - volumes: - - ./config/otel-collector.yaml:/etc/otel-collector.yaml - ports: - - "4317" - - "8888" - - "8889" - - grafana: - image: grafana/grafana:latest - ports: - - "3000:3000" - networks: - - router_net - profiles: - - monitoring - restart: unless-stopped - environment: - - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin - - GF_AUTH_ANONYMOUS_ENABLED=true - - GF_AUTH_BASIC_ENABLED=false - volumes: - - ./config/grafana.ini:/etc/grafana/grafana.ini - - ./config/grafana-datasource.yaml:/etc/grafana/provisioning/datasources/datasource.yml - + ### Dependencies pg: - image: postgres:14.5 + image: postgres:latest ports: - "5432:5432" networks: @@ -82,52 +22,59 @@ services: - POSTGRES_PASSWORD=db_pass - POSTGRES_DB=hyperswitch_db + redis-standalone: + image: redis:7 + labels: + - redis + networks: + - router_net + ports: + - "6379" + migration_runner: - image: rust:1.70 - command: "bash -c 'cargo install diesel_cli --no-default-features --features \"postgres\" && diesel migration --database-url postgres://db_user:db_pass@pg:5432/hyperswitch_db run'" + image: rust:latest + command: "bash -c 'cargo install diesel_cli --no-default-features --features postgres && diesel migration --database-url postgres://$${DATABASE_USER}:$${DATABASE_PASSWORD}@$${DATABASE_HOST}:$${DATABASE_PORT}/$${DATABASE_NAME} run'" working_dir: /app networks: - router_net volumes: - ./:/app + environment: + - DATABASE_USER=db_user + - DATABASE_PASSWORD=db_pass + - DATABASE_HOST=pg + - DATABASE_PORT=5432 + - DATABASE_NAME=hyperswitch_db + ### Application services hyperswitch-server: - image: rust:1.70 - command: cargo run -- -f ./config/docker_compose.toml - working_dir: /app + image: juspaydotin/hyperswitch-router:standalone + command: /local/bin/router -f /local/config/docker_compose.toml ports: - "8080:8080" networks: - router_net volumes: - - ./:/app - - cargo_cache:/cargo_cache - - cargo_build_cache:/cargo_build_cache - environment: - - CARGO_TARGET_DIR=/cargo_build_cache + - ./config:/local/config labels: logs: "promtail" healthcheck: test: curl --fail http://localhost:8080/health || exit 1 - interval: 100s + interval: 10s retries: 3 - start_period: 20s + start_period: 5s timeout: 10s hyperswitch-producer: - image: rust:1.70 - command: cargo run --bin scheduler -- -f ./config/docker_compose.toml - working_dir: /app + image: juspaydotin/hyperswitch-producer:standalone + command: /local/bin/scheduler -f /local/config/docker_compose.toml networks: - router_net profiles: - scheduler volumes: - - ./:/app - - cargo_cache:/cargo_cache - - p_cargo_build_cache:/cargo_build_cache + - ./config:/local/config environment: - - CARGO_TARGET_DIR=/cargo_build_cache - SCHEDULER_FLOW=producer depends_on: hyperswitch-consumer: @@ -136,39 +83,54 @@ services: logs: "promtail" hyperswitch-consumer: - image: rust:1.70 - command: cargo run --bin scheduler -- -f ./config/docker_compose.toml - working_dir: /app + image: juspaydotin/hyperswitch-consumer:standalone + command: /local/bin/scheduler -f /local/config/docker_compose.toml networks: - router_net profiles: - scheduler volumes: - - ./:/app - - cargo_cache:/cargo_cache - - c_cargo_build_cache:/cargo_build_cache + - ./config:/local/config environment: - - CARGO_TARGET_DIR=/cargo_build_cache - SCHEDULER_FLOW=consumer depends_on: hyperswitch-server: condition: service_started - labels: logs: "promtail" - healthcheck: test: (ps -e | grep scheduler) || exit 1 - interval: 120s + interval: 10s retries: 3 - start_period: 30s + start_period: 5s timeout: 10s + hyperswitch-drainer: + image: juspaydotin/hyperswitch-drainer:standalone + command: /local/bin/drainer -f /local/config/docker_compose.toml + deploy: + replicas: ${DRAINER_INSTANCE_COUNT:-1} + networks: + - router_net + profiles: + - full_kv + volumes: + - ./config:/local/config + restart: unless-stopped + depends_on: + hyperswitch-server: + condition: service_started + labels: + logs: "promtail" + + ### Clustered Redis setup redis-cluster: image: redis:7 deploy: replicas: ${REDIS_CLUSTER_COUNT:-3} command: redis-server /usr/local/etc/redis/redis.conf + profiles: + - clustered_redis volumes: - ./config/redis.conf:/usr/local/etc/redis/redis.conf labels: @@ -179,17 +141,10 @@ services: - "6379" - "16379" - redis-standalone: - image: redis:7 - labels: - - redis - networks: - - router_net - ports: - - "6379" - redis-init: image: redis:7 + profiles: + - clustered_redis depends_on: - redis-cluster networks: @@ -226,16 +181,62 @@ services: \ '" - redis-insight: - image: redislabs/redisinsight:latest + ### Monitoring + grafana: + image: grafana/grafana:latest + ports: + - "3000:3000" networks: - router_net profiles: - - full_kv + - monitoring + restart: unless-stopped + environment: + - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin + - GF_AUTH_ANONYMOUS_ENABLED=true + - GF_AUTH_BASIC_ENABLED=false + volumes: + - ./config/grafana.ini:/etc/grafana/grafana.ini + - ./config/grafana-datasource.yaml:/etc/grafana/provisioning/datasources/datasource.yml + + promtail: + image: grafana/promtail:latest + volumes: + - ./logs:/var/log/router + - ./config:/etc/promtail + - /var/run/docker.sock:/var/run/docker.sock + command: -config.file=/etc/promtail/promtail.yaml + profiles: + - monitoring + networks: + - router_net + + loki: + image: grafana/loki:latest ports: - - "8001:8001" + - "3100" + command: -config.file=/etc/loki/loki.yaml + networks: + - router_net + profiles: + - monitoring volumes: - - redisinsight_store:/db + - ./config:/etc/loki + + otel-collector: + image: otel/opentelemetry-collector-contrib:latest + command: --config=/etc/otel-collector.yaml + networks: + - router_net + profiles: + - monitoring + volumes: + - ./config/otel-collector.yaml:/etc/otel-collector.yaml + ports: + - "4317" + - "8888" + - "8889" + prometheus: image: prom/prometheus:latest networks: @@ -261,25 +262,14 @@ services: - "3200" # tempo - "4317" # otlp grpc restart: unless-stopped - hyperswitch-drainer: - image: rust:1.70 - command: cargo run --bin drainer -- -f ./config/docker_compose.toml - working_dir: /app - deploy: - replicas: ${DRAINER_INSTANCE_COUNT:-1} + + redis-insight: + image: redislabs/redisinsight:latest networks: - router_net profiles: - full_kv + ports: + - "8001:8001" volumes: - - ./:/app - - cargo_cache:/cargo_cache - - cargo_build_cache:/cargo_build_cache - environment: - - CARGO_TARGET_DIR=/cargo_build_cache - restart: unless-stopped - depends_on: - hyperswitch-server: - condition: service_started - labels: - logs: "promtail" + - redisinsight_store:/db diff --git a/docs/try_local_system.md b/docs/try_local_system.md index 59df43f2481..a9cd080f26d 100644 --- a/docs/try_local_system.md +++ b/docs/try_local_system.md @@ -1,23 +1,20 @@ # Try out hyperswitch on your system -**NOTE:** -This guide is aimed at users and developers who wish to set up hyperswitch on -their local systems and requires quite some time and effort. -If you'd prefer trying out hyperswitch quickly without the hassle of setting up -all dependencies, you can [try out hyperswitch sandbox environment][try-sandbox]. - -There are two options to set up hyperswitch on your system: - -1. Use Docker Compose -2. Set up a Rust environment and other dependencies on your system +The simplest way to run hyperswitch locally is +[with Docker Compose](#run-hyperswitch-using-docker-compose) by pulling the +latest images from Docker Hub. +However, if you're willing to modify the code and run it, or are a developer +contributing to hyperswitch, then you can either +[set up a development environment using Docker Compose](#set-up-a-development-environment-using-docker-compose), +or [set up a Rust environment on your system](#set-up-a-rust-environment-and-other-dependencies). Check the Table Of Contents to jump to the relevant section. -[try-sandbox]: ./try_sandbox.md - **Table Of Contents:** -- [Set up hyperswitch using Docker Compose](#set-up-hyperswitch-using-docker-compose) +- [Run hyperswitch using Docker Compose](#run-hyperswitch-using-docker-compose) + - [Run the scheduler and monitoring services](#run-the-scheduler-and-monitoring-services) +- [Set up a development environment using Docker Compose](#set-up-a-development-environment-using-docker-compose) - [Set up a Rust environment and other dependencies](#set-up-a-rust-environment-and-other-dependencies) - [Set up dependencies on Ubuntu-based systems](#set-up-dependencies-on-ubuntu-based-systems) - [Set up dependencies on Windows (Ubuntu on WSL2)](#set-up-dependencies-on-windows-ubuntu-on-wsl2) @@ -33,7 +30,7 @@ Check the Table Of Contents to jump to the relevant section. - [Create a Payment](#create-a-payment) - [Create a Refund](#create-a-refund) -## Set up hyperswitch using Docker Compose +## Run hyperswitch using Docker Compose 1. Install [Docker Compose][docker-compose-install]. 2. Clone the repository and switch to the project directory: @@ -54,15 +51,15 @@ Check the Table Of Contents to jump to the relevant section. docker compose up -d ``` -5. Run database migrations: - - ```shell - docker compose run hyperswitch-server bash -c \ - "cargo install diesel_cli && \ - diesel migration --database-url postgres://db_user:db_pass@pg:5432/hyperswitch_db run" - ``` + This should run the hyperswitch payments router, the primary component within + hyperswitch. + Wait for the `migration_runner` container to finish installing `diesel_cli` + and running migrations (approximately 2 minutes) before proceeding further. + You can also choose to + [run the scheduler and monitoring services](#run-the-scheduler-and-monitoring-services) + in addition to the payments router. -6. Verify that the server is up and running by hitting the health endpoint: +5. Verify that the server is up and running by hitting the health endpoint: ```shell curl --head --request GET 'http://localhost:8080/health' @@ -71,9 +68,86 @@ Check the Table Of Contents to jump to the relevant section. If the command returned a `200 OK` status code, proceed with [trying out our APIs](#try-out-our-apis). +### Run the scheduler and monitoring services + +You can run the scheduler and monitoring services by specifying suitable profile +names to the above Docker Compose command. +To understand more about the hyperswitch architecture and the components +involved, check out the [architecture document][architecture]. + +- To run the scheduler components (consumer and producer), you can specify + `--profile scheduler`: + + ```shell + docker compose --profile scheduler up -d + ``` + +- To run the monitoring services (Grafana, Promtail, Loki, Prometheus and Tempo), + you can specify `--profile monitoring`: + + ```shell + docker compose --profile monitoring up -d + ``` + + You can then access Grafana at `http://localhost:3000` and view application + logs using the "Explore" tab, select Loki as the data source, and select the + container to query logs from. + +- You can also specify multiple profile names by specifying the `--profile` flag + multiple times. + To run both the scheduler components and monitoring services, the Docker + Compose command would be: + + ```shell + docker compose --profile scheduler --profile monitoring up -d + ``` + +Once the services have been confirmed to be up and running, you can proceed with +[trying out our APIs](#try-out-our-apis) + [docker-compose-install]: https://docs.docker.com/compose/install/ [docker-compose-config]: /config/docker_compose.toml [docker-compose-yml]: /docker-compose.yml +[architecture]: /docs/architecture.md + +## Set up a development environment using Docker Compose + +1. Install [Docker Compose][docker-compose-install]. +2. Clone the repository and switch to the project directory: + + ```shell + git clone https://github.com/juspay/hyperswitch + cd hyperswitch + ``` + +3. (Optional) Configure the application using the + [`config/docker_compose.toml`][docker-compose-config] file. + The provided configuration should work as is. + If you do update the `docker_compose.toml` file, ensure to also update the + corresponding values in the [`docker-compose.yml`][docker-compose-yml] file. +4. Start all the services using Docker Compose: + + ```shell + docker compose --file docker-compose-development.yml up -d + ``` + + This will compile the payments router, the primary component within + hyperswitch and then start it. + Depending on the specifications of your machine, compilation can take + around 15 minutes. + +5. (Optional) You can also choose to + [start the scheduler and/or monitoring services](#run-the-scheduler-and-monitoring-services) + in addition to the payments router. + +6. Verify that the server is up and running by hitting the health endpoint: + + ```shell + curl --head --request GET 'http://localhost:8080/health' + ``` + + If the command returned a `200 OK` status code, proceed with + [trying out our APIs](#try-out-our-apis). ## Set up a Rust environment and other dependencies @@ -134,7 +208,7 @@ for your distribution and follow along. 4. Install `diesel_cli` using `cargo`: ```shell - cargo install diesel_cli --no-default-features --features "postgres" + cargo install diesel_cli --no-default-features --features postgres ``` 5. Make sure your system has the `pkg-config` package and OpenSSL installed: @@ -224,7 +298,7 @@ packages for your distribution and follow along. 6. Install `diesel_cli` using `cargo`: ```shell - cargo install diesel_cli --no-default-features --features "postgres" + cargo install diesel_cli --no-default-features --features postgres ``` 7. Make sure your system has the `pkg-config` package and OpenSSL installed: @@ -260,7 +334,7 @@ You can opt to use your favorite package manager instead. 4. Install `diesel_cli` using `cargo`: ```shell - cargo install diesel_cli --no-default-features --features "postgres" + cargo install diesel_cli --no-default-features --features postgres ``` 5. Install OpenSSL with `winget`: @@ -322,7 +396,7 @@ You can opt to use your favorite package manager instead. 4. Install `diesel_cli` using `cargo`: ```shell - cargo install diesel_cli --no-default-features --features "postgres" + cargo install diesel_cli --no-default-features --features postgres ``` If linking `diesel_cli` fails due to missing `libpq` (if the error message is @@ -333,7 +407,7 @@ You can opt to use your favorite package manager instead. brew install libpq export PQ_LIB_DIR="$(brew --prefix libpq)/lib" - cargo install diesel_cli --no-default-features --features "postgres" + cargo install diesel_cli --no-default-features --features postgres ``` You may also choose to persist the value of `PQ_LIB_DIR` in your shell
docs
add instructions to run using Docker Compose by pulling standalone images (#2984)
e1b894770f3d37c2a255d3cec1d58ec71ba29c78
2024-03-11 05:49:23
github-actions
chore(version): 2024.03.11.0
false
diff --git a/CHANGELOG.md b/CHANGELOG.md index cc07e5f63de..0b135c61a50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,19 @@ All notable changes to HyperSwitch will be documented here. - - - +## 2024.03.11.0 + +### Features + +- **connector:** + - Add threedsecureio three_ds authentication connector ([#4004](https://github.com/juspay/hyperswitch/pull/4004)) ([`06c3096`](https://github.com/juspay/hyperswitch/commit/06c30967cf626e7406aa9be8643fb73288aae383)) + - [Checkout] add support for external authentication for checkout connector ([#4006](https://github.com/juspay/hyperswitch/pull/4006)) ([`142a22c`](https://github.com/juspay/hyperswitch/commit/142a22c752a7c623cee62a6d552e6ffda73df777)) +- **router:** Add payments authentication api flow ([#3996](https://github.com/juspay/hyperswitch/pull/3996)) ([`41556ba`](https://github.com/juspay/hyperswitch/commit/41556baed98c59373e0a053c023c32f2f7346b51)) + +**Full Changelog:** [`2024.03.09.0...2024.03.11.0`](https://github.com/juspay/hyperswitch/compare/2024.03.09.0...2024.03.11.0) + +- - - + ## 2024.03.09.0 ### Features
chore
2024.03.11.0
5cdfe8325481909a8a1596f967303eff44ffbcec
2025-03-11 19:50:42
Sakil Mostak
fix(router): pass card network for external 3DS from additional_payment_method_data (#7473)
false
diff --git a/crates/common_enums/src/connector_enums.rs b/crates/common_enums/src/connector_enums.rs index e58d934a56b..f3cdd233544 100644 --- a/crates/common_enums/src/connector_enums.rs +++ b/crates/common_enums/src/connector_enums.rs @@ -443,8 +443,9 @@ impl Connector { | Self::Netcetera | Self::CtpMastercard | Self::Noon - | Self::Stripe => false, - Self::Checkout | Self::Nmi |Self::Datatrans|Self::Cybersource => true, + | Self::Stripe + | Self::Datatrans => false, + Self::Checkout | Self::Nmi |Self::Cybersource => true, } } diff --git a/crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs b/crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs index fe0e207bc3d..ea5d9b25f84 100644 --- a/crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs +++ b/crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs @@ -1228,11 +1228,21 @@ impl let bill_to = build_bill_to(item.router_data.get_optional_billing(), email)?; let order_information = OrderInformationWithBill::from((item, Some(bill_to))); - let card_type = match ccard - .card_network - .clone() - .and_then(get_cybersource_card_type) - { + let additional_card_network = item + .router_data + .request + .get_card_network_from_additional_payment_method_data() + .map_err(|err| { + router_env::logger::info!( + "Error while getting card network from additional payment method data: {}", + err + ); + }) + .ok(); + + let raw_card_type = ccard.card_network.clone().or(additional_card_network); + + let card_type = match raw_card_type.clone().and_then(get_cybersource_card_type) { Some(card_network) => Some(card_network.to_string()), None => ccard.get_card_issuer().ok().map(String::from), }; @@ -1258,7 +1268,11 @@ impl }, })); - let processing_information = ProcessingInformation::try_from((item, None, card_type))?; + let processing_information = ProcessingInformation::try_from(( + item, + None, + raw_card_type.map(|network| network.to_string()), + ))?; let client_reference_information = ClientReferenceInformation::from(item); let merchant_defined_information = item .router_data @@ -1273,14 +1287,18 @@ impl .authentication_data .as_ref() .map(|authn_data| { - let (ucaf_authentication_data, cavv) = + let (ucaf_authentication_data, cavv, ucaf_collection_indicator) = if ccard.card_network == Some(common_enums::CardNetwork::Mastercard) { - (Some(Secret::new(authn_data.cavv.clone())), None) + ( + Some(Secret::new(authn_data.cavv.clone())), + None, + Some("1".to_string()), + ) } else { - (None, Some(authn_data.cavv.clone())) + (None, Some(authn_data.cavv.clone()), None) }; CybersourceConsumerAuthInformation { - ucaf_collection_indicator: None, + ucaf_collection_indicator, cavv, ucaf_authentication_data, xid: authn_data.threeds_server_transaction_id.clone(), diff --git a/crates/hyperswitch_connectors/src/utils.rs b/crates/hyperswitch_connectors/src/utils.rs index ce40e373462..cdf7435c5af 100644 --- a/crates/hyperswitch_connectors/src/utils.rs +++ b/crates/hyperswitch_connectors/src/utils.rs @@ -1626,6 +1626,9 @@ pub trait PaymentsAuthorizeRequestData { fn is_cit_mandate_payment(&self) -> bool; fn get_optional_network_transaction_id(&self) -> Option<String>; fn get_optional_email(&self) -> Option<Email>; + fn get_card_network_from_additional_payment_method_data( + &self, + ) -> Result<enums::CardNetwork, Error>; } impl PaymentsAuthorizeRequestData for PaymentsAuthorizeData { @@ -1830,6 +1833,22 @@ impl PaymentsAuthorizeRequestData for PaymentsAuthorizeData { fn get_optional_email(&self) -> Option<Email> { self.email.clone() } + fn get_card_network_from_additional_payment_method_data( + &self, + ) -> Result<enums::CardNetwork, Error> { + match &self.additional_payment_method_data { + Some(payments::AdditionalPaymentData::Card(card_data)) => Ok(card_data + .card_network + .clone() + .ok_or_else(|| errors::ConnectorError::MissingRequiredField { + field_name: "card_network", + })?), + _ => Err(errors::ConnectorError::MissingRequiredFields { + field_names: vec!["card_network"], + } + .into()), + } + } } pub trait PaymentsCaptureRequestData { diff --git a/crates/hyperswitch_domain_models/src/business_profile.rs b/crates/hyperswitch_domain_models/src/business_profile.rs index 9e4b79f5d93..d0b78ee1803 100644 --- a/crates/hyperswitch_domain_models/src/business_profile.rs +++ b/crates/hyperswitch_domain_models/src/business_profile.rs @@ -223,7 +223,7 @@ pub struct ProfileGeneralUpdate { pub card_testing_guard_config: Option<CardTestingGuardConfig>, pub card_testing_secret_key: OptionalEncryptableName, pub is_clear_pan_retries_enabled: Option<bool>, - pub force_3ds_challenge: bool, + pub force_3ds_challenge: Option<bool>, } #[cfg(feature = "v1")] @@ -338,7 +338,7 @@ impl From<ProfileUpdate> for ProfileUpdateInternal { card_testing_guard_config, card_testing_secret_key: card_testing_secret_key.map(Encryption::from), is_clear_pan_retries_enabled, - force_3ds_challenge: Some(force_3ds_challenge), + force_3ds_challenge, } } ProfileUpdate::RoutingAlgorithmUpdate { diff --git a/crates/router/src/core/admin.rs b/crates/router/src/core/admin.rs index c5fb803ef97..dca58f11329 100644 --- a/crates/router/src/core/admin.rs +++ b/crates/router/src/core/admin.rs @@ -4233,7 +4233,7 @@ impl ProfileUpdateBridge for api::ProfileUpdate { .map(ForeignInto::foreign_into), card_testing_secret_key, is_clear_pan_retries_enabled: self.is_clear_pan_retries_enabled, - force_3ds_challenge: self.force_3ds_challenge.unwrap_or_default(), + force_3ds_challenge: self.force_3ds_challenge, }, ))) } diff --git a/crates/router/src/core/payments/transformers.rs b/crates/router/src/core/payments/transformers.rs index 9647a277b0e..a34c137dbda 100644 --- a/crates/router/src/core/payments/transformers.rs +++ b/crates/router/src/core/payments/transformers.rs @@ -3135,18 +3135,14 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsAuthoriz payment_data.creds_identifier.as_deref(), )); - let additional_payment_method_data = if payment_data.mandate_id.is_some() { - let parsed_additional_payment_data: Option<api_models::payments::AdditionalPaymentData> = - payment_data.payment_attempt - .payment_method_data - .as_ref().map(|data| data.clone().parse_value("AdditionalPaymentData")) - .transpose() - .change_context(errors::ApiErrorResponse::InternalServerError) - .attach_printable("Failed to parse AdditionalPaymentData from payment_data.payment_attempt.payment_method_data")?; - parsed_additional_payment_data - } else { - None - }; + let additional_payment_method_data: Option<api_models::payments::AdditionalPaymentData> = + payment_data.payment_attempt + .payment_method_data + .as_ref().map(|data| data.clone().parse_value("AdditionalPaymentData")) + .transpose() + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("Failed to parse AdditionalPaymentData from payment_data.payment_attempt.payment_method_data")?; + let payment_method_data = payment_data.payment_method_data.or_else(|| { if payment_data.mandate_id.is_some() { Some(domain::PaymentMethodData::MandatePayment)
fix
pass card network for external 3DS from additional_payment_method_data (#7473)
350aeb378c41836a3b1bc7b172592d68b8e6dd17
2024-08-27 19:40:01
Prajjwal Kumar
feat(euclid): add a new variant in payment type i.e ppt_mandate (#5681)
false
diff --git a/crates/api_models/src/mandates.rs b/crates/api_models/src/mandates.rs index dc61aa08b0c..b62a2c38b9c 100644 --- a/crates/api_models/src/mandates.rs +++ b/crates/api_models/src/mandates.rs @@ -115,7 +115,7 @@ pub struct MandateListConstraints { } /// Details required for recurring payment -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema, PartialEq, Eq)] #[serde(tag = "type", content = "data", rename_all = "snake_case")] pub enum RecurringDetails { MandateId(String), @@ -124,7 +124,7 @@ pub enum RecurringDetails { } /// Processor payment token for MIT payments where payment_method_data is not available -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema, PartialEq, Eq)] pub struct ProcessorPaymentToken { pub processor_payment_token: String, #[schema(value_type = Connector, example = "stripe")] diff --git a/crates/euclid/src/backend/vir_interpreter.rs b/crates/euclid/src/backend/vir_interpreter.rs index 0e7988bb3be..7fde8721be0 100644 --- a/crates/euclid/src/backend/vir_interpreter.rs +++ b/crates/euclid/src/backend/vir_interpreter.rs @@ -198,6 +198,47 @@ mod test { assert_eq!(result.rule_name.expect("Rule Name").as_str(), "rule_1"); } + #[test] + fn test_ppt_flow() { + let program_str = r#" + default: ["stripe", "adyen"] + rule_1: ["stripe"] + { + payment_type = ppt_mandate + } + "#; + + let (_, program) = ast::parser::program::<DummyOutput>(program_str).expect("Program"); + let inp = inputs::BackendInput { + metadata: None, + payment: inputs::PaymentInput { + amount: MinorUnit::new(32), + currency: enums::Currency::USD, + card_bin: Some("123456".to_string()), + authentication_type: Some(enums::AuthenticationType::NoThreeDs), + capture_method: Some(enums::CaptureMethod::Automatic), + business_country: Some(enums::Country::UnitedStatesOfAmerica), + billing_country: Some(enums::Country::France), + business_label: None, + setup_future_usage: None, + }, + payment_method: inputs::PaymentMethodInput { + payment_method: Some(enums::PaymentMethod::PayLater), + payment_method_type: Some(enums::PaymentMethodType::Affirm), + card_network: None, + }, + mandate: inputs::MandateData { + mandate_acceptance_type: None, + mandate_type: None, + payment_type: Some(enums::PaymentType::PptMandate), + }, + }; + + let backend = VirInterpreterBackend::<DummyOutput>::with_program(program).expect("Program"); + let result = backend.execute(inp).expect("Execution"); + assert_eq!(result.rule_name.expect("Rule Name").as_str(), "rule_1"); + } + #[test] fn test_mandate_type() { let program_str = r#" diff --git a/crates/euclid/src/enums.rs b/crates/euclid/src/enums.rs index 8e65d23d5ea..cfd410f0d3b 100644 --- a/crates/euclid/src/enums.rs +++ b/crates/euclid/src/enums.rs @@ -81,6 +81,7 @@ pub enum PaymentType { NonMandate, NewMandate, UpdateMandate, + PptMandate, } #[derive( diff --git a/crates/router/src/core/payments/routing.rs b/crates/router/src/core/payments/routing.rs index 692a5924a06..6f1912d7c65 100644 --- a/crates/router/src/core/payments/routing.rs +++ b/crates/router/src/core/payments/routing.rs @@ -208,10 +208,21 @@ where } }) }), - payment_type: Some(payment_data.setup_mandate.clone().map_or_else( - || euclid_enums::PaymentType::NonMandate, - |_| euclid_enums::PaymentType::SetupMandate, - )), + payment_type: Some( + if payment_data.recurring_details.as_ref().is_some_and(|data| { + matches!( + data, + api_models::mandates::RecurringDetails::ProcessorPaymentToken(_) + ) + }) { + euclid_enums::PaymentType::PptMandate + } else { + payment_data.setup_mandate.clone().map_or_else( + || euclid_enums::PaymentType::NonMandate, + |_| euclid_enums::PaymentType::SetupMandate, + ) + }, + ), }; let payment_method_input = dsl_inputs::PaymentMethodInput { payment_method: payment_data.payment_attempt.payment_method,
feat
add a new variant in payment type i.e ppt_mandate (#5681)
3705f77ee445acd5ce555a370b375b19d20ce3d4
2024-02-06 13:33:15
Sakil Mostak
refactor(configs): [Payme] Development config for 3DS (#3555)
false
diff --git a/config/deployments/integration_test.toml b/config/deployments/integration_test.toml index 88bac9340c8..dfb1fc9ee28 100644 --- a/config/deployments/integration_test.toml +++ b/config/deployments/integration_test.toml @@ -266,6 +266,7 @@ stripe.payment_method = "bank_transfer" bankofamerica = { payment_method = "card" } cybersource = { payment_method = "card" } nmi.payment_method = "card" +payme.payment_method = "card" [tokenization] braintree = { long_lived_token = false, payment_method = "card" } diff --git a/config/deployments/production.toml b/config/deployments/production.toml index fa966f9f128..82d5c00c806 100644 --- a/config/deployments/production.toml +++ b/config/deployments/production.toml @@ -282,6 +282,7 @@ stripe.payment_method = "bank_transfer" bankofamerica = { payment_method = "card" } cybersource = { payment_method = "card" } nmi.payment_method = "card" +payme.payment_method = "card" [tokenization] braintree = { long_lived_token = false, payment_method = "card" } diff --git a/config/deployments/sandbox.toml b/config/deployments/sandbox.toml index f2c4a66ba3d..dfc3033ea20 100644 --- a/config/deployments/sandbox.toml +++ b/config/deployments/sandbox.toml @@ -284,6 +284,7 @@ stripe.payment_method = "bank_transfer" bankofamerica = { payment_method = "card" } cybersource = { payment_method = "card" } nmi.payment_method = "card" +payme.payment_method = "card" [tokenization] braintree = { long_lived_token = false, payment_method = "card" }
refactor
[Payme] Development config for 3DS (#3555)
ec2b1b18fd1851012e9f877a08f847c194cc52bf
2023-03-15 14:18:17
Jagan
feat(connector): Add support for complete authorize payment after 3DS redirection (#741)
false
diff --git a/config/Development.toml b/config/Development.toml index 406dedb0b36..75716e71261 100644 --- a/config/Development.toml +++ b/config/Development.toml @@ -66,9 +66,9 @@ cards = [ "payu", "shift4", "stripe", + "trustpay", "worldline", "worldpay", - "trustpay", ] [refund] diff --git a/config/docker_compose.toml b/config/docker_compose.toml index e91423bc277..e013b6431ae 100644 --- a/config/docker_compose.toml +++ b/config/docker_compose.toml @@ -114,9 +114,9 @@ cards = [ "payu", "shift4", "stripe", + "trustpay", "worldline", "worldpay", - "trustpay", ] diff --git a/connector-template/mod.rs b/connector-template/mod.rs index bbb2d4a6721..2c5c3e63c4c 100644 --- a/connector-template/mod.rs +++ b/connector-template/mod.rs @@ -62,8 +62,7 @@ impl ConnectorCommon for {{project-name | downcase | pascal_case}} { } fn get_auth_header(&self, auth_type:&types::ConnectorAuthType)-> CustomResult<Vec<(String,String)>,errors::ConnectorError> { - let auth: {{project-name | downcase}}::{{project-name | downcase | pascal_case}}AuthType = auth_type - .try_into() + let auth = {{project-name | downcase}}::{{project-name | downcase | pascal_case}}AuthType::try_from(auth_type) .change_context(errors::ConnectorError::FailedToObtainAuthType)?; Ok(vec![(headers::AUTHORIZATION.to_string(), auth.api_key)]) } @@ -146,12 +145,11 @@ impl res: Response, ) -> CustomResult<types::PaymentsAuthorizeRouterData,errors::ConnectorError> { let response: {{project-name | downcase}}::{{project-name | downcase | pascal_case}}PaymentsResponse = res.response.parse_struct("{{project-name | downcase | pascal_case}} PaymentsAuthorizeResponse").change_context(errors::ConnectorError::ResponseDeserializationFailed)?; - types::ResponseRouterData { + types::RouterData::try_from(types::ResponseRouterData { response, data: data.clone(), http_code: res.status_code, - } - .try_into() + }) .change_context(errors::ConnectorError::ResponseHandlingFailed) } @@ -346,12 +344,11 @@ impl res: Response, ) -> CustomResult<types::RefundsRouterData<api::Execute>,errors::ConnectorError> { let response: {{project-name| downcase}}::RefundResponse = res.response.parse_struct("{{project-name | downcase}} RefundResponse").change_context(errors::ConnectorError::RequestEncodingFailed)?; - types::ResponseRouterData { + types::RouterData::try_from(types::ResponseRouterData { response, data: data.clone(), http_code: res.status_code, - } - .try_into() + }) .change_context(errors::ConnectorError::ResponseHandlingFailed) } @@ -395,12 +392,11 @@ impl res: Response, ) -> CustomResult<types::RefundSyncRouterData,errors::ConnectorError,> { let response: {{project-name | downcase}}::RefundResponse = res.response.parse_struct("{{project-name | downcase}} RefundSyncResponse").change_context(errors::ConnectorError::ResponseDeserializationFailed)?; - types::ResponseRouterData { + types::RouterData::try_from(types::ResponseRouterData { response, data: data.clone(), http_code: res.status_code, - } - .try_into() + }) .change_context(errors::ConnectorError::ResponseHandlingFailed) } @@ -437,6 +433,8 @@ impl services::ConnectorRedirectResponse for {{project-name | downcase | pascal_ fn get_flow_type( &self, _query_params: &str, + _json_payload: Option<serde_json::Value>, + _action: services::PaymentAction ) -> CustomResult<payments::CallConnectorAction, errors::ConnectorError> { Ok(payments::CallConnectorAction::Trigger) } diff --git a/connector-template/test.rs b/connector-template/test.rs index bd65d9433a3..3c2a7b239ee 100644 --- a/connector-template/test.rs +++ b/connector-template/test.rs @@ -87,8 +87,7 @@ async fn should_sync_authorized_payment() { connector_transaction_id: router::types::ResponseId::ConnectorTransactionId( txn_id.unwrap(), ), - encoded_data: None, - capture_method: None, + ..Default::default() }), None, ) diff --git a/crates/common_utils/src/lib.rs b/crates/common_utils/src/lib.rs index 6ec1856e960..9c41b40c11a 100644 --- a/crates/common_utils/src/lib.rs +++ b/crates/common_utils/src/lib.rs @@ -49,26 +49,10 @@ pub mod date_time { (result, start.elapsed().as_seconds_f64() * 1000f64) } - /// Prefix the date field with zero if it has single digit Eg: 1 -> 01 - fn prefix_zero(input: u8) -> String { - if input < 10 { - return "0".to_owned() + input.to_string().as_str(); - } - input.to_string() - } - /// Return the current date and time in UTC with the format YYYYMMDDHHmmss Eg: 20191105081132 - pub fn date_as_yyyymmddhhmmss() -> String { - let now = OffsetDateTime::now_utc(); - format!( - "{}{}{}{}{}{}", - now.year(), - prefix_zero(u8::from(now.month())), - prefix_zero(now.day()), - prefix_zero(now.hour()), - prefix_zero(now.minute()), - prefix_zero(now.second()) - ) + pub fn date_as_yyyymmddhhmmss() -> Result<String, time::error::Format> { + let format = time::macros::format_description!("[year repr:full][month padding:zero repr:numerical][day padding:zero][hour padding:zero repr:24][minute padding:zero][second padding:zero]"); + now().format(&format) } /// Return the current date and time in UTC with the format [year]-[month]-[day]T[hour]:[minute]:[second].mmmZ Eg: 2023-02-15T13:33:18.898Z diff --git a/crates/router/src/connector/aci.rs b/crates/router/src/connector/aci.rs index 070e2b8f06c..5c6d704480d 100644 --- a/crates/router/src/connector/aci.rs +++ b/crates/router/src/connector/aci.rs @@ -545,5 +545,3 @@ impl api::IncomingWebhook for Aci { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } } - -impl services::ConnectorRedirectResponse for Aci {} diff --git a/crates/router/src/connector/adyen.rs b/crates/router/src/connector/adyen.rs index be8f01c0d13..1741417633f 100644 --- a/crates/router/src/connector/adyen.rs +++ b/crates/router/src/connector/adyen.rs @@ -11,10 +11,7 @@ use self::transformers as adyen; use crate::{ configs::settings, consts, - core::{ - errors::{self, CustomResult}, - payments, - }, + core::errors::{self, CustomResult}, db::StorageInterface, headers, logger, services, types::{ @@ -36,8 +33,7 @@ impl ConnectorCommon for Adyen { &self, auth_type: &types::ConnectorAuthType, ) -> CustomResult<Vec<(String, String)>, errors::ConnectorError> { - let auth: adyen::AdyenAuthType = auth_type - .try_into() + let auth = adyen::AdyenAuthType::try_from(auth_type) .change_context(errors::ConnectorError::FailedToObtainAuthType)?; Ok(vec![(headers::X_API_KEY.to_string(), auth.api_key)]) } @@ -762,12 +758,3 @@ impl api::IncomingWebhook for Adyen { )) } } - -impl services::ConnectorRedirectResponse for Adyen { - fn get_flow_type( - &self, - _query_params: &str, - ) -> CustomResult<payments::CallConnectorAction, errors::ConnectorError> { - Ok(payments::CallConnectorAction::Trigger) - } -} diff --git a/crates/router/src/connector/airwallex.rs b/crates/router/src/connector/airwallex.rs index fdd66013481..f3c1da9e40f 100644 --- a/crates/router/src/connector/airwallex.rs +++ b/crates/router/src/connector/airwallex.rs @@ -296,7 +296,10 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P + Sync + 'static), > = Box::new(&Self); - let authorize_data = &types::PaymentsAuthorizeSessionTokenRouterData::from(&router_data); + let authorize_data = &types::PaymentsAuthorizeSessionTokenRouterData::from(( + &router_data, + types::AuthorizeSessionTokenData::from(&router_data), + )); let resp = services::execute_connector_processing_step( app_state, integ, @@ -905,12 +908,3 @@ impl api::IncomingWebhook for Airwallex { Ok(details.data.object) } } - -impl services::ConnectorRedirectResponse for Airwallex { - fn get_flow_type( - &self, - _query_params: &str, - ) -> CustomResult<payments::CallConnectorAction, errors::ConnectorError> { - Ok(payments::CallConnectorAction::Trigger) - } -} diff --git a/crates/router/src/connector/applepay.rs b/crates/router/src/connector/applepay.rs index a4570c5d13d..c4e08ff675c 100644 --- a/crates/router/src/connector/applepay.rs +++ b/crates/router/src/connector/applepay.rs @@ -236,8 +236,6 @@ impl services::ConnectorIntegration<api::RSync, types::RefundsData, types::Refun { } -impl services::ConnectorRedirectResponse for Applepay {} - #[async_trait::async_trait] impl api::IncomingWebhook for Applepay { fn get_webhook_object_reference_id( diff --git a/crates/router/src/connector/authorizedotnet.rs b/crates/router/src/connector/authorizedotnet.rs index 5a1b5613629..f3fe02915ae 100644 --- a/crates/router/src/connector/authorizedotnet.rs +++ b/crates/router/src/connector/authorizedotnet.rs @@ -592,8 +592,6 @@ impl api::IncomingWebhook for Authorizedotnet { } } -impl services::ConnectorRedirectResponse for Authorizedotnet {} - #[inline] fn get_error_response( types::Response { diff --git a/crates/router/src/connector/bambora.rs b/crates/router/src/connector/bambora.rs index 285120bd792..33425a9f315 100644 --- a/crates/router/src/connector/bambora.rs +++ b/crates/router/src/connector/bambora.rs @@ -9,10 +9,7 @@ use super::utils::RefundsRequestData; use crate::{ configs::settings, connector::utils::{PaymentsAuthorizeRequestData, PaymentsSyncRequestData}, - core::{ - errors::{self, CustomResult}, - payments, - }, + core::errors::{self, CustomResult}, headers, logger, services::{self, ConnectorIntegration}, types::{ @@ -616,15 +613,6 @@ impl api::IncomingWebhook for Bambora { } } -impl services::ConnectorRedirectResponse for Bambora { - fn get_flow_type( - &self, - _query_params: &str, - ) -> CustomResult<payments::CallConnectorAction, errors::ConnectorError> { - Ok(payments::CallConnectorAction::Trigger) - } -} - pub fn get_payment_flow(is_auto_capture: bool) -> bambora::PaymentFlow { if is_auto_capture { bambora::PaymentFlow::Capture diff --git a/crates/router/src/connector/bluesnap.rs b/crates/router/src/connector/bluesnap.rs index 7731617916c..c3335307f0c 100644 --- a/crates/router/src/connector/bluesnap.rs +++ b/crates/router/src/connector/bluesnap.rs @@ -11,10 +11,7 @@ use super::utils::RefundsRequestData; use crate::{ configs::settings, consts, - core::{ - errors::{self, CustomResult}, - payments, - }, + core::errors::{self, CustomResult}, db::StorageInterface, headers, logger, services::{self, ConnectorIntegration}, @@ -741,12 +738,3 @@ impl api::IncomingWebhook for Bluesnap { Ok(res_json) } } - -impl services::ConnectorRedirectResponse for Bluesnap { - fn get_flow_type( - &self, - _query_params: &str, - ) -> CustomResult<payments::CallConnectorAction, errors::ConnectorError> { - Ok(payments::CallConnectorAction::Trigger) - } -} diff --git a/crates/router/src/connector/braintree.rs b/crates/router/src/connector/braintree.rs index 2c56b605111..581f9bc4ce1 100644 --- a/crates/router/src/connector/braintree.rs +++ b/crates/router/src/connector/braintree.rs @@ -8,10 +8,7 @@ use self::transformers as braintree; use crate::{ configs::settings, consts, - core::{ - errors::{self, CustomResult}, - payments, - }, + core::errors::{self, CustomResult}, headers, services, types::{ self, @@ -696,12 +693,3 @@ impl api::IncomingWebhook for Braintree { Err(errors::ConnectorError::NotImplemented("braintree".to_string()).into()) } } - -impl services::ConnectorRedirectResponse for Braintree { - fn get_flow_type( - &self, - _query_params: &str, - ) -> CustomResult<payments::CallConnectorAction, errors::ConnectorError> { - Ok(payments::CallConnectorAction::Trigger) - } -} diff --git a/crates/router/src/connector/checkout.rs b/crates/router/src/connector/checkout.rs index f262b7d9ec0..66e07c34e84 100644 --- a/crates/router/src/connector/checkout.rs +++ b/crates/router/src/connector/checkout.rs @@ -749,16 +749,19 @@ impl services::ConnectorRedirectResponse for Checkout { fn get_flow_type( &self, query_params: &str, + _json_payload: Option<serde_json::Value>, + _action: services::PaymentAction, ) -> CustomResult<payments::CallConnectorAction, errors::ConnectorError> { let query = serde_urlencoded::from_str::<transformers::CheckoutRedirectResponse>(query_params) .into_report() .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; - Ok(query + let connector_action = query .status .map(|checkout_status| { payments::CallConnectorAction::StatusUpdate(checkout_status.into()) }) - .unwrap_or(payments::CallConnectorAction::Trigger)) + .unwrap_or(payments::CallConnectorAction::Trigger); + Ok(connector_action) } } diff --git a/crates/router/src/connector/cybersource.rs b/crates/router/src/connector/cybersource.rs index 69118abfd5c..35d6061d8bd 100644 --- a/crates/router/src/connector/cybersource.rs +++ b/crates/router/src/connector/cybersource.rs @@ -709,5 +709,3 @@ impl api::IncomingWebhook for Cybersource { Err(errors::ConnectorError::NotImplemented("cybersource".to_string()).into()) } } - -impl services::ConnectorRedirectResponse for Cybersource {} diff --git a/crates/router/src/connector/dlocal.rs b/crates/router/src/connector/dlocal.rs index 470681701e1..16bbbe6928b 100644 --- a/crates/router/src/connector/dlocal.rs +++ b/crates/router/src/connector/dlocal.rs @@ -12,10 +12,7 @@ use transformers as dlocal; use crate::{ configs::settings, - core::{ - errors::{self, CustomResult}, - payments, - }, + core::errors::{self, CustomResult}, headers, logger, services::{self, ConnectorIntegration}, types::{ @@ -586,12 +583,3 @@ impl api::IncomingWebhook for Dlocal { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } } - -impl services::ConnectorRedirectResponse for Dlocal { - fn get_flow_type( - &self, - _query_params: &str, - ) -> CustomResult<payments::CallConnectorAction, errors::ConnectorError> { - Ok(payments::CallConnectorAction::Trigger) - } -} diff --git a/crates/router/src/connector/fiserv.rs b/crates/router/src/connector/fiserv.rs index 54a4919fb71..92f4cd75006 100644 --- a/crates/router/src/connector/fiserv.rs +++ b/crates/router/src/connector/fiserv.rs @@ -12,10 +12,7 @@ use uuid::Uuid; use crate::{ configs::settings, consts, - core::{ - errors::{self, CustomResult}, - payments, - }, + core::errors::{self, CustomResult}, headers, logger, services::{self, api::ConnectorIntegration}, types::{ @@ -686,12 +683,3 @@ impl api::IncomingWebhook for Fiserv { Err(errors::ConnectorError::NotImplemented("fiserv".to_string()).into()) } } - -impl services::ConnectorRedirectResponse for Fiserv { - fn get_flow_type( - &self, - _query_params: &str, - ) -> CustomResult<payments::CallConnectorAction, errors::ConnectorError> { - Ok(payments::CallConnectorAction::Trigger) - } -} diff --git a/crates/router/src/connector/globalpay.rs b/crates/router/src/connector/globalpay.rs index fbbdb13942f..125982a7c29 100644 --- a/crates/router/src/connector/globalpay.rs +++ b/crates/router/src/connector/globalpay.rs @@ -15,10 +15,7 @@ use self::{ }; use crate::{ configs::settings, - core::{ - errors::{self, CustomResult}, - payments, - }, + core::errors::{self, CustomResult}, headers, services::{self, ConnectorIntegration}, types::{ @@ -704,12 +701,3 @@ impl api::IncomingWebhook for Globalpay { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } } - -impl services::ConnectorRedirectResponse for Globalpay { - fn get_flow_type( - &self, - _query_params: &str, - ) -> CustomResult<payments::CallConnectorAction, errors::ConnectorError> { - Ok(payments::CallConnectorAction::Trigger) - } -} diff --git a/crates/router/src/connector/globalpay/transformers.rs b/crates/router/src/connector/globalpay/transformers.rs index 6973906f9e6..c2b09faa54f 100644 --- a/crates/router/src/connector/globalpay/transformers.rs +++ b/crates/router/src/connector/globalpay/transformers.rs @@ -8,7 +8,7 @@ use super::{ response::{GlobalpayPaymentStatus, GlobalpayPaymentsResponse, GlobalpayRefreshTokenResponse}, }; use crate::{ - connector::utils::{CardData, PaymentsRequestData, RouterData}, + connector::utils::{self, CardData, PaymentsAuthorizeRequestData, RouterData}, consts, core::errors, types::{self, api, storage::enums, ErrorResponse}, @@ -22,8 +22,9 @@ pub struct GlobalPayMeta { impl TryFrom<&types::PaymentsAuthorizeRouterData> for GlobalpayPaymentsRequest { type Error = error_stack::Report<errors::ConnectorError>; fn try_from(item: &types::PaymentsAuthorizeRouterData) -> Result<Self, Self::Error> { - let metadata: GlobalPayMeta = item.to_connector_meta()?; - let card = item.get_card()?; + let metadata: GlobalPayMeta = + utils::to_connector_meta_from_secret(item.connector_meta_data.clone())?; + let card = item.request.get_card()?; let expiry_year = card.get_card_expiry_year_2_digit(); Ok(Self { account_name: metadata.account_name, diff --git a/crates/router/src/connector/klarna.rs b/crates/router/src/connector/klarna.rs index 56d23b16520..61a7a2debf4 100644 --- a/crates/router/src/connector/klarna.rs +++ b/crates/router/src/connector/klarna.rs @@ -377,5 +377,3 @@ impl api::IncomingWebhook for Klarna { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } } - -impl services::ConnectorRedirectResponse for Klarna {} diff --git a/crates/router/src/connector/multisafepay.rs b/crates/router/src/connector/multisafepay.rs index ae581fccb95..f0a3eb57c26 100644 --- a/crates/router/src/connector/multisafepay.rs +++ b/crates/router/src/connector/multisafepay.rs @@ -7,10 +7,7 @@ use transformers as multisafepay; use crate::{ configs::settings, - core::{ - errors::{self, CustomResult}, - payments, - }, + core::errors::{self, CustomResult}, headers, services::{self, ConnectorIntegration}, types::{ @@ -448,12 +445,3 @@ impl api::IncomingWebhook for Multisafepay { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } } - -impl services::ConnectorRedirectResponse for Multisafepay { - fn get_flow_type( - &self, - _query_params: &str, - ) -> CustomResult<payments::CallConnectorAction, errors::ConnectorError> { - Ok(payments::CallConnectorAction::Trigger) - } -} diff --git a/crates/router/src/connector/nuvei.rs b/crates/router/src/connector/nuvei.rs index 9aff6524cf5..88396c42942 100644 --- a/crates/router/src/connector/nuvei.rs +++ b/crates/router/src/connector/nuvei.rs @@ -2,23 +2,29 @@ mod transformers; use std::fmt::Debug; +use ::common_utils::{ + errors::ReportSwitchExt, + ext_traits::{BytesExt, StringExt, ValueExt}, +}; use error_stack::{IntoReport, ResultExt}; use transformers as nuvei; +use super::utils::{self, to_boolean, RouterData}; use crate::{ configs::settings, core::{ errors::{self, CustomResult}, payments, }, - headers, logger, + headers, services::{self, ConnectorIntegration}, types::{ self, - api::{self, ConnectorCommon, ConnectorCommonExt}, - ErrorResponse, Response, RouterData, + api::{self, ConnectorCommon, ConnectorCommonExt, InitPayment}, + storage::enums, + ErrorResponse, Response, }, - utils::{self, BytesExt}, + utils::{self as common_utils}, }; #[derive(Debug, Clone)] @@ -30,7 +36,7 @@ where { fn build_headers( &self, - _req: &RouterData<Flow, Request, Response>, + _req: &types::RouterData<Flow, Request, Response>, _connectors: &settings::Connectors, ) -> CustomResult<Vec<(String, String)>, errors::ConnectorError> { let headers = vec![( @@ -63,14 +69,106 @@ impl ConnectorCommon for Nuvei { } impl api::Payment for Nuvei {} - impl api::PreVerify for Nuvei {} +impl api::PaymentVoid for Nuvei {} +impl api::PaymentSync for Nuvei {} +impl api::PaymentCapture for Nuvei {} +impl api::PaymentSession for Nuvei {} +impl api::PaymentAuthorize for Nuvei {} +impl api::Refund for Nuvei {} +impl api::RefundExecute for Nuvei {} +impl api::RefundSync for Nuvei {} +impl api::PaymentsCompleteAuthorize for Nuvei {} +impl api::ConnectorAccessToken for Nuvei {} + impl ConnectorIntegration<api::Verify, types::VerifyRequestData, types::PaymentsResponseData> for Nuvei { } -impl api::PaymentVoid for Nuvei {} +impl + ConnectorIntegration< + api::CompleteAuthorize, + types::CompleteAuthorizeData, + types::PaymentsResponseData, + > for Nuvei +{ + fn get_headers( + &self, + req: &types::PaymentsCompleteAuthorizeRouterData, + connectors: &settings::Connectors, + ) -> CustomResult<Vec<(String, String)>, errors::ConnectorError> { + self.build_headers(req, connectors) + } + fn get_content_type(&self) -> &'static str { + self.common_get_content_type() + } + fn get_url( + &self, + _req: &types::PaymentsCompleteAuthorizeRouterData, + connectors: &settings::Connectors, + ) -> CustomResult<String, errors::ConnectorError> { + Ok(format!( + "{}ppp/api/v1/payment.do", + api::ConnectorCommon::base_url(self, connectors) + )) + } + fn get_request_body( + &self, + req: &types::PaymentsCompleteAuthorizeRouterData, + ) -> CustomResult<Option<String>, errors::ConnectorError> { + let meta: nuvei::NuveiMeta = utils::to_connector_meta(req.request.connector_meta.clone())?; + let req_obj = nuvei::NuveiPaymentsRequest::try_from((req, meta.session_token))?; + let req = + common_utils::Encode::<nuvei::NuveiPaymentsRequest>::encode_to_string_of_json(&req_obj) + .change_context(errors::ConnectorError::RequestEncodingFailed)?; + + Ok(Some(req)) + } + fn build_request( + &self, + req: &types::PaymentsCompleteAuthorizeRouterData, + connectors: &settings::Connectors, + ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + Ok(Some( + services::RequestBuilder::new() + .method(services::Method::Post) + .url(&types::PaymentsComeplteAuthorizeType::get_url( + self, req, connectors, + )?) + .headers(types::PaymentsComeplteAuthorizeType::get_headers( + self, req, connectors, + )?) + .body(types::PaymentsComeplteAuthorizeType::get_request_body( + self, req, + )?) + .build(), + )) + } + fn handle_response( + &self, + data: &types::PaymentsCompleteAuthorizeRouterData, + res: Response, + ) -> CustomResult<types::PaymentsCompleteAuthorizeRouterData, errors::ConnectorError> { + let response: nuvei::NuveiPaymentsResponse = res + .response + .parse_struct("NuveiPaymentsResponse") + .switch()?; + types::RouterData::try_from(types::ResponseRouterData { + response, + data: data.clone(), + http_code: res.status_code, + }) + .change_context(errors::ConnectorError::ResponseHandlingFailed) + } + + fn get_error_response( + &self, + res: Response, + ) -> CustomResult<ErrorResponse, errors::ConnectorError> { + self.build_error_response(res) + } +} impl ConnectorIntegration<api::Void, types::PaymentsCancelData, types::PaymentsResponseData> for Nuvei @@ -103,9 +201,10 @@ impl ConnectorIntegration<api::Void, types::PaymentsCancelData, types::PaymentsR req: &types::PaymentsCancelRouterData, ) -> CustomResult<Option<String>, errors::ConnectorError> { let req_obj = nuvei::NuveiPaymentFlowRequest::try_from(req)?; - let req = - utils::Encode::<nuvei::NuveiPaymentFlowRequest>::encode_to_string_of_json(&req_obj) - .change_context(errors::ConnectorError::RequestEncodingFailed)?; + let req = common_utils::Encode::<nuvei::NuveiPaymentFlowRequest>::encode_to_string_of_json( + &req_obj, + ) + .change_context(errors::ConnectorError::RequestEncodingFailed)?; Ok(Some(req)) } @@ -128,11 +227,10 @@ impl ConnectorIntegration<api::Void, types::PaymentsCancelData, types::PaymentsR data: &types::PaymentsCancelRouterData, res: Response, ) -> CustomResult<types::PaymentsCancelRouterData, errors::ConnectorError> { - logger::debug!(target: "router::connector::nuvei", response=?res); let response: nuvei::NuveiPaymentsResponse = res .response - .parse_struct("nuvei NuveiPaymentsResponse") - .change_context(errors::ConnectorError::RequestEncodingFailed)?; + .parse_struct("NuveiPaymentsResponse") + .switch()?; types::PaymentsCancelRouterData::try_from(types::ResponseRouterData { response, data: data.clone(), @@ -149,14 +247,11 @@ impl ConnectorIntegration<api::Void, types::PaymentsCancelData, types::PaymentsR } } -impl api::ConnectorAccessToken for Nuvei {} - impl ConnectorIntegration<api::AccessTokenAuth, types::AccessTokenRequestData, types::AccessToken> for Nuvei { } -impl api::PaymentSync for Nuvei {} impl ConnectorIntegration<api::PSync, types::PaymentsSyncData, types::PaymentsResponseData> for Nuvei { @@ -188,9 +283,10 @@ impl ConnectorIntegration<api::PSync, types::PaymentsSyncData, types::PaymentsRe req: &types::PaymentsSyncRouterData, ) -> CustomResult<Option<String>, errors::ConnectorError> { let req_obj = nuvei::NuveiPaymentSyncRequest::try_from(req)?; - let req = - utils::Encode::<nuvei::NuveiPaymentSyncRequest>::encode_to_string_of_json(&req_obj) - .change_context(errors::ConnectorError::RequestEncodingFailed)?; + let req = common_utils::Encode::<nuvei::NuveiPaymentSyncRequest>::encode_to_string_of_json( + &req_obj, + ) + .change_context(errors::ConnectorError::RequestEncodingFailed)?; Ok(Some(req)) } fn build_request( @@ -220,11 +316,10 @@ impl ConnectorIntegration<api::PSync, types::PaymentsSyncData, types::PaymentsRe data: &types::PaymentsSyncRouterData, res: Response, ) -> CustomResult<types::PaymentsSyncRouterData, errors::ConnectorError> { - logger::debug!(payment_sync_response=?res); let response: nuvei::NuveiPaymentsResponse = res .response - .parse_struct("nuvei PaymentsResponse") - .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; + .parse_struct("NuveiPaymentsResponse") + .switch()?; types::RouterData::try_from(types::ResponseRouterData { response, data: data.clone(), @@ -234,7 +329,6 @@ impl ConnectorIntegration<api::PSync, types::PaymentsSyncData, types::PaymentsRe } } -impl api::PaymentCapture for Nuvei {} impl ConnectorIntegration<api::Capture, types::PaymentsCaptureData, types::PaymentsResponseData> for Nuvei { @@ -266,9 +360,10 @@ impl ConnectorIntegration<api::Capture, types::PaymentsCaptureData, types::Payme req: &types::PaymentsCaptureRouterData, ) -> CustomResult<Option<String>, errors::ConnectorError> { let req_obj = nuvei::NuveiPaymentFlowRequest::try_from(req)?; - let req = - utils::Encode::<nuvei::NuveiPaymentFlowRequest>::encode_to_string_of_json(&req_obj) - .change_context(errors::ConnectorError::RequestEncodingFailed)?; + let req = common_utils::Encode::<nuvei::NuveiPaymentFlowRequest>::encode_to_string_of_json( + &req_obj, + ) + .change_context(errors::ConnectorError::RequestEncodingFailed)?; Ok(Some(req)) } @@ -296,9 +391,8 @@ impl ConnectorIntegration<api::Capture, types::PaymentsCaptureData, types::Payme ) -> CustomResult<types::PaymentsCaptureRouterData, errors::ConnectorError> { let response: nuvei::NuveiPaymentsResponse = res .response - .parse_struct("Nuvei PaymentsResponse") - .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; - logger::debug!(nuveipayments_create_response=?response); + .parse_struct("NuveiPaymentsResponse") + .switch()?; types::RouterData::try_from(types::ResponseRouterData { response, data: data.clone(), @@ -315,15 +409,11 @@ impl ConnectorIntegration<api::Capture, types::PaymentsCaptureData, types::Payme } } -impl api::PaymentSession for Nuvei {} - impl ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData> for Nuvei { } -impl api::PaymentAuthorize for Nuvei {} - #[async_trait::async_trait] impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::PaymentsResponseData> for Nuvei @@ -365,7 +455,10 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P + Sync + 'static), > = Box::new(&Self); - let authorize_data = &types::PaymentsAuthorizeSessionTokenRouterData::from(&router_data); + let authorize_data = &types::PaymentsAuthorizeSessionTokenRouterData::from(( + &router_data, + types::AuthorizeSessionTokenData::from(&router_data), + )); let resp = services::execute_connector_processing_step( app_state, integ, @@ -374,15 +467,49 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P ) .await?; router_data.session_token = resp.session_token; + let (enrolled_for_3ds, related_transaction_id) = match router_data.auth_type { + storage_models::enums::AuthenticationType::ThreeDs => { + let integ: Box< + &(dyn ConnectorIntegration< + InitPayment, + types::PaymentsAuthorizeData, + types::PaymentsResponseData, + > + Send + + Sync + + 'static), + > = Box::new(&Self); + let init_data = &types::PaymentsInitRouterData::from(( + &router_data, + router_data.request.clone(), + )); + let init_resp = services::execute_connector_processing_step( + app_state, + integ, + init_data, + payments::CallConnectorAction::Trigger, + ) + .await?; + ( + init_resp.request.enrolled_for_3ds, + init_resp.request.related_transaction_id, + ) + } + storage_models::enums::AuthenticationType::NoThreeDs => (false, None), + }; + + router_data.request.enrolled_for_3ds = enrolled_for_3ds; + router_data.request.related_transaction_id = related_transaction_id; Ok(()) } fn get_request_body( &self, req: &types::PaymentsAuthorizeRouterData, ) -> CustomResult<Option<String>, errors::ConnectorError> { - let req_obj = nuvei::NuveiPaymentsRequest::try_from(req)?; - let req = utils::Encode::<nuvei::NuveiPaymentsRequest>::encode_to_string_of_json(&req_obj) - .change_context(errors::ConnectorError::RequestEncodingFailed)?; + let req_obj = nuvei::NuveiPaymentsRequest::try_from((req, req.get_session_token()?))?; + let req = + common_utils::Encode::<nuvei::NuveiPaymentsRequest>::encode_to_string_of_json(&req_obj) + .change_context(errors::ConnectorError::RequestEncodingFailed)?; + Ok(Some(req)) } @@ -412,9 +539,8 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P ) -> CustomResult<types::PaymentsAuthorizeRouterData, errors::ConnectorError> { let response: nuvei::NuveiPaymentsResponse = res .response - .parse_struct("nuvei NuveiPaymentsResponse") - .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; - logger::debug!(nuveipayments_create_response=?response); + .parse_struct("NuveiPaymentsResponse") + .switch()?; types::RouterData::try_from(types::ResponseRouterData { response, data: data.clone(), @@ -440,11 +566,7 @@ impl { fn get_headers( &self, - req: &RouterData< - types::api::payments::AuthorizeSessionToken, - types::AuthorizeSessionTokenData, - types::PaymentsResponseData, - >, + req: &types::PaymentsAuthorizeSessionTokenRouterData, connectors: &settings::Connectors, ) -> CustomResult<Vec<(String, String)>, errors::ConnectorError> { self.build_headers(req, connectors) @@ -456,11 +578,7 @@ impl fn get_url( &self, - _req: &RouterData< - types::api::payments::AuthorizeSessionToken, - types::AuthorizeSessionTokenData, - types::PaymentsResponseData, - >, + _req: &types::PaymentsAuthorizeSessionTokenRouterData, connectors: &settings::Connectors, ) -> CustomResult<String, errors::ConnectorError> { Ok(format!( @@ -471,25 +589,18 @@ impl fn get_request_body( &self, - req: &RouterData< - types::api::payments::AuthorizeSessionToken, - types::AuthorizeSessionTokenData, - types::PaymentsResponseData, - >, + req: &types::PaymentsAuthorizeSessionTokenRouterData, ) -> CustomResult<Option<String>, errors::ConnectorError> { let req_obj = nuvei::NuveiSessionRequest::try_from(req)?; - let req = utils::Encode::<nuvei::NuveiSessionRequest>::encode_to_string_of_json(&req_obj) - .change_context(errors::ConnectorError::RequestEncodingFailed)?; + let req = + common_utils::Encode::<nuvei::NuveiSessionRequest>::encode_to_string_of_json(&req_obj) + .change_context(errors::ConnectorError::RequestEncodingFailed)?; Ok(Some(req)) } fn build_request( &self, - req: &RouterData< - types::api::payments::AuthorizeSessionToken, - types::AuthorizeSessionTokenData, - types::PaymentsResponseData, - >, + req: &types::PaymentsAuthorizeSessionTokenRouterData, connectors: &settings::Connectors, ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { Ok(Some( @@ -510,38 +621,16 @@ impl fn handle_response( &self, - data: &RouterData< - api::AuthorizeSessionToken, - types::AuthorizeSessionTokenData, - types::PaymentsResponseData, - >, + data: &types::PaymentsAuthorizeSessionTokenRouterData, res: Response, - ) -> CustomResult< - RouterData< - api::AuthorizeSessionToken, - types::AuthorizeSessionTokenData, - types::PaymentsResponseData, - >, - errors::ConnectorError, - > - where - api::AuthorizeSessionToken: Clone, - types::AuthorizeSessionTokenData: Clone, - types::PaymentsResponseData: Clone, - { - let response: nuvei::NuveiSessionResponse = res - .response - .parse_struct("nuvei NuveiSessionResponse") - .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; - logger::debug!(nuvei_session_response=?response); - - types::ResponseRouterData { + ) -> CustomResult<types::PaymentsAuthorizeSessionTokenRouterData, errors::ConnectorError> { + let response: nuvei::NuveiSessionResponse = + res.response.parse_struct("NuveiSessionResponse").switch()?; + types::RouterData::try_from(types::ResponseRouterData { response, data: data.clone(), http_code: res.status_code, - } - .try_into() - .change_context(errors::ConnectorError::ResponseHandlingFailed) + }) } fn get_error_response( @@ -552,9 +641,99 @@ impl } } -impl api::Refund for Nuvei {} -impl api::RefundExecute for Nuvei {} -impl api::RefundSync for Nuvei {} +impl ConnectorIntegration<InitPayment, types::PaymentsAuthorizeData, types::PaymentsResponseData> + for Nuvei +{ + fn get_headers( + &self, + req: &types::PaymentsInitRouterData, + connectors: &settings::Connectors, + ) -> CustomResult<Vec<(String, String)>, errors::ConnectorError> { + self.build_headers(req, connectors) + } + + fn get_content_type(&self) -> &'static str { + self.common_get_content_type() + } + + fn get_url( + &self, + _req: &types::PaymentsInitRouterData, + connectors: &settings::Connectors, + ) -> CustomResult<String, errors::ConnectorError> { + Ok(format!( + "{}ppp/api/v1/initPayment.do", + api::ConnectorCommon::base_url(self, connectors) + )) + } + + fn get_request_body( + &self, + req: &types::PaymentsInitRouterData, + ) -> CustomResult<Option<String>, errors::ConnectorError> { + let req_obj = nuvei::NuveiPaymentsRequest::try_from((req, req.get_session_token()?))?; + let req = + common_utils::Encode::<nuvei::NuveiSessionRequest>::encode_to_string_of_json(&req_obj) + .change_context(errors::ConnectorError::RequestEncodingFailed)?; + + Ok(Some(req)) + } + + fn build_request( + &self, + req: &types::PaymentsInitRouterData, + connectors: &settings::Connectors, + ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + Ok(Some( + services::RequestBuilder::new() + .method(services::Method::Post) + .url(&types::PaymentsInitType::get_url(self, req, connectors)?) + .headers(types::PaymentsInitType::get_headers(self, req, connectors)?) + .body(types::PaymentsInitType::get_request_body(self, req)?) + .build(), + )) + } + + fn handle_response( + &self, + data: &types::PaymentsInitRouterData, + res: Response, + ) -> CustomResult<types::PaymentsInitRouterData, errors::ConnectorError> { + let response: nuvei::NuveiPaymentsResponse = res + .response + .parse_struct("NuveiPaymentsResponse") + .switch()?; + let response_data = types::RouterData::try_from(types::ResponseRouterData { + response: response.clone(), + data: data.clone(), + http_code: res.status_code, + }) + .change_context(errors::ConnectorError::ResponseHandlingFailed)?; + let is_enrolled_for_3ds = response + .clone() + .payment_option + .and_then(|po| po.card) + .and_then(|c| c.three_d) + .and_then(|t| t.v2supported) + .map(to_boolean) + .unwrap_or_default(); + Ok(types::RouterData { + request: types::PaymentsAuthorizeData { + enrolled_for_3ds: is_enrolled_for_3ds, + related_transaction_id: response.transaction_id, + ..response_data.request + }, + ..response_data + }) + } + + fn get_error_response( + &self, + res: Response, + ) -> CustomResult<ErrorResponse, errors::ConnectorError> { + self.build_error_response(res) + } +} impl ConnectorIntegration<api::Execute, types::RefundsData, types::RefundsResponseData> for Nuvei { fn get_headers( @@ -585,9 +764,10 @@ impl ConnectorIntegration<api::Execute, types::RefundsData, types::RefundsRespon req: &types::RefundsRouterData<api::Execute>, ) -> CustomResult<Option<String>, errors::ConnectorError> { let req_obj = nuvei::NuveiPaymentFlowRequest::try_from(req)?; - let req = - utils::Encode::<nuvei::NuveiPaymentFlowRequest>::encode_to_string_of_json(&req_obj) - .change_context(errors::ConnectorError::RequestEncodingFailed)?; + let req = common_utils::Encode::<nuvei::NuveiPaymentFlowRequest>::encode_to_string_of_json( + &req_obj, + ) + .change_context(errors::ConnectorError::RequestEncodingFailed)?; Ok(Some(req)) } @@ -612,17 +792,15 @@ impl ConnectorIntegration<api::Execute, types::RefundsData, types::RefundsRespon data: &types::RefundsRouterData<api::Execute>, res: Response, ) -> CustomResult<types::RefundsRouterData<api::Execute>, errors::ConnectorError> { - logger::debug!(target: "router::connector::nuvei", response=?res); let response: nuvei::NuveiPaymentsResponse = res .response - .parse_struct("nuvei NuveiPaymentsResponse") - .change_context(errors::ConnectorError::RequestEncodingFailed)?; - types::ResponseRouterData { + .parse_struct("NuveiPaymentsResponse") + .switch()?; + types::RouterData::try_from(types::ResponseRouterData { response, data: data.clone(), http_code: res.status_code, - } - .try_into() + }) .change_context(errors::ConnectorError::ResponseHandlingFailed) } @@ -664,7 +842,31 @@ impl services::ConnectorRedirectResponse for Nuvei { fn get_flow_type( &self, _query_params: &str, + json_payload: Option<serde_json::Value>, + action: services::PaymentAction, ) -> CustomResult<payments::CallConnectorAction, errors::ConnectorError> { - Ok(payments::CallConnectorAction::Trigger) + match action { + services::PaymentAction::PSync => Ok(payments::CallConnectorAction::Trigger), + services::PaymentAction::CompleteAuthorize => { + if let Some(payload) = json_payload { + let redirect_response: nuvei::NuveiRedirectionResponse = + payload.parse_value("NuveiRedirectionResponse").switch()?; + let acs_response: nuvei::NuveiACSResponse = redirect_response + .cres + .parse_struct("NuveiACSResponse") + .switch()?; + match acs_response.trans_status { + None | Some(nuvei::LiabilityShift::Failed) => { + Ok(payments::CallConnectorAction::StatusUpdate( + enums::AttemptStatus::AuthenticationFailed, + )) + } + _ => Ok(payments::CallConnectorAction::Trigger), + } + } else { + Ok(payments::CallConnectorAction::Trigger) + } + } + } } } diff --git a/crates/router/src/connector/nuvei/transformers.rs b/crates/router/src/connector/nuvei/transformers.rs index 50cf95e13ce..b4bceacfbe3 100644 --- a/crates/router/src/connector/nuvei/transformers.rs +++ b/crates/router/src/connector/nuvei/transformers.rs @@ -1,15 +1,18 @@ use common_utils::{ crypto::{self, GenerateDigest}, date_time, + pii::Email, }; use error_stack::{IntoReport, ResultExt}; use masking::Secret; +use reqwest::Url; use serde::{Deserialize, Serialize}; use crate::{ - connector::utils::{PaymentsCancelRequestData, RouterData}, + connector::utils::{self, PaymentsAuthorizeRequestData, PaymentsCancelRequestData, RouterData}, consts, core::errors, + services, types::{self, api, storage::enums}, }; @@ -28,7 +31,7 @@ pub struct NuveiSessionRequest { pub checksum: String, } -#[derive(Debug, Serialize, Default, Deserialize)] +#[derive(Debug, Serialize, Default, Clone, Deserialize)] #[serde(rename_all = "camelCase")] pub struct NuveiSessionResponse { pub session_token: String, @@ -42,7 +45,7 @@ pub struct NuveiSessionResponse { pub client_request_id: String, } -#[derive(Debug, Serialize, Default, Deserialize)] +#[derive(Debug, Serialize, Default)] #[serde(rename_all = "camelCase")] pub struct NuveiPaymentsRequest { pub time_stamp: String, @@ -57,9 +60,23 @@ pub struct NuveiPaymentsRequest { pub transaction_type: TransactionType, pub payment_option: PaymentOption, pub checksum: String, + pub billing_address: Option<BillingAddress>, + pub related_transaction_id: Option<String>, } -#[derive(Debug, Serialize, Default, Deserialize)] +#[derive(Debug, Serialize, Default)] +pub struct NuveiInitPaymentRequest { + pub session_token: String, + pub merchant_id: String, + pub merchant_site_id: String, + pub client_request_id: String, + pub amount: String, + pub currency: String, + pub payment_option: PaymentOption, + pub checksum: String, +} + +#[derive(Debug, Serialize, Default)] #[serde(rename_all = "camelCase")] pub struct NuveiPaymentFlowRequest { pub time_stamp: String, @@ -72,7 +89,7 @@ pub struct NuveiPaymentFlowRequest { pub checksum: String, } -#[derive(Debug, Serialize, Default, Deserialize)] +#[derive(Debug, Serialize, Default)] #[serde(rename_all = "camelCase")] pub struct NuveiPaymentSyncRequest { pub session_token: String, @@ -85,22 +102,37 @@ pub enum TransactionType { Sale, } -#[derive(Debug, Default, Serialize, Deserialize)] +#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct PaymentOption { - pub card: Card, + pub card: Option<Card>, + pub redirect_url: Option<Url>, pub user_payment_option_id: Option<String>, pub device_details: Option<DeviceDetails>, + pub alternative_payment_method: Option<AlternativePaymentMethod>, pub billing_address: Option<BillingAddress>, } -#[derive(Debug, Default, Serialize, Deserialize)] +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct AlternativePaymentMethod { + pub payment_method: AlternativePaymentMethodType, +} + +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "snake_case")] +pub enum AlternativePaymentMethodType { + #[default] + ApmgwExpresscheckout, +} + +#[derive(Debug, Clone, Default, Serialize, Deserialize)] pub struct BillingAddress { - pub email: String, + pub email: Secret<String, Email>, pub country: String, } -#[derive(Debug, Default, Serialize, Deserialize)] +#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct Card { pub card_number: Option<Secret<String, common_utils::pii::CardNumber>>, @@ -123,41 +155,84 @@ pub struct Card { pub issuer_bank_name: Option<String>, pub issuer_country: Option<String>, pub is_prepaid: Option<String>, + pub external_token: Option<ExternalToken>, } -#[derive(Debug, Default, Serialize, Deserialize)] +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ExternalToken { + pub external_token_provider: ExternalTokenProvider, + pub mobile_token: String, +} + +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub enum ExternalTokenProvider { + #[default] + GooglePay, + ApplePay, +} + +#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct ThreeD { + pub method_completion_ind: Option<MethodCompletion>, pub browser_details: Option<BrowserDetails>, pub version: Option<String>, + #[serde(rename = "notificationURL")] pub notification_url: Option<String>, + #[serde(rename = "merchantURL")] pub merchant_url: Option<String>, - pub platform_type: Option<String>, + pub acs_url: Option<String>, + pub c_req: Option<String>, + pub platform_type: Option<PlatformType>, + pub v2supported: Option<String>, pub v2_additional_params: Option<V2AdditionalParams>, + pub is_liability_on_issuer: Option<LiabilityShift>, } -#[derive(Debug, Default, Serialize, Deserialize)] +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +pub enum MethodCompletion { + #[serde(rename = "Y")] + Success, + #[serde(rename = "N")] + Failure, + #[serde(rename = "U")] + #[default] + Unavailable, +} + +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +pub enum PlatformType { + #[serde(rename = "01")] + App, + #[serde(rename = "02")] + #[default] + Browser, +} + +#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct BrowserDetails { pub accept_header: String, - pub ip: String, + pub ip: Option<std::net::IpAddr>, pub java_enabled: String, pub java_script_enabled: String, pub language: String, - pub color_depth: String, - pub screen_height: String, - pub screen_width: String, - pub time_zone: String, + pub color_depth: u8, + pub screen_height: u32, + pub screen_width: u32, + pub time_zone: i32, pub user_agent: String, } -#[derive(Debug, Default, Serialize, Deserialize)] +#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct V2AdditionalParams { pub challenge_window_size: String, } -#[derive(Debug, Default, Serialize, Deserialize)] +#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct DeviceDetails { pub ip_address: String, @@ -172,6 +247,48 @@ impl From<enums::CaptureMethod> for TransactionType { } } +#[derive(Debug, Serialize, Deserialize)] +pub struct NuveiRedirectionResponse { + pub cres: String, +} +#[derive(Debug, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct NuveiACSResponse { + #[serde(rename = "threeDSServerTransID")] + pub three_ds_server_trans_id: String, + #[serde(rename = "acsTransID")] + pub acs_trans_id: String, + pub message_type: String, + pub message_version: String, + pub trans_status: Option<LiabilityShift>, + pub message_extension: Vec<MessageExtension>, + pub acs_signed_content: Option<serde_json::Value>, +} + +#[derive(Debug, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct MessageExtension { + pub name: String, + pub id: String, + pub criticality_indicator: bool, + pub data: MessageExtensionData, +} + +#[derive(Debug, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct MessageExtensionData { + pub value_one: String, + pub value_two: String, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum LiabilityShift { + #[serde(rename = "Y", alias = "1")] + Success, + #[serde(rename = "N", alias = "0")] + Failed, +} + fn encode_payload( payload: Vec<String>, ) -> Result<String, error_stack::Report<errors::ConnectorError>> { @@ -192,7 +309,9 @@ impl TryFrom<&types::PaymentsAuthorizeSessionTokenRouterData> for NuveiSessionRe let merchant_id = connector_meta.merchant_id; let merchant_site_id = connector_meta.merchant_site_id; let client_request_id = item.attempt_id.clone(); - let time_stamp = date_time::date_as_yyyymmddhhmmss(); + let time_stamp = date_time::date_as_yyyymmddhhmmss() + .into_report() + .change_context(errors::ConnectorError::RequestEncodingFailed)?; let merchant_secret = connector_meta.merchant_secret; Ok(Self { merchant_id: merchant_id.clone(), @@ -214,7 +333,7 @@ impl<F, T> TryFrom<types::ResponseRouterData<F, NuveiSessionResponse, T, types::PaymentsResponseData>> for types::RouterData<F, T, types::PaymentsResponseData> { - type Error = error_stack::Report<errors::ParsingError>; + type Error = error_stack::Report<errors::ConnectorError>; fn try_from( item: types::ResponseRouterData<F, NuveiSessionResponse, T, types::PaymentsResponseData>, ) -> Result<Self, Self::Error> { @@ -229,53 +348,237 @@ impl<F, T> } } -impl TryFrom<&types::PaymentsAuthorizeRouterData> for NuveiPaymentsRequest { +impl<F> + TryFrom<( + &types::RouterData<F, types::PaymentsAuthorizeData, types::PaymentsResponseData>, + String, + )> for NuveiPaymentsRequest +{ type Error = error_stack::Report<errors::ConnectorError>; - fn try_from(item: &types::PaymentsAuthorizeRouterData) -> Result<Self, Self::Error> { + fn try_from( + data: ( + &types::RouterData<F, types::PaymentsAuthorizeData, types::PaymentsResponseData>, + String, + ), + ) -> Result<Self, Self::Error> { + let item = data.0; + let session_token = data.1; + if session_token.is_empty() { + return Err(errors::ConnectorError::MissingRequiredField { + field_name: "session_token", + } + .into()); + } let connector_meta: NuveiAuthType = NuveiAuthType::try_from(&item.connector_auth_type)?; let merchant_id = connector_meta.merchant_id; let merchant_site_id = connector_meta.merchant_site_id; let client_request_id = item.attempt_id.clone(); - let time_stamp = date_time::date_as_yyyymmddhhmmss(); + let time_stamp = date_time::date_as_yyyymmddhhmmss() + .into_report() + .change_context(errors::ConnectorError::RequestEncodingFailed)?; let merchant_secret = connector_meta.merchant_secret; - match item.request.payment_method_data.clone() { - api::PaymentMethodData::Card(card) => Ok(Self { - merchant_id: merchant_id.clone(), - merchant_site_id: merchant_site_id.clone(), - client_request_id: client_request_id.clone(), - amount: item.request.amount.clone().to_string(), - currency: item.request.currency.clone().to_string(), - transaction_type: item - .request - .capture_method - .map(TransactionType::from) - .unwrap_or_default(), + let request_data = match item.request.payment_method_data.clone() { + api::PaymentMethodData::Card(card) => get_card_info(item, &card), + api::PaymentMethodData::Wallet(wallet) => match wallet { + api_models::payments::WalletData::GooglePay(gpay_data) => Ok(Self { + payment_option: PaymentOption { + card: Some(Card { + external_token: Some(ExternalToken { + external_token_provider: ExternalTokenProvider::GooglePay, + mobile_token: gpay_data.tokenization_data.token, + }), + ..Default::default() + }), + ..Default::default() + }, + ..Default::default() + }), + api_models::payments::WalletData::ApplePay(apple_data) => Ok(Self { + payment_option: PaymentOption { + card: Some(Card { + external_token: Some(ExternalToken { + external_token_provider: ExternalTokenProvider::ApplePay, + mobile_token: apple_data.payment_data, + }), + ..Default::default() + }), + ..Default::default() + }, + ..Default::default() + }), + api_models::payments::WalletData::PaypalRedirect(_) => Ok(Self { + payment_option: PaymentOption { + alternative_payment_method: Some(AlternativePaymentMethod { + payment_method: AlternativePaymentMethodType::ApmgwExpresscheckout, + }), + ..Default::default() + }, + billing_address: Some(BillingAddress { + email: item.request.get_email()?, + country: item.get_billing_country()?, + }), + ..Default::default() + }), + _ => Err(errors::ConnectorError::NotSupported { + payment_method: "Wallet".to_string(), + connector: "Nuvei", + payment_experience: "RedirectToUrl".to_string(), + } + .into()), + }, + _ => Err(errors::ConnectorError::NotImplemented("Payment methods".to_string()).into()), + }?; + Ok(Self { + merchant_id: merchant_id.clone(), + merchant_site_id: merchant_site_id.clone(), + client_request_id: client_request_id.clone(), + amount: item.request.amount.clone().to_string(), + currency: item.request.currency.clone().to_string(), + transaction_type: item + .request + .capture_method + .map(TransactionType::from) + .unwrap_or_default(), + time_stamp: time_stamp.clone(), + session_token, + checksum: encode_payload(vec![ + merchant_id, + merchant_site_id, + client_request_id, + item.request.amount.to_string(), + item.request.currency.to_string(), + time_stamp, + merchant_secret, + ])?, + ..request_data + }) + } +} +fn get_card_info<F>( + item: &types::RouterData<F, types::PaymentsAuthorizeData, types::PaymentsResponseData>, + card_details: &api_models::payments::Card, +) -> Result<NuveiPaymentsRequest, error_stack::Report<errors::ConnectorError>> { + let browser_info = item.request.get_browser_info()?; + let related_transaction_id = if item.request.enrolled_for_3ds { + item.request.related_transaction_id.clone() + } else { + None + }; + let three_d = if item.request.enrolled_for_3ds { + Some(ThreeD { + browser_details: Some(BrowserDetails { + accept_header: browser_info.accept_header, + ip: browser_info.ip_address, + java_enabled: browser_info.java_enabled.to_string().to_uppercase(), + java_script_enabled: browser_info.java_script_enabled.to_string().to_uppercase(), + language: browser_info.language, + color_depth: browser_info.color_depth, + screen_height: browser_info.screen_height, + screen_width: browser_info.screen_width, + time_zone: browser_info.time_zone, + user_agent: browser_info.user_agent, + }), + notification_url: item.complete_authorize_url.clone(), + merchant_url: item.return_url.clone(), + platform_type: Some(PlatformType::Browser), + method_completion_ind: Some(MethodCompletion::Unavailable), + ..Default::default() + }) + } else { + None + }; + let card = card_details.clone(); + Ok(NuveiPaymentsRequest { + related_transaction_id, + payment_option: PaymentOption { + card: Some(Card { + card_number: Some(card.card_number), + card_holder_name: Some(card.card_holder_name), + expiration_month: Some(card.card_exp_month), + expiration_year: Some(card.card_exp_year), + three_d, + cvv: Some(card.card_cvc), + ..Default::default() + }), + ..Default::default() + }, + ..Default::default() + }) +} + +impl<F> + TryFrom<( + &types::RouterData<F, types::CompleteAuthorizeData, types::PaymentsResponseData>, + String, + )> for NuveiPaymentsRequest +{ + type Error = error_stack::Report<errors::ConnectorError>; + fn try_from( + data: ( + &types::RouterData<F, types::CompleteAuthorizeData, types::PaymentsResponseData>, + String, + ), + ) -> Result<Self, Self::Error> { + let item = data.0; + let session_token = data.1; + if session_token.is_empty() { + return Err(errors::ConnectorError::MissingRequiredField { + field_name: "session_token", + } + .into()); + } + let connector_meta: NuveiAuthType = NuveiAuthType::try_from(&item.connector_auth_type)?; + let merchant_id = connector_meta.merchant_id; + let merchant_site_id = connector_meta.merchant_site_id; + let client_request_id = item.attempt_id.clone(); + let time_stamp = date_time::date_as_yyyymmddhhmmss() + .into_report() + .change_context(errors::ConnectorError::RequestEncodingFailed)?; + let merchant_secret = connector_meta.merchant_secret; + let request_data = match item.request.payment_method_data.clone() { + Some(api::PaymentMethodData::Card(card)) => Ok(Self { + related_transaction_id: item.request.connector_transaction_id.clone(), payment_option: PaymentOption { - card: Card { + card: Some(Card { card_number: Some(card.card_number), card_holder_name: Some(card.card_holder_name), expiration_month: Some(card.card_exp_month), expiration_year: Some(card.card_exp_year), cvv: Some(card.card_cvc), ..Default::default() - }, + }), ..Default::default() }, - time_stamp: time_stamp.clone(), - session_token: item.get_session_token()?, - checksum: encode_payload(vec![ - merchant_id, - merchant_site_id, - client_request_id, - item.request.amount.to_string(), - item.request.currency.to_string(), - time_stamp, - merchant_secret, - ])?, ..Default::default() }), - _ => Err(errors::ConnectorError::NotImplemented("Payment methods".to_string()).into()), - } + _ => Err(errors::ConnectorError::NotImplemented( + "Payment methods".to_string(), + )), + }?; + Ok(Self { + merchant_id: merchant_id.clone(), + merchant_site_id: merchant_site_id.clone(), + client_request_id: client_request_id.clone(), + amount: item.request.amount.clone().to_string(), + currency: item.request.currency.clone().to_string(), + transaction_type: item + .request + .capture_method + .map(TransactionType::from) + .unwrap_or_default(), + time_stamp: time_stamp.clone(), + session_token, + checksum: encode_payload(vec![ + merchant_id, + merchant_site_id, + client_request_id, + item.request.amount.to_string(), + item.request.currency.to_string(), + time_stamp, + merchant_secret, + ])?, + ..request_data + }) } } @@ -286,7 +589,9 @@ impl TryFrom<&types::PaymentsCaptureRouterData> for NuveiPaymentFlowRequest { let merchant_id = connector_meta.merchant_id; let merchant_site_id = connector_meta.merchant_site_id; let client_request_id = item.attempt_id.clone(); - let time_stamp = date_time::date_as_yyyymmddhhmmss(); + let time_stamp = date_time::date_as_yyyymmddhhmmss() + .into_report() + .change_context(errors::ConnectorError::RequestEncodingFailed)?; let merchant_secret = connector_meta.merchant_secret; Ok(Self { merchant_id: merchant_id.clone(), @@ -317,7 +622,9 @@ impl TryFrom<&types::RefundExecuteRouterData> for NuveiPaymentFlowRequest { let merchant_id = connector_meta.merchant_id; let merchant_site_id = connector_meta.merchant_site_id; let client_request_id = item.attempt_id.clone(); - let time_stamp = date_time::date_as_yyyymmddhhmmss(); + let time_stamp = date_time::date_as_yyyymmddhhmmss() + .into_report() + .change_context(errors::ConnectorError::RequestEncodingFailed)?; let merchant_secret = connector_meta.merchant_secret; Ok(Self { merchant_id: merchant_id.clone(), @@ -344,7 +651,7 @@ impl TryFrom<&types::RefundExecuteRouterData> for NuveiPaymentFlowRequest { impl TryFrom<&types::PaymentsSyncRouterData> for NuveiPaymentSyncRequest { type Error = error_stack::Report<errors::ConnectorError>; fn try_from(value: &types::PaymentsSyncRouterData) -> Result<Self, Self::Error> { - let meta: NuveiMeta = value.to_connector_meta()?; + let meta: NuveiMeta = utils::to_connector_meta(value.request.connector_meta.clone())?; Ok(Self { session_token: meta.session_token, }) @@ -358,7 +665,9 @@ impl TryFrom<&types::PaymentsCancelRouterData> for NuveiPaymentFlowRequest { let merchant_id = connector_meta.merchant_id; let merchant_site_id = connector_meta.merchant_site_id; let client_request_id = item.attempt_id.clone(); - let time_stamp = date_time::date_as_yyyymmddhhmmss(); + let time_stamp = date_time::date_as_yyyymmddhhmmss() + .into_report() + .change_context(errors::ConnectorError::RequestEncodingFailed)?; let merchant_secret = connector_meta.merchant_secret; let amount = item.request.get_amount()?.to_string(); let currency = item.request.get_currency()?.to_string(); @@ -427,6 +736,7 @@ pub enum NuveiTransactionStatus { Approved, Declined, Error, + Redirect, #[default] Processing, } @@ -441,7 +751,7 @@ impl From<NuveiTransactionStatus> for enums::AttemptStatus { } } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Debug, Clone, Deserialize)] #[serde(rename_all = "camelCase")] pub struct NuveiPaymentsResponse { pub order_id: Option<String>, @@ -472,16 +782,18 @@ pub struct NuveiPaymentsResponse { pub client_request_id: Option<String>, } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub enum NuveiTransactionType { Auth, Sale, Credit, + Auth3D, + InitAuth3D, Settle, Void, } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct FraudDetails { pub final_decision: String, @@ -505,10 +817,14 @@ fn get_payment_status(response: &NuveiPaymentsResponse) -> enums::AttemptStatus enums::AttemptStatus::Failure } Some(NuveiTransactionType::Void) => enums::AttemptStatus::VoidFailed, + Some(NuveiTransactionType::Auth3D) => { + enums::AttemptStatus::AuthenticationFailed + } _ => enums::AttemptStatus::Pending, } } NuveiTransactionStatus::Processing => enums::AttemptStatus::Pending, + NuveiTransactionStatus::Redirect => enums::AttemptStatus::AuthenticationPending, }, None => match response.status { NuveiPaymentStatus::Failed | NuveiPaymentStatus::Error => enums::AttemptStatus::Failure, @@ -521,10 +837,22 @@ impl<F, T> TryFrom<types::ResponseRouterData<F, NuveiPaymentsResponse, T, types::PaymentsResponseData>> for types::RouterData<F, T, types::PaymentsResponseData> { - type Error = error_stack::Report<errors::ParsingError>; + type Error = error_stack::Report<errors::ConnectorError>; fn try_from( item: types::ResponseRouterData<F, NuveiPaymentsResponse, T, types::PaymentsResponseData>, ) -> Result<Self, Self::Error> { + let redirection_data = item + .response + .payment_option + .as_ref() + .and_then(|o| o.card.clone()) + .and_then(|card| card.three_d) + .and_then(|three_ds| three_ds.acs_url.zip(three_ds.c_req)) + .map(|(base_url, creq)| services::RedirectForm { + endpoint: base_url, + method: services::Method::Post, + form_fields: std::collections::HashMap::from([("creq".to_string(), creq)]), + }); Ok(Self { status: get_payment_status(&item.response), response: match item.response.status { @@ -556,21 +884,24 @@ impl<F, T> status_code: item.http_code, }), _ => Ok(types::PaymentsResponseData::TransactionResponse { - resource_id: types::ResponseId::ConnectorTransactionId( - item.response.transaction_id.ok_or(errors::ParsingError)?, + resource_id: item.response.transaction_id.map_or_else( + || types::ResponseId::NoResponseId, + types::ResponseId::ConnectorTransactionId, ), - redirection_data: None, + redirection_data, mandate_reference: None, - connector_metadata: Some( - serde_json::to_value(NuveiMeta { - session_token: item - .response - .session_token - .ok_or(errors::ParsingError)?, - }) - .into_report() - .change_context(errors::ParsingError)?, - ), + // we don't need to save session token for capture, void flow so ignoring if it is not present + connector_metadata: if let Some(token) = item.response.session_token { + Some( + serde_json::to_value(NuveiMeta { + session_token: token, + }) + .into_report() + .change_context(errors::ConnectorError::ResponseHandlingFailed)?, + ) + } else { + None + }, }), }, }, @@ -579,12 +910,32 @@ impl<F, T> } } +impl<F, T> TryFrom<types::ResponseRouterData<F, NuveiACSResponse, T, types::PaymentsResponseData>> + for types::RouterData<F, T, types::PaymentsResponseData> +{ + type Error = error_stack::Report<errors::ConnectorError>; + fn try_from( + item: types::ResponseRouterData<F, NuveiACSResponse, T, types::PaymentsResponseData>, + ) -> Result<Self, Self::Error> { + Ok(Self { + status: enums::AttemptStatus::AuthenticationFailed, + response: Err(types::ErrorResponse { + code: consts::NO_ERROR_CODE.to_string(), + message: "Authentication Failed".to_string(), + reason: None, + status_code: item.http_code, + }), + ..item.data + }) + } +} + impl From<NuveiTransactionStatus> for enums::RefundStatus { fn from(item: NuveiTransactionStatus) -> Self { match item { NuveiTransactionStatus::Approved => Self::Success, NuveiTransactionStatus::Declined | NuveiTransactionStatus::Error => Self::Failure, - NuveiTransactionStatus::Processing => Self::Pending, + NuveiTransactionStatus::Processing | NuveiTransactionStatus::Redirect => Self::Pending, } } } @@ -592,49 +943,18 @@ impl From<NuveiTransactionStatus> for enums::RefundStatus { impl TryFrom<types::RefundsResponseRouterData<api::Execute, NuveiPaymentsResponse>> for types::RefundsRouterData<api::Execute> { - type Error = error_stack::Report<errors::ParsingError>; + type Error = error_stack::Report<errors::ConnectorError>; fn try_from( item: types::RefundsResponseRouterData<api::Execute, NuveiPaymentsResponse>, ) -> Result<Self, Self::Error> { - let response = item.response; - let http_code = item.http_code; - let refund_status = response - .transaction_status - .clone() - .map(|a| a.into()) - .unwrap_or(enums::RefundStatus::Failure); - let refund_response = match response.status { - NuveiPaymentStatus::Error => Err(types::ErrorResponse { - code: response - .err_code - .map(|c| c.to_string()) - .unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()), - message: response - .reason - .unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()), - reason: None, - status_code: http_code, - }), - _ => match response.transaction_status { - Some(NuveiTransactionStatus::Error) => Err(types::ErrorResponse { - code: response - .gw_error_code - .map(|c| c.to_string()) - .unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()), - message: response - .gw_error_reason - .unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()), - reason: None, - status_code: http_code, - }), - _ => Ok(types::RefundsResponseData { - connector_refund_id: response.transaction_id.ok_or(errors::ParsingError)?, - refund_status, - }), - }, - }; Ok(Self { - response: refund_response, + response: get_refund_response( + item.response.clone(), + item.http_code, + item.response + .transaction_id + .ok_or(errors::ConnectorError::MissingConnectorTransactionID)?, + ), ..item.data }) } @@ -643,54 +963,61 @@ impl TryFrom<types::RefundsResponseRouterData<api::Execute, NuveiPaymentsRespons impl TryFrom<types::RefundsResponseRouterData<api::RSync, NuveiPaymentsResponse>> for types::RefundsRouterData<api::RSync> { - type Error = error_stack::Report<errors::ParsingError>; + type Error = error_stack::Report<errors::ConnectorError>; fn try_from( item: types::RefundsResponseRouterData<api::RSync, NuveiPaymentsResponse>, ) -> Result<Self, Self::Error> { - let response = item.response; - let http_code = item.http_code; - let refund_status = response - .transaction_status - .clone() - .map(|a| a.into()) - .unwrap_or(enums::RefundStatus::Failure); - let refund_response = match response.status { - NuveiPaymentStatus::Error => Err(types::ErrorResponse { + Ok(Self { + response: get_refund_response( + item.response.clone(), + item.http_code, + item.response + .transaction_id + .ok_or(errors::ConnectorError::MissingConnectorTransactionID)?, + ), + ..item.data + }) + } +} + +fn get_refund_response( + response: NuveiPaymentsResponse, + http_code: u16, + txn_id: String, +) -> Result<types::RefundsResponseData, types::ErrorResponse> { + let refund_status = response + .transaction_status + .clone() + .map(enums::RefundStatus::from) + .unwrap_or(enums::RefundStatus::Failure); + match response.status { + NuveiPaymentStatus::Error => Err(types::ErrorResponse { + code: response + .err_code + .map(|c| c.to_string()) + .unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()), + message: response + .reason + .unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()), + reason: None, + status_code: http_code, + }), + _ => match response.transaction_status { + Some(NuveiTransactionStatus::Error) => Err(types::ErrorResponse { code: response - .err_code + .gw_error_code .map(|c| c.to_string()) .unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()), message: response - .reason + .gw_error_reason .unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()), reason: None, status_code: http_code, }), - _ => match response.transaction_status { - Some(NuveiTransactionStatus::Error) => Err(types::ErrorResponse { - code: response - .gw_error_code - .map(|c| c.to_string()) - .unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()), - message: response - .gw_error_reason - .unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()), - reason: None, - status_code: http_code, - }), - _ => Ok(types::RefundsResponseData { - connector_refund_id: response.transaction_id.ok_or(errors::ParsingError)?, - refund_status, - }), - }, - }; - Ok(Self { - response: refund_response, - ..item.data - }) + _ => Ok(types::RefundsResponseData { + connector_refund_id: txn_id, + refund_status, + }), + }, } } - -//TODO: Fill the struct with respective fields -#[derive(Default, Debug, Serialize, Deserialize, PartialEq)] -pub struct NuveiErrorResponse {} diff --git a/crates/router/src/connector/payu.rs b/crates/router/src/connector/payu.rs index e29b55760e5..32cbfcb371b 100644 --- a/crates/router/src/connector/payu.rs +++ b/crates/router/src/connector/payu.rs @@ -7,10 +7,7 @@ use transformers as payu; use crate::{ configs::settings, - core::{ - errors::{self, CustomResult}, - payments, - }, + core::errors::{self, CustomResult}, headers, services::{self, ConnectorIntegration}, types::{ @@ -692,12 +689,3 @@ impl api::IncomingWebhook for Payu { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } } - -impl services::ConnectorRedirectResponse for Payu { - fn get_flow_type( - &self, - _query_params: &str, - ) -> CustomResult<payments::CallConnectorAction, errors::ConnectorError> { - Ok(payments::CallConnectorAction::Trigger) - } -} diff --git a/crates/router/src/connector/rapyd.rs b/crates/router/src/connector/rapyd.rs index 8c0c47409e3..0c1d6fa44ac 100644 --- a/crates/router/src/connector/rapyd.rs +++ b/crates/router/src/connector/rapyd.rs @@ -12,10 +12,7 @@ use crate::{ configs::settings, connector::utils as conn_utils, consts, - core::{ - errors::{self, CustomResult}, - payments, - }, + core::errors::{self, CustomResult}, db::StorageInterface, headers, services, types::{ @@ -806,12 +803,3 @@ impl api::IncomingWebhook for Rapyd { Ok(res_json) } } - -impl services::ConnectorRedirectResponse for Rapyd { - fn get_flow_type( - &self, - _query_params: &str, - ) -> CustomResult<payments::CallConnectorAction, errors::ConnectorError> { - Ok(payments::CallConnectorAction::Trigger) - } -} diff --git a/crates/router/src/connector/shift4.rs b/crates/router/src/connector/shift4.rs index ee4386e2100..b70c660578c 100644 --- a/crates/router/src/connector/shift4.rs +++ b/crates/router/src/connector/shift4.rs @@ -10,10 +10,7 @@ use super::utils::RefundsRequestData; use crate::{ configs::settings, consts, - core::{ - errors::{self, CustomResult}, - payments, - }, + core::errors::{self, CustomResult}, headers, services::{self, ConnectorIntegration}, types::{ @@ -530,12 +527,3 @@ impl api::IncomingWebhook for Shift4 { Ok(details.data) } } - -impl services::ConnectorRedirectResponse for Shift4 { - fn get_flow_type( - &self, - _query_params: &str, - ) -> CustomResult<payments::CallConnectorAction, errors::ConnectorError> { - Ok(payments::CallConnectorAction::Trigger) - } -} diff --git a/crates/router/src/connector/stripe.rs b/crates/router/src/connector/stripe.rs index 1ae8722b677..12f50e7c148 100644 --- a/crates/router/src/connector/stripe.rs +++ b/crates/router/src/connector/stripe.rs @@ -974,6 +974,8 @@ impl services::ConnectorRedirectResponse for Stripe { fn get_flow_type( &self, query_params: &str, + _json_payload: Option<serde_json::Value>, + _action: services::PaymentAction, ) -> CustomResult<crate::core::payments::CallConnectorAction, errors::ConnectorError> { let query = serde_urlencoded::from_str::<transformers::StripeRedirectResponse>(query_params) diff --git a/crates/router/src/connector/trustpay.rs b/crates/router/src/connector/trustpay.rs index 902ebeee4e0..53e0f7b440e 100644 --- a/crates/router/src/connector/trustpay.rs +++ b/crates/router/src/connector/trustpay.rs @@ -611,6 +611,8 @@ impl services::ConnectorRedirectResponse for Trustpay { fn get_flow_type( &self, query_params: &str, + _json_payload: Option<serde_json::Value>, + _action: services::PaymentAction, ) -> CustomResult<payments::CallConnectorAction, errors::ConnectorError> { let query = serde_urlencoded::from_str::<transformers::TrustpayRedirectResponse>(query_params) diff --git a/crates/router/src/connector/trustpay/transformers.rs b/crates/router/src/connector/trustpay/transformers.rs index de0e476d6c7..c20a9e27aa7 100644 --- a/crates/router/src/connector/trustpay/transformers.rs +++ b/crates/router/src/connector/trustpay/transformers.rs @@ -264,7 +264,7 @@ fn get_bank_redirection_request_data( }, }, callback_urls: CallbackURLs { - success: format!("{}?status=SuccessOk", return_url), + success: format!("{return_url}?status=SuccessOk"), cancel: return_url.clone(), error: return_url, }, @@ -816,7 +816,7 @@ impl<F> TryFrom<&types::RefundsRouterData<F>> for TrustpayRefundRequest { }, payment_information: BankPaymentInformation { amount: Amount { - amount: format!("{:.2}", amount), + amount: format!("{amount:.2}"), currency: item.request.currency.to_string(), }, references: References { diff --git a/crates/router/src/connector/utils.rs b/crates/router/src/connector/utils.rs index 752e8d9c8a4..861605a16d2 100644 --- a/crates/router/src/connector/utils.rs +++ b/crates/router/src/connector/utils.rs @@ -1,6 +1,10 @@ use std::collections::HashMap; -use common_utils::{ext_traits::ValueExt, pii}; +use base64::Engine; +use common_utils::{ + errors::ReportSwitchExt, + pii::{self, Email}, +}; use error_stack::{report, IntoReport, ResultExt}; use masking::Secret; use once_cell::sync::Lazy; @@ -8,10 +12,11 @@ use regex::Regex; use serde::Serializer; use crate::{ + consts, core::errors::{self, CustomResult}, pii::PeekInterface, types::{self, api, PaymentsCancelData, ResponseId}, - utils::OptionExt, + utils::{OptionExt, ValueExt}, }; pub fn missing_field_err( @@ -52,6 +57,7 @@ pub trait RouterData { where T: serde::de::DeserializeOwned; fn get_return_url(&self) -> Result<String, Error>; + fn is_three_ds(&self) -> bool; } impl<Flow, Request, Response> RouterData for types::RouterData<Flow, Request, Response> { @@ -116,29 +122,40 @@ impl<Flow, Request, Response> RouterData for types::RouterData<Flow, Request, Re .clone() .ok_or_else(missing_field_err("return_url")) } -} - -pub trait PaymentsRequestData { - fn get_card(&self) -> Result<api::Card, Error>; -} -impl PaymentsRequestData for types::PaymentsAuthorizeRouterData { - fn get_card(&self) -> Result<api::Card, Error> { - match self.request.payment_method_data.clone() { - api::PaymentMethodData::Card(card) => Ok(card), - _ => Err(missing_field_err("card")()), - } + fn is_three_ds(&self) -> bool { + matches!( + self.auth_type, + storage_models::enums::AuthenticationType::ThreeDs + ) } } pub trait PaymentsAuthorizeRequestData { fn is_auto_capture(&self) -> bool; + fn get_email(&self) -> Result<Secret<String, Email>, Error>; + fn get_browser_info(&self) -> Result<types::BrowserInformation, Error>; + fn get_card(&self) -> Result<api::Card, Error>; } impl PaymentsAuthorizeRequestData for types::PaymentsAuthorizeData { fn is_auto_capture(&self) -> bool { self.capture_method == Some(storage_models::enums::CaptureMethod::Automatic) } + fn get_email(&self) -> Result<Secret<String, Email>, Error> { + self.email.clone().ok_or_else(missing_field_err("email")) + } + fn get_browser_info(&self) -> Result<types::BrowserInformation, Error> { + self.browser_info + .clone() + .ok_or_else(missing_field_err("browser_info")) + } + fn get_card(&self) -> Result<api::Card, Error> { + match self.payment_method_data.clone() { + api::PaymentMethodData::Card(card) => Ok(card), + _ => Err(missing_field_err("card")()), + } + } } pub trait PaymentsSyncRequestData { @@ -352,6 +369,65 @@ pub fn get_header_key_value<'a>( ))? } +pub fn to_boolean(string: String) -> bool { + let str = string.as_str(); + match str { + "true" => true, + "false" => false, + "yes" => true, + "no" => false, + _ => false, + } +} + +pub fn get_connector_meta( + connector_meta: Option<serde_json::Value>, +) -> Result<serde_json::Value, Error> { + connector_meta.ok_or_else(missing_field_err("connector_meta_data")) +} + +pub fn to_connector_meta<T>(connector_meta: Option<serde_json::Value>) -> Result<T, Error> +where + T: serde::de::DeserializeOwned, +{ + let json = connector_meta.ok_or_else(missing_field_err("connector_meta_data"))?; + json.parse_value(std::any::type_name::<T>()).switch() +} + +pub fn to_connector_meta_from_secret<T>( + connector_meta: Option<Secret<serde_json::Value>>, +) -> Result<T, Error> +where + T: serde::de::DeserializeOwned, +{ + let connector_meta_secret = + connector_meta.ok_or_else(missing_field_err("connector_meta_data"))?; + let json = connector_meta_secret.peek().clone(); + json.parse_value(std::any::type_name::<T>()).switch() +} + +impl common_utils::errors::ErrorSwitch<errors::ConnectorError> for errors::ParsingError { + fn switch(&self) -> errors::ConnectorError { + errors::ConnectorError::ParsingFailed + } +} + +pub fn to_string<T>(data: &T) -> Result<String, Error> +where + T: serde::Serialize, +{ + serde_json::to_string(data) + .into_report() + .change_context(errors::ConnectorError::ResponseHandlingFailed) +} + +pub fn base64_decode(data: String) -> Result<Vec<u8>, Error> { + consts::BASE64_ENGINE + .decode(data) + .into_report() + .change_context(errors::ConnectorError::ResponseDeserializationFailed) +} + pub fn to_currency_base_unit_from_optional_amount( amount: Option<i64>, currency: storage_models::enums::Currency, diff --git a/crates/router/src/connector/worldline.rs b/crates/router/src/connector/worldline.rs index b538fb46b70..8f452bda011 100644 --- a/crates/router/src/connector/worldline.rs +++ b/crates/router/src/connector/worldline.rs @@ -773,5 +773,3 @@ impl api::IncomingWebhook for Worldline { Ok(response) } } - -impl services::ConnectorRedirectResponse for Worldline {} diff --git a/crates/router/src/connector/worldpay.rs b/crates/router/src/connector/worldpay.rs index c0a1897ef06..a6a33ef69c5 100644 --- a/crates/router/src/connector/worldpay.rs +++ b/crates/router/src/connector/worldpay.rs @@ -12,10 +12,7 @@ use self::{requests::*, response::*}; use super::utils::RefundsRequestData; use crate::{ configs::settings, - core::{ - errors::{self, CustomResult}, - payments, - }, + core::errors::{self, CustomResult}, headers, services::{self, ConnectorIntegration}, types::{ @@ -611,12 +608,3 @@ impl api::IncomingWebhook for Worldpay { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } } - -impl services::ConnectorRedirectResponse for Worldpay { - fn get_flow_type( - &self, - _query_params: &str, - ) -> CustomResult<payments::CallConnectorAction, errors::ConnectorError> { - Ok(payments::CallConnectorAction::Trigger) - } -} diff --git a/crates/router/src/core/errors.rs b/crates/router/src/core/errors.rs index 52f93999a31..e72d87cf57f 100644 --- a/crates/router/src/core/errors.rs +++ b/crates/router/src/core/errors.rs @@ -227,6 +227,8 @@ pub enum ConnectorError { RequestEncodingFailed, #[error("Request encoding failed : {0}")] RequestEncodingFailedWithReason(String), + #[error("Parsing failed")] + ParsingFailed, #[error("Failed to deserialize connector response")] ResponseDeserializationFailed, #[error("Failed to execute a processing step: {0:?}")] diff --git a/crates/router/src/core/payments.rs b/crates/router/src/core/payments.rs index 06f5d192f84..50dfca86ca7 100644 --- a/crates/router/src/core/payments.rs +++ b/crates/router/src/core/payments.rs @@ -18,7 +18,7 @@ pub use self::operations::{ }; use self::{ flows::{ConstructFlowSpecificData, Feature}, - operations::{BoxedOperation, Operation}, + operations::{payment_complete_authorize, BoxedOperation, Operation}, }; use crate::{ core::{ @@ -193,7 +193,11 @@ where .await? } }; - vault::Vault::delete_locker_payment_method_by_lookup_key(state, &payment_data.token).await + if payment_data.payment_intent.status != storage_enums::IntentStatus::RequiresCustomerAction + { + vault::Vault::delete_locker_payment_method_by_lookup_key(state, &payment_data.token) + .await + } } Ok((payment_data, req, customer)) } @@ -247,80 +251,149 @@ fn is_start_pay<Op: Debug>(operation: &Op) -> bool { format!("{operation:?}").eq("PaymentStart") } -#[allow(clippy::too_many_arguments)] -pub async fn handle_payments_redirect_response<'a, F>( - state: &AppState, - merchant_account: storage::MerchantAccount, - req: api::PaymentsRetrieveRequest, -) -> RouterResponse<api::RedirectionResponse> -where - F: Send + Clone + 'a, -{ - let connector = req.connector.clone().get_required_value("connector")?; - - let query_params = req.param.clone().get_required_value("param")?; +#[derive(Clone, Debug)] +pub struct PaymentsRedirectResponseData { + pub connector: Option<String>, + pub param: Option<String>, + pub merchant_id: Option<String>, + pub json_payload: Option<serde_json::Value>, + pub resource_id: api::PaymentIdType, + pub force_sync: bool, +} - let resource_id = api::PaymentIdTypeExt::get_payment_intent_id(&req.resource_id) - .change_context(errors::ApiErrorResponse::MissingRequiredField { - field_name: "payment_id", - })?; +#[async_trait::async_trait] +pub trait PaymentRedirectFlow: Sync { + async fn call_payment_flow( + &self, + state: &AppState, + merchant_account: storage::MerchantAccount, + req: PaymentsRedirectResponseData, + connector_action: CallConnectorAction, + ) -> RouterResponse<api::PaymentsResponse>; + + fn get_payment_action(&self) -> services::PaymentAction; + + #[allow(clippy::too_many_arguments)] + async fn handle_payments_redirect_response( + &self, + state: &AppState, + merchant_account: storage::MerchantAccount, + req: PaymentsRedirectResponseData, + ) -> RouterResponse<api::RedirectionResponse> { + let connector = req.connector.clone().get_required_value("connector")?; + + let query_params = req.param.clone().get_required_value("param")?; + + let resource_id = api::PaymentIdTypeExt::get_payment_intent_id(&req.resource_id) + .change_context(errors::ApiErrorResponse::MissingRequiredField { + field_name: "payment_id", + })?; - let connector_data = api::ConnectorData::get_connector_by_name( - &state.conf.connectors, - &connector, - api::GetToken::Connector, - )?; + let connector_data = api::ConnectorData::get_connector_by_name( + &state.conf.connectors, + &connector, + api::GetToken::Connector, + )?; - let flow_type = connector_data - .connector - .get_flow_type(&query_params) - .change_context(errors::ApiErrorResponse::InternalServerError) - .attach_printable("Failed to decide the response flow")?; + let flow_type = connector_data + .connector + .get_flow_type( + &query_params, + req.json_payload.clone(), + self.get_payment_action(), + ) + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("Failed to decide the response flow")?; - let response = payments_response_for_redirection_flows( - state, - merchant_account.clone(), - req.clone(), - flow_type, - ) - .await; + let response = self + .call_payment_flow(state, merchant_account.clone(), req.clone(), flow_type) + .await; - let payments_response = - match response.change_context(errors::ApiErrorResponse::NotImplemented { - message: errors::api_error_response::NotImplementedMessage::Default, - })? { + let payments_response = match response? { services::ApplicationResponse::Json(response) => Ok(response), _ => Err(errors::ApiErrorResponse::InternalServerError) .into_report() .attach_printable("Failed to get the response in json"), }?; - let result = helpers::get_handle_response_url( - resource_id, - &merchant_account, - payments_response, - connector, - ) - .attach_printable("No redirection response")?; + let result = helpers::get_handle_response_url( + resource_id, + &merchant_account, + payments_response, + connector, + ) + .attach_printable("No redirection response")?; - Ok(services::ApplicationResponse::JsonForRedirection(result)) + Ok(services::ApplicationResponse::JsonForRedirection(result)) + } } -pub async fn payments_response_for_redirection_flows<'a>( - state: &AppState, - merchant_account: storage::MerchantAccount, - req: api::PaymentsRetrieveRequest, - flow_type: CallConnectorAction, -) -> RouterResponse<api::PaymentsResponse> { - payments_core::<api::PSync, api::PaymentsResponse, _, _, _>( - state, - merchant_account, - PaymentStatus, - req, - services::api::AuthFlow::Merchant, - flow_type, - ) - .await +#[derive(Clone, Debug)] +pub struct PaymentRedirectCompleteAuthorize; + +#[async_trait::async_trait] +impl PaymentRedirectFlow for PaymentRedirectCompleteAuthorize { + async fn call_payment_flow( + &self, + state: &AppState, + merchant_account: storage::MerchantAccount, + req: PaymentsRedirectResponseData, + connector_action: CallConnectorAction, + ) -> RouterResponse<api::PaymentsResponse> { + let payment_confirm_req = api::PaymentsRequest { + payment_id: Some(req.resource_id.clone()), + merchant_id: req.merchant_id.clone(), + ..Default::default() + }; + payments_core::<api::CompleteAuthorize, api::PaymentsResponse, _, _, _>( + state, + merchant_account, + payment_complete_authorize::CompleteAuthorize, + payment_confirm_req, + services::api::AuthFlow::Merchant, + connector_action, + ) + .await + } + + fn get_payment_action(&self) -> services::PaymentAction { + services::PaymentAction::CompleteAuthorize + } +} + +#[derive(Clone, Debug)] +pub struct PaymentRedirectSync; + +#[async_trait::async_trait] +impl PaymentRedirectFlow for PaymentRedirectSync { + async fn call_payment_flow( + &self, + state: &AppState, + merchant_account: storage::MerchantAccount, + req: PaymentsRedirectResponseData, + connector_action: CallConnectorAction, + ) -> RouterResponse<api::PaymentsResponse> { + let payment_sync_req = api::PaymentsRetrieveRequest { + resource_id: req.resource_id, + merchant_id: req.merchant_id, + param: req.param, + force_sync: req.force_sync, + connector: req.connector, + }; + payments_core::<api::PSync, api::PaymentsResponse, _, _, _>( + state, + merchant_account, + PaymentStatus, + payment_sync_req, + services::api::AuthFlow::Merchant, + connector_action, + ) + .await + } + + fn get_payment_action(&self) -> services::PaymentAction { + services::PaymentAction::PSync + } } #[allow(clippy::too_many_arguments)] @@ -479,6 +552,7 @@ where Ok(payment_data) } +#[derive(Clone, Debug)] pub enum CallConnectorAction { Trigger, Avoid, @@ -598,6 +672,7 @@ pub fn should_call_connector<Op: Debug, F: Clone>( storage_enums::IntentStatus::RequiresCapture ) } + "CompleteAuthorize" => true, "PaymentSession" => true, _ => false, } diff --git a/crates/router/src/core/payments/access_token.rs b/crates/router/src/core/payments/access_token.rs index 38d8320d9d9..0ff7a1baeee 100644 --- a/crates/router/src/core/payments/access_token.rs +++ b/crates/router/src/core/payments/access_token.rs @@ -38,6 +38,7 @@ pub fn router_data_type_conversion<F1, F2, Req1, Req2, Res1, Res2>( connector_meta_data: router_data.connector_meta_data, description: router_data.description, router_return_url: router_data.router_return_url, + complete_authorize_url: router_data.complete_authorize_url, payment_id: router_data.payment_id, payment_method: router_data.payment_method, payment_method_id: router_data.payment_method_id, diff --git a/crates/router/src/core/payments/flows.rs b/crates/router/src/core/payments/flows.rs index f46be7e07c9..75bd16a4f3a 100644 --- a/crates/router/src/core/payments/flows.rs +++ b/crates/router/src/core/payments/flows.rs @@ -1,6 +1,7 @@ pub mod authorize_flow; pub mod cancel_flow; pub mod capture_flow; +pub mod complete_authorize_flow; pub mod psync_flow; pub mod session_flow; pub mod verfiy_flow; @@ -8,7 +9,11 @@ pub mod verfiy_flow; use async_trait::async_trait; use crate::{ - core::{errors::RouterResult, payments}, + connector, + core::{ + errors::{ConnectorError, CustomResult, RouterResult}, + payments, + }, routes::AppState, services, types::{self, api, storage}, @@ -50,3 +55,82 @@ pub trait Feature<F, T> { Self: Sized, dyn api::Connector: services::ConnectorIntegration<F, T, types::PaymentsResponseData>; } + +macro_rules! default_imp_for_complete_authorize{ + ($($path:ident::$connector:ident),*)=> { + $( + impl api::PaymentsCompleteAuthorize for $path::$connector {} + impl + services::ConnectorIntegration< + api::CompleteAuthorize, + types::CompleteAuthorizeData, + types::PaymentsResponseData, + > for $path::$connector + {} + )* + }; +} + +default_imp_for_complete_authorize!( + connector::Aci, + connector::Adyen, + connector::Airwallex, + connector::Applepay, + connector::Authorizedotnet, + connector::Bambora, + connector::Bluesnap, + connector::Braintree, + connector::Checkout, + connector::Cybersource, + connector::Dlocal, + connector::Fiserv, + connector::Globalpay, + connector::Klarna, + connector::Multisafepay, + connector::Payu, + connector::Rapyd, + connector::Shift4, + connector::Stripe, + connector::Trustpay, + connector::Worldline, + connector::Worldpay +); + +macro_rules! default_imp_for_connector_redirect_response{ + ($($path:ident::$connector:ident),*)=> { + $( + impl services::ConnectorRedirectResponse for $path::$connector { + fn get_flow_type( + &self, + _query_params: &str, + _json_payload: Option<serde_json::Value>, + _action: services::PaymentAction + ) -> CustomResult<payments::CallConnectorAction, ConnectorError> { + Ok(payments::CallConnectorAction::Trigger) + } + } + )* + }; +} + +default_imp_for_connector_redirect_response!( + connector::Aci, + connector::Adyen, + connector::Airwallex, + connector::Applepay, + connector::Authorizedotnet, + connector::Bambora, + connector::Bluesnap, + connector::Braintree, + connector::Cybersource, + connector::Dlocal, + connector::Fiserv, + connector::Globalpay, + connector::Klarna, + connector::Multisafepay, + connector::Payu, + connector::Rapyd, + connector::Shift4, + connector::Worldline, + connector::Worldpay +); diff --git a/crates/router/src/core/payments/flows/authorize_flow.rs b/crates/router/src/core/payments/flows/authorize_flow.rs index 215bcca82ab..a63508ac7a8 100644 --- a/crates/router/src/core/payments/flows/authorize_flow.rs +++ b/crates/router/src/core/payments/flows/authorize_flow.rs @@ -101,6 +101,7 @@ impl types::PaymentsAuthorizeRouterData { .execute_pretasks(self, state) .await .map_err(|error| error.to_payment_failed_response())?; + self.decide_authentication_type(); let resp = services::execute_connector_processing_step( state, connector_integration, @@ -118,6 +119,14 @@ impl types::PaymentsAuthorizeRouterData { _ => Ok(self.clone()), } } + + fn decide_authentication_type(&mut self) { + if self.auth_type == storage_models::enums::AuthenticationType::ThreeDs + && !self.request.enrolled_for_3ds + { + self.auth_type = storage_models::enums::AuthenticationType::NoThreeDs + } + } } impl mandate::MandateBehaviour for types::PaymentsAuthorizeData { diff --git a/crates/router/src/core/payments/flows/complete_authorize_flow.rs b/crates/router/src/core/payments/flows/complete_authorize_flow.rs new file mode 100644 index 00000000000..0e5f360703b --- /dev/null +++ b/crates/router/src/core/payments/flows/complete_authorize_flow.rs @@ -0,0 +1,104 @@ +use async_trait::async_trait; + +use super::{ConstructFlowSpecificData, Feature}; +use crate::{ + core::{ + errors::{ConnectorErrorExt, RouterResult}, + payments::{self, access_token, transformers, PaymentData}, + }, + routes::AppState, + services, + types::{self, api, storage}, +}; + +#[async_trait] +impl + ConstructFlowSpecificData< + api::CompleteAuthorize, + types::CompleteAuthorizeData, + types::PaymentsResponseData, + > for PaymentData<api::CompleteAuthorize> +{ + async fn construct_router_data<'a>( + &self, + state: &AppState, + connector_id: &str, + merchant_account: &storage::MerchantAccount, + ) -> RouterResult< + types::RouterData< + api::CompleteAuthorize, + types::CompleteAuthorizeData, + types::PaymentsResponseData, + >, + > { + transformers::construct_payment_router_data::< + api::CompleteAuthorize, + types::CompleteAuthorizeData, + >(state, self.clone(), connector_id, merchant_account) + .await + } +} + +#[async_trait] +impl Feature<api::CompleteAuthorize, types::CompleteAuthorizeData> + for types::RouterData< + api::CompleteAuthorize, + types::CompleteAuthorizeData, + types::PaymentsResponseData, + > +{ + async fn decide_flows<'a>( + self, + state: &AppState, + connector: &api::ConnectorData, + customer: &Option<storage::Customer>, + call_connector_action: payments::CallConnectorAction, + _merchant_account: &storage::MerchantAccount, + ) -> RouterResult<Self> { + self.decide_flow( + state, + connector, + customer, + Some(true), + call_connector_action, + ) + .await + } + + async fn add_access_token<'a>( + &self, + state: &AppState, + connector: &api::ConnectorData, + merchant_account: &storage::MerchantAccount, + ) -> RouterResult<types::AddAccessTokenResult> { + access_token::add_access_token(state, connector, merchant_account, self).await + } +} + +impl types::PaymentsCompleteAuthorizeRouterData { + pub async fn decide_flow<'a, 'b>( + &'b self, + state: &'a AppState, + connector: &api::ConnectorData, + _maybe_customer: &Option<storage::Customer>, + _confirm: Option<bool>, + call_connector_action: payments::CallConnectorAction, + ) -> RouterResult<Self> { + let connector_integration: services::BoxedConnectorIntegration< + '_, + api::CompleteAuthorize, + types::CompleteAuthorizeData, + types::PaymentsResponseData, + > = connector.connector.get_connector_integration(); + let resp = services::execute_connector_processing_step( + state, + connector_integration, + self, + call_connector_action, + ) + .await + .map_err(|error| error.to_payment_failed_response())?; + + Ok(resp) + } +} diff --git a/crates/router/src/core/payments/helpers.rs b/crates/router/src/core/payments/helpers.rs index e46eb0781d4..c1d29377ae9 100644 --- a/crates/router/src/core/payments/helpers.rs +++ b/crates/router/src/core/payments/helpers.rs @@ -351,6 +351,17 @@ pub fn create_redirect_url( server.base_url, payment_attempt.payment_id, payment_attempt.merchant_id, connector_name ) } +pub fn create_complete_authorize_url( + server: &Server, + payment_attempt: &storage::PaymentAttempt, + connector_name: &String, +) -> String { + format!( + "{}/payments/{}/{}/complete/{}", + server.base_url, payment_attempt.payment_id, payment_attempt.merchant_id, connector_name + ) +} + fn validate_recurring_mandate(req: api::MandateValidationFields) -> RouterResult<()> { req.mandate_id.check_value_present("mandate_id")?; diff --git a/crates/router/src/core/payments/operations.rs b/crates/router/src/core/payments/operations.rs index 688d08ba162..50e7648bb7b 100644 --- a/crates/router/src/core/payments/operations.rs +++ b/crates/router/src/core/payments/operations.rs @@ -1,5 +1,6 @@ pub mod payment_cancel; pub mod payment_capture; +pub mod payment_complete_authorize; pub mod payment_confirm; pub mod payment_create; pub mod payment_method_validate; diff --git a/crates/router/src/core/payments/operations/payment_complete_authorize.rs b/crates/router/src/core/payments/operations/payment_complete_authorize.rs new file mode 100644 index 00000000000..23de0ebdd40 --- /dev/null +++ b/crates/router/src/core/payments/operations/payment_complete_authorize.rs @@ -0,0 +1,342 @@ +use std::marker::PhantomData; + +use async_trait::async_trait; +use error_stack::ResultExt; +use router_derive::PaymentOperation; +use router_env::{instrument, tracing}; + +use super::{BoxedOperation, Domain, GetTracker, Operation, UpdateTracker, ValidateRequest}; +use crate::{ + core::{ + errors::{self, CustomResult, RouterResult, StorageErrorExt}, + payments::{helpers, operations, CustomerDetails, PaymentAddress, PaymentData}, + utils as core_utils, + }, + db::StorageInterface, + routes::AppState, + types::{ + self, + api::{self, PaymentIdTypeExt}, + storage::{self, enums as storage_enums}, + transformers::ForeignInto, + }, + utils::{self, OptionExt}, +}; + +#[derive(Debug, Clone, Copy, PaymentOperation)] +#[operation(ops = "all", flow = "authorize")] +pub struct CompleteAuthorize; + +#[async_trait] +impl<F: Send + Clone> GetTracker<F, PaymentData<F>, api::PaymentsRequest> for CompleteAuthorize { + #[instrument(skip_all)] + async fn get_trackers<'a>( + &'a self, + state: &'a AppState, + payment_id: &api::PaymentIdType, + request: &api::PaymentsRequest, + mandate_type: Option<api::MandateTxnType>, + merchant_account: &storage::MerchantAccount, + ) -> RouterResult<( + BoxedOperation<'a, F, api::PaymentsRequest>, + PaymentData<F>, + Option<CustomerDetails>, + )> { + let db = &*state.store; + let merchant_id = &merchant_account.merchant_id; + let storage_scheme = merchant_account.storage_scheme; + let (mut payment_intent, mut payment_attempt, currency, amount, connector_response); + + let payment_id = payment_id + .get_payment_intent_id() + .change_context(errors::ApiErrorResponse::PaymentNotFound)?; + + payment_intent = db + .find_payment_intent_by_payment_id_merchant_id(&payment_id, merchant_id, storage_scheme) + .await + .map_err(|error| { + error.to_not_found_response(errors::ApiErrorResponse::PaymentNotFound) + })?; + payment_intent.setup_future_usage = request + .setup_future_usage + .map(ForeignInto::foreign_into) + .or(payment_intent.setup_future_usage); + + helpers::validate_payment_status_against_not_allowed_statuses( + &payment_intent.status, + &[ + storage_enums::IntentStatus::Failed, + storage_enums::IntentStatus::Succeeded, + ], + "confirm", + )?; + + let (token, payment_method, setup_mandate) = helpers::get_token_pm_type_mandate_details( + state, + request, + mandate_type.clone(), + merchant_account, + ) + .await?; + + helpers::authenticate_client_secret( + request.client_secret.as_ref(), + payment_intent.client_secret.as_ref(), + )?; + + let browser_info = request + .browser_info + .clone() + .map(|x| utils::Encode::<types::BrowserInformation>::encode_to_value(&x)) + .transpose() + .change_context(errors::ApiErrorResponse::InvalidDataValue { + field_name: "browser_info", + })?; + + payment_attempt = db + .find_payment_attempt_by_payment_id_merchant_id( + &payment_id, + merchant_id, + storage_scheme, + ) + .await + .map_err(|error| { + error.to_not_found_response(errors::ApiErrorResponse::PaymentNotFound) + })?; + + let token = token.or_else(|| payment_attempt.payment_token.clone()); + + helpers::validate_pm_or_token_given( + &request.payment_method, + &request.payment_method_data, + &request.payment_method_type, + &mandate_type, + &token, + )?; + + payment_attempt.payment_method = payment_method.or(payment_attempt.payment_method); + payment_attempt.browser_info = browser_info; + payment_attempt.payment_method_type = request + .payment_method_type + .map(|pmt| pmt.foreign_into()) + .or(payment_attempt.payment_method_type); + payment_attempt.payment_experience = request + .payment_experience + .map(|experience| experience.foreign_into()); + currency = payment_attempt.currency.get_required_value("currency")?; + amount = payment_attempt.amount.into(); + + helpers::validate_customer_id_mandatory_cases( + request.shipping.is_some(), + request.billing.is_some(), + request.setup_future_usage.is_some(), + &payment_intent + .customer_id + .clone() + .or_else(|| request.customer_id.clone()), + )?; + + let shipping_address = helpers::get_address_for_payment_request( + db, + request.shipping.as_ref(), + payment_intent.shipping_address_id.as_deref(), + merchant_id, + &payment_intent.customer_id, + ) + .await?; + let billing_address = helpers::get_address_for_payment_request( + db, + request.billing.as_ref(), + payment_intent.billing_address_id.as_deref(), + merchant_id, + &payment_intent.customer_id, + ) + .await?; + + connector_response = db + .find_connector_response_by_payment_id_merchant_id_attempt_id( + &payment_attempt.payment_id, + &payment_attempt.merchant_id, + &payment_attempt.attempt_id, + storage_scheme, + ) + .await + .map_err(|error| { + error.to_not_found_response(errors::ApiErrorResponse::PaymentNotFound) + })?; + + payment_intent.shipping_address_id = shipping_address.clone().map(|i| i.address_id); + payment_intent.billing_address_id = billing_address.clone().map(|i| i.address_id); + payment_intent.return_url = request.return_url.as_ref().map(|a| a.to_string()); + + Ok(( + Box::new(self), + PaymentData { + flow: PhantomData, + payment_intent, + payment_attempt, + currency, + connector_response, + amount, + email: request.email.clone(), + mandate_id: None, + setup_mandate, + token, + address: PaymentAddress { + shipping: shipping_address.as_ref().map(|a| a.foreign_into()), + billing: billing_address.as_ref().map(|a| a.foreign_into()), + }, + confirm: request.confirm, + payment_method_data: request.payment_method_data.clone(), + force_sync: None, + refunds: vec![], + sessions_token: vec![], + card_cvc: request.card_cvc.clone(), + }, + Some(CustomerDetails { + customer_id: request.customer_id.clone(), + name: request.name.clone(), + email: request.email.clone(), + phone: request.phone.clone(), + phone_country_code: request.phone_country_code.clone(), + }), + )) + } +} + +#[async_trait] +impl<F: Clone + Send> Domain<F, api::PaymentsRequest> for CompleteAuthorize { + #[instrument(skip_all)] + async fn get_or_create_customer_details<'a>( + &'a self, + db: &dyn StorageInterface, + payment_data: &mut PaymentData<F>, + request: Option<CustomerDetails>, + merchant_id: &str, + ) -> CustomResult< + ( + BoxedOperation<'a, F, api::PaymentsRequest>, + Option<storage::Customer>, + ), + errors::StorageError, + > { + helpers::create_customer_if_not_exist( + Box::new(self), + db, + payment_data, + request, + merchant_id, + ) + .await + } + + #[instrument(skip_all)] + async fn make_pm_data<'a>( + &'a self, + state: &'a AppState, + payment_data: &mut PaymentData<F>, + _storage_scheme: storage_enums::MerchantStorageScheme, + ) -> RouterResult<( + BoxedOperation<'a, F, api::PaymentsRequest>, + Option<api::PaymentMethodData>, + )> { + let (op, payment_method_data) = + helpers::make_pm_data(Box::new(self), state, payment_data).await?; + + utils::when(payment_method_data.is_none(), || { + Err(errors::ApiErrorResponse::PaymentMethodNotFound) + })?; + + Ok((op, payment_method_data)) + } + + #[instrument(skip_all)] + async fn add_task_to_process_tracker<'a>( + &'a self, + _state: &'a AppState, + _payment_attempt: &storage::PaymentAttempt, + ) -> CustomResult<(), errors::ApiErrorResponse> { + Ok(()) + } + + async fn get_connector<'a>( + &'a self, + _merchant_account: &storage::MerchantAccount, + state: &AppState, + request: &api::PaymentsRequest, + previously_used_connector: Option<&String>, + ) -> CustomResult<api::ConnectorCallType, errors::ApiErrorResponse> { + // Use a new connector in the confirm call or use the same one which was passed when + // creating the payment or if none is passed then use the routing algorithm + let request_connector = request + .connector + .as_ref() + .and_then(|connector| connector.first().map(|c| c.to_string())); + helpers::get_connector_default( + state, + request_connector.as_ref().or(previously_used_connector), + ) + .await + } +} + +#[async_trait] +impl<F: Clone> UpdateTracker<F, PaymentData<F>, api::PaymentsRequest> for CompleteAuthorize { + #[instrument(skip_all)] + async fn update_trackers<'b>( + &'b self, + _db: &dyn StorageInterface, + _payment_id: &api::PaymentIdType, + payment_data: PaymentData<F>, + _customer: Option<storage::Customer>, + _storage_scheme: storage_enums::MerchantStorageScheme, + ) -> RouterResult<(BoxedOperation<'b, F, api::PaymentsRequest>, PaymentData<F>)> + where + F: 'b + Send, + { + Ok((Box::new(self), payment_data)) + } +} + +impl<F: Send + Clone> ValidateRequest<F, api::PaymentsRequest> for CompleteAuthorize { + #[instrument(skip_all)] + fn validate_request<'a, 'b>( + &'b self, + request: &api::PaymentsRequest, + merchant_account: &'a storage::MerchantAccount, + ) -> RouterResult<( + BoxedOperation<'b, F, api::PaymentsRequest>, + operations::ValidateResult<'a>, + )> { + let given_payment_id = match &request.payment_id { + Some(id_type) => Some( + id_type + .get_payment_intent_id() + .change_context(errors::ApiErrorResponse::PaymentNotFound)?, + ), + None => None, + }; + + let request_merchant_id = request.merchant_id.as_deref(); + helpers::validate_merchant_id(&merchant_account.merchant_id, request_merchant_id) + .change_context(errors::ApiErrorResponse::InvalidDataFormat { + field_name: "merchant_id".to_string(), + expected_format: "merchant_id from merchant account".to_string(), + })?; + + helpers::validate_payment_method_fields_present(request)?; + + let mandate_type = helpers::validate_mandate(request)?; + let payment_id = core_utils::get_or_generate_id("payment_id", &given_payment_id, "pay")?; + + Ok(( + Box::new(self), + operations::ValidateResult { + merchant_id: &merchant_account.merchant_id, + payment_id: api::PaymentIdType::PaymentIntentId(payment_id), + mandate_type, + storage_scheme: merchant_account.storage_scheme, + }, + )) + } +} diff --git a/crates/router/src/core/payments/operations/payment_response.rs b/crates/router/src/core/payments/operations/payment_response.rs index 43f08b93917..1455c03883a 100644 --- a/crates/router/src/core/payments/operations/payment_response.rs +++ b/crates/router/src/core/payments/operations/payment_response.rs @@ -22,7 +22,7 @@ use crate::{ #[derive(Debug, Clone, Copy, router_derive::PaymentOperation)] #[operation( ops = "post_tracker", - flow = "syncdata,authorizedata,canceldata,capturedata,verifydata,sessiondata" + flow = "syncdata,authorizedata,canceldata,capturedata,completeauthorizedata,verifydata,sessiondata" )] pub struct PaymentResponse; @@ -262,6 +262,26 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::VerifyRequestData> fo } } +#[async_trait] +impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::CompleteAuthorizeData> + for PaymentResponse +{ + async fn update_tracker<'b>( + &'b self, + db: &dyn StorageInterface, + payment_id: &api::PaymentIdType, + payment_data: PaymentData<F>, + response: types::RouterData<F, types::CompleteAuthorizeData, types::PaymentsResponseData>, + storage_scheme: enums::MerchantStorageScheme, + ) -> RouterResult<PaymentData<F>> + where + F: 'b + Send, + { + payment_response_update_tracker(db, payment_id, payment_data, response, storage_scheme) + .await + } +} + async fn payment_response_update_tracker<F: Clone, T>( db: &dyn StorageInterface, _payment_id: &api::PaymentIdType, diff --git a/crates/router/src/core/payments/transformers.rs b/crates/router/src/core/payments/transformers.rs index 9c0d3833cb8..1889ecabe89 100644 --- a/crates/router/src/core/payments/transformers.rs +++ b/crates/router/src/core/payments/transformers.rs @@ -74,6 +74,11 @@ where &payment_data.payment_attempt, &merchant_connector_account.connector_name, )); + let complete_authorize_url = Some(helpers::create_complete_authorize_url( + &state.conf.server, + &payment_data.payment_attempt, + &merchant_connector_account.connector_name, + )); router_data = types::RouterData { flow: PhantomData, @@ -87,6 +92,7 @@ where description: payment_data.payment_intent.description.clone(), return_url: payment_data.payment_intent.return_url.clone(), router_return_url, + complete_authorize_url, payment_method_id: payment_data.payment_attempt.payment_method_id.clone(), address: payment_data.address.clone(), auth_type: payment_data @@ -440,6 +446,9 @@ impl<F: Clone> TryFrom<PaymentData<F>> for types::PaymentsAuthorizeData { email: payment_data.email, payment_experience: payment_data.payment_attempt.payment_experience, order_details, + session_token: None, + enrolled_for_3ds: false, + related_transaction_id: None, payment_method_type: payment_data.payment_attempt.payment_method_type, }) } @@ -458,6 +467,7 @@ impl<F: Clone> TryFrom<PaymentData<F>> for types::PaymentsSyncData { }, encoded_data: payment_data.connector_response.encoded_data, capture_method: payment_data.payment_attempt.capture_method, + connector_meta: payment_data.payment_attempt.connector_metadata, }) } } @@ -547,3 +557,34 @@ impl<F: Clone> TryFrom<PaymentData<F>> for types::VerifyRequestData { }) } } + +impl<F: Clone> TryFrom<PaymentData<F>> for types::CompleteAuthorizeData { + type Error = error_stack::Report<errors::ApiErrorResponse>; + + fn try_from(payment_data: PaymentData<F>) -> Result<Self, Self::Error> { + let browser_info: Option<types::BrowserInformation> = payment_data + .payment_attempt + .browser_info + .map(|b| b.parse_value("BrowserInformation")) + .transpose() + .change_context(errors::ApiErrorResponse::InvalidDataValue { + field_name: "browser_info", + })?; + Ok(Self { + setup_future_usage: payment_data.payment_intent.setup_future_usage, + mandate_id: payment_data.mandate_id.clone(), + off_session: payment_data.mandate_id.as_ref().map(|_| true), + setup_mandate_details: payment_data.setup_mandate.clone(), + confirm: payment_data.payment_attempt.confirm, + statement_descriptor_suffix: payment_data.payment_intent.statement_descriptor_suffix, + capture_method: payment_data.payment_attempt.capture_method, + amount: payment_data.amount.into(), + currency: payment_data.currency, + browser_info, + email: payment_data.email, + payment_method_data: payment_data.payment_method_data, + connector_transaction_id: payment_data.connector_response.connector_transaction_id, + connector_meta: payment_data.payment_attempt.connector_metadata, + }) + } +} diff --git a/crates/router/src/core/utils.rs b/crates/router/src/core/utils.rs index ff5b59e3f97..f82b19bcc40 100644 --- a/crates/router/src/core/utils.rs +++ b/crates/router/src/core/utils.rs @@ -60,6 +60,7 @@ pub async fn construct_refund_router_data<'a, F>( description: None, return_url: payment_intent.return_url.clone(), router_return_url: None, + complete_authorize_url: None, payment_method_id: payment_attempt.payment_method_id.clone(), // Does refund need shipping/billing address ? address: PaymentAddress::default(), diff --git a/crates/router/src/routes/app.rs b/crates/router/src/routes/app.rs index 3adc51dad25..7f5c08133cd 100644 --- a/crates/router/src/routes/app.rs +++ b/crates/router/src/routes/app.rs @@ -111,6 +111,11 @@ impl Payments { .service( web::resource("/{payment_id}/{merchant_id}/response/{connector}") .route(web::get().to(payments_redirect_response)), + ) + .service( + web::resource("/{payment_id}/{merchant_id}/complete/{connector}") + // .route(web::get().to(payments_redirect_response)) + .route(web::post().to(payments_complete_authorize)), ); } route diff --git a/crates/router/src/routes/payments.rs b/crates/router/src/routes/payments.rs index 88b8a754d62..ccfc18692ad 100644 --- a/crates/router/src/routes/payments.rs +++ b/crates/router/src/routes/payments.rs @@ -4,7 +4,10 @@ use router_env::{instrument, tracing, Flow}; use crate::{ self as app, - core::{errors::http_not_implemented, payments}, + core::{ + errors::http_not_implemented, + payments::{self, PaymentRedirectFlow}, + }, services::{api, authentication as auth}, types::api::{self as api_types, enums as api_enums, payments as payment_types}, }; @@ -405,11 +408,46 @@ pub async fn payments_redirect_response( let (payment_id, merchant_id, connector) = path.into_inner(); let param_string = req.query_string(); - let payload = payment_types::PaymentsRetrieveRequest { + let payload = payments::PaymentsRedirectResponseData { resource_id: payment_types::PaymentIdType::PaymentIntentId(payment_id), merchant_id: Some(merchant_id.clone()), force_sync: true, + json_payload: None, + param: Some(param_string.to_string()), + connector: Some(connector), + }; + api::server_wrap( + state.get_ref(), + &req, + payload, + |state, merchant_account, req| { + payments::PaymentRedirectSync {}.handle_payments_redirect_response( + state, + merchant_account, + req, + ) + }, + &auth::MerchantIdAuth(merchant_id), + ) + .await +} + +#[instrument(skip_all)] +pub async fn payments_complete_authorize( + state: web::Data<app::AppState>, + req: actix_web::HttpRequest, + json_payload: web::Form<serde_json::Value>, + path: web::Path<(String, String, String)>, +) -> impl Responder { + let (payment_id, merchant_id, connector) = path.into_inner(); + let param_string = req.query_string(); + + let payload = payments::PaymentsRedirectResponseData { + resource_id: payment_types::PaymentIdType::PaymentIntentId(payment_id), + merchant_id: Some(merchant_id.clone()), param: Some(param_string.to_string()), + json_payload: Some(json_payload.0), + force_sync: false, connector: Some(connector), }; api::server_wrap( @@ -417,7 +455,7 @@ pub async fn payments_redirect_response( &req, payload, |state, merchant_account, req| { - payments::handle_payments_redirect_response::<api_types::PSync>( + payments::PaymentRedirectCompleteAuthorize {}.handle_payments_redirect_response( state, merchant_account, req, diff --git a/crates/router/src/services/api.rs b/crates/router/src/services/api.rs index 5c20ed3aad3..4a861d5e928 100644 --- a/crates/router/src/services/api.rs +++ b/crates/router/src/services/api.rs @@ -369,6 +369,12 @@ pub enum ApplicationResponse<R> { Form(RedirectForm), } +#[derive(Debug, Eq, PartialEq)] +pub enum PaymentAction { + PSync, + CompleteAuthorize, +} + #[derive(Debug, Eq, PartialEq, Serialize)] pub struct ApplicationRedirectResponse { pub url: String, @@ -574,6 +580,8 @@ pub trait ConnectorRedirectResponse { fn get_flow_type( &self, _query_params: &str, + _json_payload: Option<serde_json::Value>, + _action: PaymentAction, ) -> CustomResult<payments::CallConnectorAction, errors::ConnectorError> { Ok(payments::CallConnectorAction::Avoid) } diff --git a/crates/router/src/types.rs b/crates/router/src/types.rs index f98fe0666ff..cdaf00ad714 100644 --- a/crates/router/src/types.rs +++ b/crates/router/src/types.rs @@ -24,6 +24,10 @@ pub type PaymentsAuthorizeRouterData = RouterData<api::Authorize, PaymentsAuthorizeData, PaymentsResponseData>; pub type PaymentsAuthorizeSessionTokenRouterData = RouterData<api::AuthorizeSessionToken, AuthorizeSessionTokenData, PaymentsResponseData>; +pub type PaymentsCompleteAuthorizeRouterData = + RouterData<api::CompleteAuthorize, CompleteAuthorizeData, PaymentsResponseData>; +pub type PaymentsInitRouterData = + RouterData<api::InitPayment, PaymentsAuthorizeData, PaymentsResponseData>; pub type PaymentsSyncRouterData = RouterData<api::PSync, PaymentsSyncData, PaymentsResponseData>; pub type PaymentsCaptureRouterData = RouterData<api::Capture, PaymentsCaptureData, PaymentsResponseData>; @@ -53,11 +57,21 @@ pub type RefundsResponseRouterData<F, R> = pub type PaymentsAuthorizeType = dyn services::ConnectorIntegration<api::Authorize, PaymentsAuthorizeData, PaymentsResponseData>; +pub type PaymentsComeplteAuthorizeType = dyn services::ConnectorIntegration< + api::CompleteAuthorize, + CompleteAuthorizeData, + PaymentsResponseData, +>; pub type PaymentsPreAuthorizeType = dyn services::ConnectorIntegration< api::AuthorizeSessionToken, AuthorizeSessionTokenData, PaymentsResponseData, >; +pub type PaymentsInitType = dyn services::ConnectorIntegration< + api::InitPayment, + PaymentsAuthorizeData, + PaymentsResponseData, +>; pub type PaymentsSyncType = dyn services::ConnectorIntegration<api::PSync, PaymentsSyncData, PaymentsResponseData>; pub type PaymentsCaptureType = @@ -90,6 +104,7 @@ pub struct RouterData<Flow, Request, Response> { pub description: Option<String>, pub return_url: Option<String>, pub router_return_url: Option<String>, + pub complete_authorize_url: Option<String>, pub address: PaymentAddress, pub auth_type: storage_enums::AuthenticationType, pub connector_meta_data: Option<pii::SecretSerdeValue>, @@ -125,6 +140,9 @@ pub struct PaymentsAuthorizeData { pub setup_mandate_details: Option<payments::MandateData>, pub browser_info: Option<BrowserInformation>, pub order_details: Option<api_models::payments::OrderDetails>, + pub session_token: Option<String>, + pub enrolled_for_3ds: bool, + pub related_transaction_id: Option<String>, pub payment_experience: Option<storage_enums::PaymentExperience>, pub payment_method_type: Option<storage_enums::PaymentMethodType>, } @@ -146,11 +164,31 @@ pub struct AuthorizeSessionTokenData { } #[derive(Debug, Clone)] +pub struct CompleteAuthorizeData { + pub payment_method_data: Option<payments::PaymentMethodData>, + pub amount: i64, + pub email: Option<masking::Secret<String, Email>>, + pub currency: storage_enums::Currency, + pub confirm: bool, + pub statement_descriptor_suffix: Option<String>, + pub capture_method: Option<storage_enums::CaptureMethod>, + // Mandates + pub setup_future_usage: Option<storage_enums::FutureUsage>, + pub mandate_id: Option<api_models::payments::MandateIds>, + pub off_session: Option<bool>, + pub setup_mandate_details: Option<payments::MandateData>, + pub browser_info: Option<BrowserInformation>, + pub connector_transaction_id: Option<String>, + pub connector_meta: Option<serde_json::Value>, +} + +#[derive(Debug, Default, Clone)] pub struct PaymentsSyncData { //TODO : add fields based on the connector requirements pub connector_transaction_id: ResponseId, pub encoded_data: Option<String>, pub capture_method: Option<storage_enums::CaptureMethod>, + pub connector_meta: Option<serde_json::Value>, } #[derive(Debug, Default, Clone)] @@ -396,16 +434,26 @@ impl Default for ErrorResponse { } } -impl From<&&mut PaymentsAuthorizeRouterData> for PaymentsAuthorizeSessionTokenRouterData { +impl From<&&mut PaymentsAuthorizeRouterData> for AuthorizeSessionTokenData { fn from(data: &&mut PaymentsAuthorizeRouterData) -> Self { + Self { + amount_to_capture: data.amount_captured, + currency: data.request.currency, + connector_transaction_id: data.payment_id.clone(), + amount: data.request.amount, + } + } +} + +impl<F1, F2, T1, T2> From<(&&mut RouterData<F1, T1, PaymentsResponseData>, T2)> + for RouterData<F2, T2, PaymentsResponseData> +{ + fn from(item: (&&mut RouterData<F1, T1, PaymentsResponseData>, T2)) -> Self { + let data = item.0; + let request = item.1; Self { flow: PhantomData, - request: AuthorizeSessionTokenData { - amount_to_capture: data.amount_captured, - currency: data.request.currency, - connector_transaction_id: data.payment_id.clone(), - amount: data.request.amount, - }, + request, merchant_id: data.merchant_id.clone(), connector: data.connector.clone(), attempt_id: data.attempt_id.clone(), @@ -415,6 +463,7 @@ impl From<&&mut PaymentsAuthorizeRouterData> for PaymentsAuthorizeSessionTokenRo description: data.description.clone(), return_url: data.return_url.clone(), router_return_url: data.router_return_url.clone(), + complete_authorize_url: data.complete_authorize_url.clone(), address: data.address.clone(), auth_type: data.auth_type, connector_meta_data: data.connector_meta_data.clone(), diff --git a/crates/router/src/types/api/payments.rs b/crates/router/src/types/api/payments.rs index fd8001d24e2..047c9519c89 100644 --- a/crates/router/src/types/api/payments.rs +++ b/crates/router/src/types/api/payments.rs @@ -67,6 +67,11 @@ pub struct Authorize; #[derive(Debug, Clone)] pub struct AuthorizeSessionToken; + +#[derive(Debug, Clone)] +pub struct CompleteAuthorize; +#[derive(Debug, Clone)] +pub struct InitPayment; #[derive(Debug, Clone)] pub struct Capture; @@ -166,9 +171,19 @@ pub trait PreVerify: { } +pub trait PaymentsCompleteAuthorize: + api::ConnectorIntegration< + CompleteAuthorize, + types::CompleteAuthorizeData, + types::PaymentsResponseData, +> +{ +} + pub trait Payment: api_types::ConnectorCommon + PaymentAuthorize + + PaymentsCompleteAuthorize + PaymentSync + PaymentCapture + PaymentVoid diff --git a/crates/router/tests/connectors/aci.rs b/crates/router/tests/connectors/aci.rs index 9fbf3a881f7..4212f5c1c01 100644 --- a/crates/router/tests/connectors/aci.rs +++ b/crates/router/tests/connectors/aci.rs @@ -29,6 +29,7 @@ fn construct_payment_router_data() -> types::PaymentsAuthorizeRouterData { connector_auth_type: auth.into(), description: Some("This is a test".to_string()), router_return_url: None, + complete_authorize_url: None, return_url: None, request: types::PaymentsAuthorizeData { amount: 1000, @@ -53,6 +54,9 @@ fn construct_payment_router_data() -> types::PaymentsAuthorizeRouterData { browser_info: None, order_details: None, email: None, + session_token: None, + enrolled_for_3ds: false, + related_transaction_id: None, payment_experience: None, payment_method_type: None, }, @@ -80,6 +84,7 @@ fn construct_refund_router_data<F>() -> types::RefundsRouterData<F> { attempt_id: uuid::Uuid::new_v4().to_string(), status: enums::AttemptStatus::default(), router_return_url: None, + complete_authorize_url: None, payment_method: enums::PaymentMethod::Card, auth_type: enums::AuthenticationType::NoThreeDs, connector_auth_type: auth.into(), diff --git a/crates/router/tests/connectors/adyen.rs b/crates/router/tests/connectors/adyen.rs index cff3c79606d..55e3a706a48 100644 --- a/crates/router/tests/connectors/adyen.rs +++ b/crates/router/tests/connectors/adyen.rs @@ -83,6 +83,9 @@ impl AdyenTest { email: None, payment_experience: None, payment_method_type: None, + session_token: None, + enrolled_for_3ds: false, + related_transaction_id: None, }) } } diff --git a/crates/router/tests/connectors/airwallex.rs b/crates/router/tests/connectors/airwallex.rs index 9514402c489..207d46bf3f3 100644 --- a/crates/router/tests/connectors/airwallex.rs +++ b/crates/router/tests/connectors/airwallex.rs @@ -124,8 +124,7 @@ async fn should_sync_authorized_payment() { connector_transaction_id: router::types::ResponseId::ConnectorTransactionId( txn_id.unwrap(), ), - encoded_data: None, - capture_method: None, + ..Default::default() }), get_default_payment_info(), ) @@ -255,8 +254,7 @@ async fn should_sync_auto_captured_payment() { connector_transaction_id: router::types::ResponseId::ConnectorTransactionId( txn_id.unwrap(), ), - encoded_data: None, - capture_method: None, + ..Default::default() }), get_default_payment_info(), ) diff --git a/crates/router/tests/connectors/authorizedotnet.rs b/crates/router/tests/connectors/authorizedotnet.rs index b74d502f768..c3f6374524b 100644 --- a/crates/router/tests/connectors/authorizedotnet.rs +++ b/crates/router/tests/connectors/authorizedotnet.rs @@ -25,6 +25,7 @@ fn construct_payment_router_data() -> types::PaymentsAuthorizeRouterData { attempt_id: uuid::Uuid::new_v4().to_string(), status: enums::AttemptStatus::default(), router_return_url: None, + complete_authorize_url: None, payment_method: enums::PaymentMethod::Card, connector_auth_type: auth.into(), auth_type: enums::AuthenticationType::NoThreeDs, @@ -53,6 +54,9 @@ fn construct_payment_router_data() -> types::PaymentsAuthorizeRouterData { browser_info: None, order_details: None, email: None, + session_token: None, + enrolled_for_3ds: false, + related_transaction_id: None, payment_experience: None, payment_method_type: None, }, @@ -81,6 +85,7 @@ fn construct_refund_router_data<F>() -> types::RefundsRouterData<F> { attempt_id: uuid::Uuid::new_v4().to_string(), status: enums::AttemptStatus::default(), router_return_url: None, + complete_authorize_url: None, auth_type: enums::AuthenticationType::NoThreeDs, payment_method: enums::PaymentMethod::Card, connector_auth_type: auth.into(), diff --git a/crates/router/tests/connectors/bambora.rs b/crates/router/tests/connectors/bambora.rs index 6d8f62d4d4f..22fffe4dcb2 100644 --- a/crates/router/tests/connectors/bambora.rs +++ b/crates/router/tests/connectors/bambora.rs @@ -102,6 +102,7 @@ async fn should_sync_authorized_payment() { ), encoded_data: None, capture_method: None, + connector_meta: None, }), None, ) @@ -213,6 +214,7 @@ async fn should_sync_auto_captured_payment() { ), encoded_data: None, capture_method: Some(enums::CaptureMethod::Automatic), + connector_meta: None, }), None, ) diff --git a/crates/router/tests/connectors/bluesnap.rs b/crates/router/tests/connectors/bluesnap.rs index 98135572df0..4c1fa64f999 100644 --- a/crates/router/tests/connectors/bluesnap.rs +++ b/crates/router/tests/connectors/bluesnap.rs @@ -94,8 +94,7 @@ async fn should_sync_authorized_payment() { connector_transaction_id: router::types::ResponseId::ConnectorTransactionId( txn_id.unwrap(), ), - encoded_data: None, - capture_method: None, + ..Default::default() }), None, ) @@ -229,8 +228,7 @@ async fn should_sync_auto_captured_payment() { connector_transaction_id: router::types::ResponseId::ConnectorTransactionId( txn_id.unwrap(), ), - encoded_data: None, - capture_method: None, + ..Default::default() }), None, ) diff --git a/crates/router/tests/connectors/checkout.rs b/crates/router/tests/connectors/checkout.rs index 2c28753cce0..6434e451a9f 100644 --- a/crates/router/tests/connectors/checkout.rs +++ b/crates/router/tests/connectors/checkout.rs @@ -22,6 +22,7 @@ fn construct_payment_router_data() -> types::PaymentsAuthorizeRouterData { attempt_id: uuid::Uuid::new_v4().to_string(), status: enums::AttemptStatus::default(), router_return_url: None, + complete_authorize_url: None, auth_type: enums::AuthenticationType::NoThreeDs, payment_method: enums::PaymentMethod::Card, connector_auth_type: auth.into(), @@ -50,6 +51,9 @@ fn construct_payment_router_data() -> types::PaymentsAuthorizeRouterData { browser_info: None, order_details: None, email: None, + session_token: None, + enrolled_for_3ds: false, + related_transaction_id: None, payment_experience: None, payment_method_type: None, }, @@ -78,6 +82,7 @@ fn construct_refund_router_data<F>() -> types::RefundsRouterData<F> { attempt_id: uuid::Uuid::new_v4().to_string(), status: enums::AttemptStatus::default(), router_return_url: None, + complete_authorize_url: None, payment_method: enums::PaymentMethod::Card, auth_type: enums::AuthenticationType::NoThreeDs, connector_auth_type: auth.into(), diff --git a/crates/router/tests/connectors/cybersource.rs b/crates/router/tests/connectors/cybersource.rs index 7b1ae4d9487..7b38103081f 100644 --- a/crates/router/tests/connectors/cybersource.rs +++ b/crates/router/tests/connectors/cybersource.rs @@ -122,8 +122,7 @@ async fn should_sync_payment() { connector_transaction_id: router::types::ResponseId::ConnectorTransactionId( "6699597903496176903954".to_string(), ), - encoded_data: None, - capture_method: None, + ..Default::default() }), None, ) diff --git a/crates/router/tests/connectors/dlocal.rs b/crates/router/tests/connectors/dlocal.rs index eae58e3801b..7312d0462c5 100644 --- a/crates/router/tests/connectors/dlocal.rs +++ b/crates/router/tests/connectors/dlocal.rs @@ -88,8 +88,7 @@ async fn should_sync_authorized_payment() { connector_transaction_id: router::types::ResponseId::ConnectorTransactionId( txn_id.unwrap(), ), - encoded_data: None, - capture_method: None, + ..Default::default() }), Some(get_payment_info()), ) @@ -200,8 +199,7 @@ async fn should_sync_auto_captured_payment() { connector_transaction_id: router::types::ResponseId::ConnectorTransactionId( txn_id.unwrap(), ), - encoded_data: None, - capture_method: None, + ..Default::default() }), Some(get_payment_info()), ) diff --git a/crates/router/tests/connectors/fiserv.rs b/crates/router/tests/connectors/fiserv.rs index 6d5098517c4..8b1c397c415 100644 --- a/crates/router/tests/connectors/fiserv.rs +++ b/crates/router/tests/connectors/fiserv.rs @@ -119,8 +119,7 @@ async fn should_sync_authorized_payment() { connector_transaction_id: router::types::ResponseId::ConnectorTransactionId( txn_id.unwrap(), ), - encoded_data: None, - capture_method: None, + ..Default::default() }), get_default_payment_info(), ) @@ -249,8 +248,7 @@ async fn should_sync_auto_captured_payment() { connector_transaction_id: router::types::ResponseId::ConnectorTransactionId( txn_id.unwrap(), ), - encoded_data: None, - capture_method: None, + ..Default::default() }), get_default_payment_info(), ) diff --git a/crates/router/tests/connectors/globalpay.rs b/crates/router/tests/connectors/globalpay.rs index e4a1ba9af0c..aaea15ab43b 100644 --- a/crates/router/tests/connectors/globalpay.rs +++ b/crates/router/tests/connectors/globalpay.rs @@ -105,8 +105,7 @@ async fn should_sync_payment() { connector_transaction_id: router::types::ResponseId::ConnectorTransactionId( txn_id.unwrap(), ), - encoded_data: None, - capture_method: None, + ..Default::default() }), get_default_payment_info(), ) diff --git a/crates/router/tests/connectors/multisafepay.rs b/crates/router/tests/connectors/multisafepay.rs index f5f3e981dea..5e7c165c8af 100644 --- a/crates/router/tests/connectors/multisafepay.rs +++ b/crates/router/tests/connectors/multisafepay.rs @@ -87,8 +87,7 @@ async fn should_sync_authorized_payment() { connector_transaction_id: router::types::ResponseId::ConnectorTransactionId( txn_id.unwrap(), ), - encoded_data: None, - capture_method: None, + ..Default::default() }), None, ) @@ -192,8 +191,7 @@ async fn should_sync_auto_captured_payment() { connector_transaction_id: router::types::ResponseId::ConnectorTransactionId( txn_id.unwrap(), ), - encoded_data: None, - capture_method: None, + ..Default::default() }), None, ) diff --git a/crates/router/tests/connectors/nuvei.rs b/crates/router/tests/connectors/nuvei.rs index 0b7556c3070..04ab6eeba57 100644 --- a/crates/router/tests/connectors/nuvei.rs +++ b/crates/router/tests/connectors/nuvei.rs @@ -7,7 +7,7 @@ use serde_json::json; use crate::{ connector_auth, - utils::{self, ConnectorActions, PaymentInfo}, + utils::{self, ConnectorActions}, }; #[derive(Clone, Copy)] @@ -101,15 +101,12 @@ async fn should_sync_authorized_payment() { connector_transaction_id: router::types::ResponseId::ConnectorTransactionId( txn_id.unwrap(), ), - encoded_data: None, - capture_method: None, - }), - Some(PaymentInfo { - connector_meta_data: Some(json!({ + connector_meta: Some(json!({ "session_token": authorize_response.session_token.unwrap() })), ..Default::default() }), + None, ) .await .expect("PSync response"); @@ -196,15 +193,12 @@ async fn should_sync_auto_captured_payment() { connector_transaction_id: router::types::ResponseId::ConnectorTransactionId( txn_id.unwrap(), ), - encoded_data: None, - capture_method: None, - }), - Some(PaymentInfo { - connector_meta_data: Some(json!({ + connector_meta: Some(json!({ "session_token": authorize_response.session_token.unwrap() })), ..Default::default() }), + None, ) .await .unwrap(); diff --git a/crates/router/tests/connectors/payu.rs b/crates/router/tests/connectors/payu.rs index 589ab55790d..018e2720cd7 100644 --- a/crates/router/tests/connectors/payu.rs +++ b/crates/router/tests/connectors/payu.rs @@ -70,8 +70,7 @@ async fn should_authorize_card_payment() { connector_transaction_id: router::types::ResponseId::ConnectorTransactionId( transaction_id.clone(), ), - encoded_data: None, - capture_method: None, + ..Default::default() }), get_default_payment_info(), ) @@ -116,8 +115,7 @@ async fn should_authorize_gpay_payment() { connector_transaction_id: router::types::ResponseId::ConnectorTransactionId( transaction_id.clone(), ), - encoded_data: None, - capture_method: None, + ..Default::default() }), get_default_payment_info(), ) @@ -150,8 +148,7 @@ async fn should_capture_already_authorized_payment() { connector_transaction_id: router::types::ResponseId::ConnectorTransactionId( transaction_id.clone(), ), - encoded_data: None, - capture_method: None, + ..Default::default() }), get_default_payment_info(), ) @@ -170,8 +167,7 @@ async fn should_capture_already_authorized_payment() { connector_transaction_id: router::types::ResponseId::ConnectorTransactionId( transaction_id, ), - encoded_data: None, - capture_method: None, + ..Default::default() }), get_default_payment_info(), ) @@ -207,8 +203,7 @@ async fn should_sync_payment() { connector_transaction_id: router::types::ResponseId::ConnectorTransactionId( transaction_id, ), - encoded_data: None, - capture_method: None, + ..Default::default() }), get_default_payment_info(), ) @@ -251,8 +246,7 @@ async fn should_void_already_authorized_payment() { connector_transaction_id: router::types::ResponseId::ConnectorTransactionId( transaction_id, ), - encoded_data: None, - capture_method: None, + ..Default::default() }), get_default_payment_info(), ) @@ -286,8 +280,7 @@ async fn should_refund_succeeded_payment() { connector_transaction_id: router::types::ResponseId::ConnectorTransactionId( transaction_id.clone(), ), - encoded_data: None, - capture_method: None, + ..Default::default() }), get_default_payment_info(), ) @@ -308,8 +301,7 @@ async fn should_refund_succeeded_payment() { connector_transaction_id: router::types::ResponseId::ConnectorTransactionId( transaction_id.clone(), ), - encoded_data: None, - capture_method: None, + ..Default::default() }), get_default_payment_info(), ) diff --git a/crates/router/tests/connectors/shift4.rs b/crates/router/tests/connectors/shift4.rs index 23157d546e2..73d2f4dffde 100644 --- a/crates/router/tests/connectors/shift4.rs +++ b/crates/router/tests/connectors/shift4.rs @@ -89,8 +89,7 @@ async fn should_sync_authorized_payment() { connector_transaction_id: router::types::ResponseId::ConnectorTransactionId( txn_id.unwrap(), ), - encoded_data: None, - capture_method: None, + ..Default::default() }), None, ) @@ -114,8 +113,7 @@ async fn should_sync_auto_captured_payment() { connector_transaction_id: router::types::ResponseId::ConnectorTransactionId( txn_id.unwrap(), ), - encoded_data: None, - capture_method: None, + ..Default::default() }), None, ) diff --git a/crates/router/tests/connectors/stripe.rs b/crates/router/tests/connectors/stripe.rs index 83e2c6bd8dc..c317684c0dd 100644 --- a/crates/router/tests/connectors/stripe.rs +++ b/crates/router/tests/connectors/stripe.rs @@ -99,8 +99,7 @@ async fn should_sync_authorized_payment() { connector_transaction_id: router::types::ResponseId::ConnectorTransactionId( txn_id.unwrap(), ), - encoded_data: None, - capture_method: None, + ..Default::default() }), None, ) @@ -124,8 +123,7 @@ async fn should_sync_payment() { connector_transaction_id: router::types::ResponseId::ConnectorTransactionId( txn_id.unwrap(), ), - encoded_data: None, - capture_method: None, + ..Default::default() }), None, ) diff --git a/crates/router/tests/connectors/trustpay.rs b/crates/router/tests/connectors/trustpay.rs index 8c530cd6fe0..50ed42c5d08 100644 --- a/crates/router/tests/connectors/trustpay.rs +++ b/crates/router/tests/connectors/trustpay.rs @@ -119,8 +119,7 @@ async fn should_sync_auto_captured_payment() { connector_transaction_id: router::types::ResponseId::ConnectorTransactionId( txn_id.unwrap(), ), - encoded_data: None, - capture_method: None, + ..Default::default() }), None, ) diff --git a/crates/router/tests/connectors/utils.rs b/crates/router/tests/connectors/utils.rs index c85b77d46e6..18ffb005d3b 100644 --- a/crates/router/tests/connectors/utils.rs +++ b/crates/router/tests/connectors/utils.rs @@ -361,6 +361,7 @@ pub trait ConnectorActions: Connector { attempt_id: uuid::Uuid::new_v4().to_string(), status: enums::AttemptStatus::default(), router_return_url: info.clone().and_then(|a| a.router_return_url), + complete_authorize_url: None, auth_type: info .clone() .map_or(enums::AuthenticationType::NoThreeDs, |a| { @@ -486,6 +487,9 @@ impl Default for PaymentAuthorizeType { browser_info: Some(BrowserInfoType::default().0), order_details: None, email: None, + session_token: None, + enrolled_for_3ds: false, + related_transaction_id: None, payment_experience: None, payment_method_type: None, }; @@ -540,6 +544,7 @@ impl Default for PaymentSyncType { ), encoded_data: None, capture_method: None, + connector_meta: None, }; Self(data) } diff --git a/crates/router/tests/connectors/worldline.rs b/crates/router/tests/connectors/worldline.rs index 375b5601151..cb14bb2c905 100644 --- a/crates/router/tests/connectors/worldline.rs +++ b/crates/router/tests/connectors/worldline.rs @@ -83,6 +83,9 @@ impl WorldlineTest { browser_info: None, order_details: None, email: None, + session_token: None, + enrolled_for_3ds: false, + related_transaction_id: None, payment_experience: None, payment_method_type: None, }) @@ -212,8 +215,8 @@ async fn should_sync_manual_auth_payment() { connector_transaction_id: router::types::ResponseId::ConnectorTransactionId( connector_payment_id, ), - encoded_data: None, capture_method: Some(enums::CaptureMethod::Manual), + ..Default::default() }), None, ) @@ -245,8 +248,8 @@ async fn should_sync_auto_auth_payment() { connector_transaction_id: router::types::ResponseId::ConnectorTransactionId( connector_payment_id, ), - encoded_data: None, capture_method: Some(enums::CaptureMethod::Automatic), + ..Default::default() }), None, ) diff --git a/crates/router/tests/connectors/worldpay.rs b/crates/router/tests/connectors/worldpay.rs index 62d1b5f62a0..48f87d9c767 100644 --- a/crates/router/tests/connectors/worldpay.rs +++ b/crates/router/tests/connectors/worldpay.rs @@ -150,8 +150,7 @@ async fn should_sync_payment() { connector_transaction_id: router::types::ResponseId::ConnectorTransactionId( "112233".to_string(), ), - encoded_data: None, - capture_method: None, + ..Default::default() }), None, ) diff --git a/crates/router_derive/src/macros/operation.rs b/crates/router_derive/src/macros/operation.rs index 32c0aae7e4a..5a5cd426aa9 100644 --- a/crates/router_derive/src/macros/operation.rs +++ b/crates/router_derive/src/macros/operation.rs @@ -16,6 +16,7 @@ enum Derives { Syncdata, Canceldata, Capturedata, + CompleteAuthorizeData, VerifyData, Start, Verify, @@ -34,6 +35,7 @@ impl From<String> for Derives { "canceldata" => Self::Canceldata, "capture" => Self::Capture, "capturedata" => Self::Capturedata, + "completeauthorizedata" => Self::CompleteAuthorizeData, "start" => Self::Start, "verify" => Self::Verify, "verifydata" => Self::VerifyData, @@ -110,6 +112,9 @@ impl Conversion { Derives::Canceldata => syn::Ident::new("PaymentsCancelData", Span::call_site()), Derives::Capture => syn::Ident::new("PaymentsCaptureRequest", Span::call_site()), Derives::Capturedata => syn::Ident::new("PaymentsCaptureData", Span::call_site()), + Derives::CompleteAuthorizeData => { + syn::Ident::new("CompleteAuthorizeData", Span::call_site()) + } Derives::Start => syn::Ident::new("PaymentsStartRequest", Span::call_site()), Derives::Verify => syn::Ident::new("VerifyRequest", Span::call_site()), Derives::VerifyData => syn::Ident::new("VerifyRequestData", Span::call_site()), @@ -328,6 +333,7 @@ pub fn operation_derive_inner(input: DeriveInput) -> syn::Result<proc_macro::Tok PaymentsCancelData, PaymentsAuthorizeData, PaymentsSessionData, + CompleteAuthorizeData, api::{ PaymentsCaptureRequest, diff --git a/loadtest/config/Development.toml b/loadtest/config/Development.toml index 63db687c2f5..a308557db6d 100644 --- a/loadtest/config/Development.toml +++ b/loadtest/config/Development.toml @@ -100,7 +100,7 @@ cards = [ "payu", "shift4", "stripe", + "trustpay", "worldline", "worldpay", - "trustpay", ]
feat
Add support for complete authorize payment after 3DS redirection (#741)
e33340e70b59e9e4f18e92fc27d8c90b3df5768b
2024-10-28 18:39:29
Debarati Ghatak
fix(connector): [Novalnet] Remove webhook placeholder connector config (#6451)
false
diff --git a/crates/connector_configs/toml/development.toml b/crates/connector_configs/toml/development.toml index 8cb42f33a26..886b2dd7ee7 100644 --- a/crates/connector_configs/toml/development.toml +++ b/crates/connector_configs/toml/development.toml @@ -2301,7 +2301,6 @@ key1="Payment Access Key" api_secret="Tariff ID" [novalnet.connector_webhook_details] merchant_secret="Source verification key" -placeholder="Enter Payment Access Key" [[novalnet.metadata.google_pay]] name="merchant_name" label="Google Pay Merchant Name" diff --git a/crates/connector_configs/toml/production.toml b/crates/connector_configs/toml/production.toml index b4b12318a6f..cc501a4c101 100644 --- a/crates/connector_configs/toml/production.toml +++ b/crates/connector_configs/toml/production.toml @@ -1794,7 +1794,6 @@ key1="Payment Access Key" api_secret="Tariff ID" [novalnet.connector_webhook_details] merchant_secret="Source verification key" -placeholder="Enter Payment Access Key" [[novalnet.metadata.google_pay]] name="merchant_name" label="Google Pay Merchant Name" diff --git a/crates/connector_configs/toml/sandbox.toml b/crates/connector_configs/toml/sandbox.toml index 7e83effb7a8..d767417a043 100644 --- a/crates/connector_configs/toml/sandbox.toml +++ b/crates/connector_configs/toml/sandbox.toml @@ -2268,7 +2268,6 @@ key1="Payment Access Key" api_secret="Tariff ID" [novalnet.connector_webhook_details] merchant_secret="Source verification key" -placeholder="Enter Payment Access Key" [[novalnet.metadata.google_pay]] name="merchant_name" label="Google Pay Merchant Name"
fix
[Novalnet] Remove webhook placeholder connector config (#6451)
19f8ee46e5a075fecfa1f80d71960928821bf468
2024-12-05 18:42:26
Kashif
refactor(connector-configs): worldpay - update username / password mapping (#6752)
false
diff --git a/crates/connector_configs/toml/development.toml b/crates/connector_configs/toml/development.toml index 68992ffbba4..1f2062cdea3 100644 --- a/crates/connector_configs/toml/development.toml +++ b/crates/connector_configs/toml/development.toml @@ -3543,8 +3543,8 @@ merchant_secret="Source verification key" [[worldpay.wallet]] payment_method_type = "apple_pay" [worldpay.connector_auth.SignatureKey] -api_key="Username" -key1="Password" +key1="Username" +api_key="Password" api_secret="Merchant Identifier" [worldpay.connector_webhook_details] merchant_secret="Source verification key" diff --git a/crates/connector_configs/toml/production.toml b/crates/connector_configs/toml/production.toml index 887a1398b48..443d3fd72ac 100644 --- a/crates/connector_configs/toml/production.toml +++ b/crates/connector_configs/toml/production.toml @@ -2546,8 +2546,8 @@ merchant_secret="Source verification key" [[worldpay.wallet]] payment_method_type = "apple_pay" [worldpay.connector_auth.SignatureKey] -api_key="Username" -key1="Password" +key1="Username" +api_key="Password" api_secret="Merchant Identifier" [worldpay.metadata.merchant_name] name="merchant_name" diff --git a/crates/connector_configs/toml/sandbox.toml b/crates/connector_configs/toml/sandbox.toml index 57cb9105042..1e9d274780b 100644 --- a/crates/connector_configs/toml/sandbox.toml +++ b/crates/connector_configs/toml/sandbox.toml @@ -3484,8 +3484,8 @@ merchant_secret="Source verification key" [[worldpay.wallet]] payment_method_type = "apple_pay" [worldpay.connector_auth.SignatureKey] -api_key="Username" -key1="Password" +key1="Username" +api_key="Password" api_secret="Merchant Identifier" [worldpay.connector_webhook_details] merchant_secret="Source verification key"
refactor
worldpay - update username / password mapping (#6752)
86a43b9bc41a358fe133c9fdea8dde09d4965c98
2024-10-08 18:04:11
Debarati Ghatak
fix(connector): remove placeholder from novalnet webhooks secret (#6268)
false
diff --git a/crates/connector_configs/toml/development.toml b/crates/connector_configs/toml/development.toml index e23dc830d54..3e81062b91e 100644 --- a/crates/connector_configs/toml/development.toml +++ b/crates/connector_configs/toml/development.toml @@ -2264,7 +2264,6 @@ key1="Payment Access Key" api_secret="Tariff ID" [novalnet.connector_webhook_details] merchant_secret="Source verification key" -placeholder="Enter Payment Access Key" [nuvei] [[nuvei.credit]] diff --git a/crates/connector_configs/toml/production.toml b/crates/connector_configs/toml/production.toml index 26b7ca13015..e0d83ff57f5 100644 --- a/crates/connector_configs/toml/production.toml +++ b/crates/connector_configs/toml/production.toml @@ -1788,7 +1788,6 @@ key1="Payment Access Key" api_secret="Tariff ID" [novalnet.connector_webhook_details] merchant_secret="Source verification key" -placeholder="Enter Payment Access Key" [nuvei] [[nuvei.credit]] diff --git a/crates/connector_configs/toml/sandbox.toml b/crates/connector_configs/toml/sandbox.toml index 797a6626251..08141f88d21 100644 --- a/crates/connector_configs/toml/sandbox.toml +++ b/crates/connector_configs/toml/sandbox.toml @@ -2260,7 +2260,6 @@ key1="Payment Access Key" api_secret="Tariff ID" [novalnet.connector_webhook_details] merchant_secret="Source verification key" -placeholder="Enter Payment Access Key" [nuvei] [[nuvei.credit]]
fix
remove placeholder from novalnet webhooks secret (#6268)
ff96a62b9570392f8b9474ca375c630081cb1189
2024-07-14 19:28:21
Abhishek Kanojia
feat(logging): Emit a setup error when a restricted keys are used for logging default keys (#5185)
false
diff --git a/Cargo.lock b/Cargo.lock index c0e6b05c845..b29894b49c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2002,6 +2002,7 @@ dependencies = [ "serde", "serde_json", "strum 0.26.2", + "thiserror", "utoipa", ] @@ -6219,6 +6220,7 @@ name = "router_env" version = "0.1.0" dependencies = [ "cargo_metadata 0.18.1", + "common_enums", "config", "error-stack", "gethostname", @@ -7238,6 +7240,7 @@ dependencies = [ "async-trait", "bb8", "bytes 1.6.0", + "common_enums", "common_utils", "config", "crc32fast", @@ -8439,9 +8442,9 @@ checksum = "110352d4e9076c67839003c7788d8604e24dcded13e0b375af3efaa8cf468517" [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "utoipa" diff --git a/crates/common_enums/Cargo.toml b/crates/common_enums/Cargo.toml index e364af0407d..c69676c01da 100644 --- a/crates/common_enums/Cargo.toml +++ b/crates/common_enums/Cargo.toml @@ -13,6 +13,7 @@ openapi = [] payouts = [] [dependencies] +thiserror = "1.0.58" diesel = { version = "2.1.5", features = ["postgres"] } serde = { version = "1.0.197", features = ["derive"] } serde_json = "1.0.115" diff --git a/crates/common_enums/src/enums.rs b/crates/common_enums/src/enums.rs index 850c6666548..6222a9d3be7 100644 --- a/crates/common_enums/src/enums.rs +++ b/crates/common_enums/src/enums.rs @@ -20,6 +20,80 @@ pub mod diesel_exports { }; } +pub type ApplicationResult<T> = Result<T, ApplicationError>; + +#[derive(Debug, thiserror::Error)] +pub enum ApplicationError { + #[error("Application configuration error")] + ConfigurationError, + + #[error("Invalid configuration value provided: {0}")] + InvalidConfigurationValueError(String), + + #[error("Metrics error")] + MetricsError, + + #[error("I/O: {0}")] + IoError(std::io::Error), + + #[error("Error while constructing api client: {0}")] + ApiClientError(ApiClientError), +} + +#[derive(Debug, thiserror::Error, PartialEq, Clone)] +pub enum ApiClientError { + #[error("Header map construction failed")] + HeaderMapConstructionFailed, + #[error("Invalid proxy configuration")] + InvalidProxyConfiguration, + #[error("Client construction failed")] + ClientConstructionFailed, + #[error("Certificate decode failed")] + CertificateDecodeFailed, + #[error("Request body serialization failed")] + BodySerializationFailed, + #[error("Unexpected state reached/Invariants conflicted")] + UnexpectedState, + + #[error("URL encoding of request payload failed")] + UrlEncodingFailed, + #[error("Failed to send request to connector {0}")] + RequestNotSent(String), + #[error("Failed to decode response")] + ResponseDecodingFailed, + + #[error("Server responded with Request Timeout")] + RequestTimeoutReceived, + + #[error("connection closed before a message could complete")] + ConnectionClosedIncompleteMessage, + + #[error("Server responded with Internal Server Error")] + InternalServerErrorReceived, + #[error("Server responded with Bad Gateway")] + BadGatewayReceived, + #[error("Server responded with Service Unavailable")] + ServiceUnavailableReceived, + #[error("Server responded with Gateway Timeout")] + GatewayTimeoutReceived, + #[error("Server responded with unexpected response")] + UnexpectedServerResponse, +} +impl ApiClientError { + pub fn is_upstream_timeout(&self) -> bool { + self == &Self::RequestTimeoutReceived + } + pub fn is_connection_closed_before_message_could_complete(&self) -> bool { + self == &Self::ConnectionClosedIncompleteMessage + } +} + +impl From<std::io::Error> for ApplicationError { + fn from(err: std::io::Error) -> Self { + Self::IoError(err) + } +} + /// The status of the attempt #[derive( Clone, diff --git a/crates/hyperswitch_interfaces/src/configs.rs b/crates/hyperswitch_interfaces/src/configs.rs index 74684fd5ab5..6eeb27a4f6c 100644 --- a/crates/hyperswitch_interfaces/src/configs.rs +++ b/crates/hyperswitch_interfaces/src/configs.rs @@ -1,8 +1,8 @@ //! Configs interface +use common_enums::ApplicationError; use masking::Secret; use router_derive; use serde::Deserialize; -use storage_impl::errors::ApplicationError; // struct Connectors #[allow(missing_docs, missing_debug_implementations)] diff --git a/crates/router/src/bin/router.rs b/crates/router/src/bin/router.rs index 8271e458b24..0ec9411b99d 100644 --- a/crates/router/src/bin/router.rs +++ b/crates/router/src/bin/router.rs @@ -1,3 +1,4 @@ +use error_stack::ResultExt; use router::{ configs::settings::{CmdLineConf, Settings}, core::errors::{ApplicationError, ApplicationResult}, @@ -24,7 +25,8 @@ async fn main() -> ApplicationResult<()> { &conf.log, router_env::service_name!(), [router_env::service_name!(), "actix_server"], - ); + ) + .change_context(ApplicationError::ConfigurationError)?; logger::info!("Application started [{:?}] [{:?}]", conf.server, conf.log); @@ -39,8 +41,7 @@ async fn main() -> ApplicationResult<()> { .expect("Failed to create the server"); let _ = server.await; - Err(ApplicationError::from(std::io::Error::new( - std::io::ErrorKind::Other, - "Server shut down", + Err(error_stack::Report::from(ApplicationError::from( + std::io::Error::new(std::io::ErrorKind::Other, "Server shut down"), ))) } diff --git a/crates/router/src/bin/scheduler.rs b/crates/router/src/bin/scheduler.rs index caa3e039e8a..59f53be8e1a 100644 --- a/crates/router/src/bin/scheduler.rs +++ b/crates/router/src/bin/scheduler.rs @@ -116,7 +116,8 @@ pub async fn start_web_server( let web_server = actix_web::HttpServer::new(move || { actix_web::App::new().service(Health::server(state.clone(), service.clone())) }) - .bind((server.host.as_str(), server.port))? + .bind((server.host.as_str(), server.port)) + .change_context(ApplicationError::ConfigurationError)? .workers(server.workers) .run(); let _ = web_server.handle(); diff --git a/crates/router/src/configs/settings.rs b/crates/router/src/configs/settings.rs index b96784eb714..e991d99b50e 100644 --- a/crates/router/src/configs/settings.rs +++ b/crates/router/src/configs/settings.rs @@ -8,6 +8,7 @@ use analytics::{opensearch::OpenSearchConfig, ReportConfig}; use api_models::{enums, payment_methods::RequiredFieldInfo}; use common_utils::ext_traits::ConfigExt; use config::{Environment, File}; +use error_stack::ResultExt; #[cfg(feature = "email")] use external_services::email::EmailSettings; use external_services::{ @@ -33,7 +34,7 @@ use storage_impl::config::QueueStrategy; use crate::analytics::AnalyticsConfig; use crate::{ core::errors::{ApplicationError, ApplicationResult}, - env::{self, logger, Env}, + env::{self, Env}, events::EventsConfig, }; @@ -722,7 +723,8 @@ impl Settings<SecuredSecret> { let environment = env::which(); let config_path = router_env::Config::config_path(&environment.to_string(), config_path); - let config = router_env::Config::builder(&environment.to_string())? + let config = router_env::Config::builder(&environment.to_string()) + .change_context(ApplicationError::ConfigurationError)? .add_source(File::from(config_path).required(false)) .add_source( Environment::with_prefix("ROUTER") @@ -736,13 +738,12 @@ impl Settings<SecuredSecret> { .with_list_parse_key("connector_request_reference_id_config.merchant_ids_send_payment_id_as_connector_request_id"), ) - .build()?; + .build() + .change_context(ApplicationError::ConfigurationError)?; - serde_path_to_error::deserialize(config).map_err(|error| { - logger::error!(%error, "Unable to deserialize application configuration"); - eprintln!("Unable to deserialize application configuration: {error}"); - ApplicationError::from(error.into_inner()) - }) + serde_path_to_error::deserialize(config) + .attach_printable("Unable to deserialize application configuration") + .change_context(ApplicationError::ConfigurationError) } pub fn validate(&self) -> ApplicationResult<()> { @@ -756,14 +757,18 @@ impl Settings<SecuredSecret> { })?; if self.log.file.enabled { if self.log.file.file_name.is_default_or_empty() { - return Err(ApplicationError::InvalidConfigurationValueError( - "log file name must not be empty".into(), + return Err(error_stack::Report::from( + ApplicationError::InvalidConfigurationValueError( + "log file name must not be empty".into(), + ), )); } if self.log.file.path.is_default_or_empty() { - return Err(ApplicationError::InvalidConfigurationValueError( - "log directory path must not be empty".into(), + return Err(error_stack::Report::from( + ApplicationError::InvalidConfigurationValueError( + "log directory path must not be empty".into(), + ), )); } } diff --git a/crates/router/src/core/errors.rs b/crates/router/src/core/errors.rs index 83fa2143648..c22465c3a32 100644 --- a/crates/router/src/core/errors.rs +++ b/crates/router/src/core/errors.rs @@ -32,7 +32,7 @@ use crate::services; pub type RouterResult<T> = CustomResult<T, ApiErrorResponse>; pub type RouterResponse<T> = CustomResult<services::ApplicationResponse<T>, ApiErrorResponse>; -pub type ApplicationResult<T> = Result<T, ApplicationError>; +pub type ApplicationResult<T> = error_stack::Result<T, ApplicationError>; pub type ApplicationResponse<T> = ApplicationResult<services::ApplicationResponse<T>>; pub type CustomerResponse<T> = diff --git a/crates/router_env/Cargo.toml b/crates/router_env/Cargo.toml index b9b1184fedf..59bfb4d5c8e 100644 --- a/crates/router_env/Cargo.toml +++ b/crates/router_env/Cargo.toml @@ -14,6 +14,7 @@ error-stack = "0.4.1" gethostname = "0.4.3" once_cell = "1.19.0" opentelemetry = { version = "0.19.0", features = ["rt-tokio-current-thread", "metrics"] } +common_enums = { path = "../common_enums" } opentelemetry-otlp = { version = "0.12.0", features = ["metrics"] } rustc-hash = "1.1" serde = { version = "1.0.197", features = ["derive"] } diff --git a/crates/router_env/src/logger/formatter.rs b/crates/router_env/src/logger/formatter.rs index c14bcf1ba08..6bcf669e73a 100644 --- a/crates/router_env/src/logger/formatter.rs +++ b/crates/router_env/src/logger/formatter.rs @@ -8,6 +8,7 @@ use std::{ io::Write, }; +use config::ConfigError; use once_cell::sync::Lazy; use serde::ser::{SerializeMap, Serializer}; use serde_json::{ser::Formatter, Value}; @@ -155,7 +156,11 @@ where /// let formatting_layer = router_env::FormattingLayer::new("my_service", std::io::stdout, serde_json::ser::CompactFormatter); /// ``` /// - pub fn new(service: &str, dst_writer: W, formatter: F) -> Self { + pub fn new( + service: &str, + dst_writer: W, + formatter: F, + ) -> error_stack::Result<Self, ConfigError> { Self::new_with_implicit_entries(service, dst_writer, HashMap::new(), formatter) } @@ -163,9 +168,9 @@ where pub fn new_with_implicit_entries( service: &str, dst_writer: W, - mut default_fields: HashMap<String, Value>, + default_fields: HashMap<String, Value>, formatter: F, - ) -> Self { + ) -> error_stack::Result<Self, ConfigError> { let pid = std::process::id(); let hostname = gethostname::gethostname().to_string_lossy().into_owned(); let service = service.to_string(); @@ -174,20 +179,16 @@ where #[cfg(feature = "vergen")] let build = crate::build!().to_string(); let env = crate::env::which().to_string(); - default_fields.retain(|key, value| { - if !IMPLICIT_KEYS.contains(key.as_str()) { - true - } else { - tracing::warn!( - ?key, - ?value, - "Attempting to log a reserved entry. It won't be added to the logs" - ); - false + for key in default_fields.keys() { + if IMPLICIT_KEYS.contains(key.as_str()) { + return Err(ConfigError::Message(format!( + "A reserved key `{key}` was included in `default_fields` in the log formatting layer" + )) + .into()); } - }); + } - Self { + Ok(Self { dst_writer, pid, hostname, @@ -199,7 +200,7 @@ where build, default_fields, formatter, - } + }) } /// Serialize common for both span and event entries. diff --git a/crates/router_env/src/logger/setup.rs b/crates/router_env/src/logger/setup.rs index 3a9e719db18..1a936fcebf2 100644 --- a/crates/router_env/src/logger/setup.rs +++ b/crates/router_env/src/logger/setup.rs @@ -2,6 +2,7 @@ use std::time::Duration; +use ::config::ConfigError; use opentelemetry::{ global, runtime, sdk::{ @@ -36,7 +37,7 @@ pub fn setup( config: &config::Log, service_name: &str, crates_to_filter: impl AsRef<[&'static str]>, -) -> TelemetryGuard { +) -> error_stack::Result<TelemetryGuard, ConfigError> { let mut guards = Vec::new(); // Setup OpenTelemetry traces and metrics @@ -69,11 +70,9 @@ pub fn setup( &crates_to_filter, ); println!("Using file logging filter: {file_filter}"); - - Some( - FormattingLayer::new(service_name, file_writer, CompactFormatter) - .with_filter(file_filter), - ) + let layer = FormattingLayer::new(service_name, file_writer, CompactFormatter)? + .with_filter(file_filter); + Some(layer) } else { None }; @@ -107,17 +106,21 @@ pub fn setup( } config::LogFormat::Json => { error_stack::Report::set_color_mode(error_stack::fmt::ColorMode::None); - let logging_layer = - FormattingLayer::new(service_name, console_writer, CompactFormatter) - .with_filter(console_filter); - subscriber.with(logging_layer).init(); + subscriber + .with( + FormattingLayer::new(service_name, console_writer, CompactFormatter)? + .with_filter(console_filter), + ) + .init(); } config::LogFormat::PrettyJson => { error_stack::Report::set_color_mode(error_stack::fmt::ColorMode::None); - let logging_layer = - FormattingLayer::new(service_name, console_writer, PrettyFormatter::new()) - .with_filter(console_filter); - subscriber.with(logging_layer).init(); + subscriber + .with( + FormattingLayer::new(service_name, console_writer, PrettyFormatter::new())? + .with_filter(console_filter), + ) + .init(); } } } else { @@ -126,10 +129,10 @@ pub fn setup( // Returning the TelemetryGuard for logs to be printed and metrics to be collected until it is // dropped - TelemetryGuard { + Ok(TelemetryGuard { _log_guards: guards, _metrics_controller, - } + }) } fn get_opentelemetry_exporter(config: &config::LogTelemetry) -> TonicExporterBuilder { diff --git a/crates/router_env/tests/logger.rs b/crates/router_env/tests/logger.rs index 89146619db0..46b5b9538cf 100644 --- a/crates/router_env/tests/logger.rs +++ b/crates/router_env/tests/logger.rs @@ -1,25 +1,25 @@ #![allow(clippy::unwrap_used)] mod test_module; - +use ::config::ConfigError; use router_env::TelemetryGuard; use self::test_module::some_module::*; -fn logger() -> &'static TelemetryGuard { +fn logger() -> error_stack::Result<&'static TelemetryGuard, ConfigError> { use once_cell::sync::OnceCell; static INSTANCE: OnceCell<TelemetryGuard> = OnceCell::new(); - INSTANCE.get_or_init(|| { + Ok(INSTANCE.get_or_init(|| { let config = router_env::Config::new().unwrap(); - router_env::setup(&config.log, "router_env_test", []) - }) + router_env::setup(&config.log, "router_env_test", []).unwrap() + })) } #[tokio::test] async fn basic() -> Result<(), Box<dyn std::error::Error + Send + Sync>> { - logger(); + logger()?; fn_with_colon(13).await; diff --git a/crates/storage_impl/Cargo.toml b/crates/storage_impl/Cargo.toml index ab656c3f658..d96d5ac7d57 100644 --- a/crates/storage_impl/Cargo.toml +++ b/crates/storage_impl/Cargo.toml @@ -18,6 +18,7 @@ payouts = ["hyperswitch_domain_models/payouts"] # First Party dependencies api_models = { version = "0.1.0", path = "../api_models" } common_utils = { version = "0.1.0", path = "../common_utils" } +common_enums = { version = "0.1.0", path = "../common_enums" } hyperswitch_domain_models = { version = "0.1.0", path = "../hyperswitch_domain_models", default-features = false } diesel_models = { version = "0.1.0", path = "../diesel_models" } masking = { version = "0.1.0", path = "../masking" } diff --git a/crates/storage_impl/src/errors.rs b/crates/storage_impl/src/errors.rs index b153c47b882..1cee96f49eb 100644 --- a/crates/storage_impl/src/errors.rs +++ b/crates/storage_impl/src/errors.rs @@ -1,17 +1,10 @@ -use std::fmt::Display; - -use actix_web::ResponseError; +pub use common_enums::{ApiClientError, ApplicationError, ApplicationResult}; use common_utils::errors::ErrorSwitch; -use config::ConfigError; -use http::StatusCode; use hyperswitch_domain_models::errors::StorageError as DataStorageError; pub use redis_interface::errors::RedisError; -use router_env::opentelemetry::metrics::MetricsError; use crate::store::errors::DatabaseError; -pub type ApplicationResult<T> = Result<T, ApplicationError>; - #[derive(Debug, thiserror::Error)] pub enum StorageError { #[error("DatabaseError: {0:?}")] @@ -154,115 +147,6 @@ impl RedisErrorExt for error_stack::Report<RedisError> { } } -#[derive(Debug, thiserror::Error)] -pub enum ApplicationError { - // Display's impl can be overridden by the attribute error marco. - // Don't use Debug here, Debug gives error stack in response. - #[error("Application configuration error: {0}")] - ConfigurationError(ConfigError), - - #[error("Invalid configuration value provided: {0}")] - InvalidConfigurationValueError(String), - - #[error("Metrics error: {0}")] - MetricsError(MetricsError), - - #[error("I/O: {0}")] - IoError(std::io::Error), - - #[error("Error while constructing api client: {0}")] - ApiClientError(ApiClientError), -} - -impl From<MetricsError> for ApplicationError { - fn from(err: MetricsError) -> Self { - Self::MetricsError(err) - } -} - -impl From<std::io::Error> for ApplicationError { - fn from(err: std::io::Error) -> Self { - Self::IoError(err) - } -} - -impl From<ConfigError> for ApplicationError { - fn from(err: ConfigError) -> Self { - Self::ConfigurationError(err) - } -} - -fn error_response<T: Display>(err: &T) -> actix_web::HttpResponse { - actix_web::HttpResponse::BadRequest() - .content_type(mime::APPLICATION_JSON) - .body(format!(r#"{{ "error": {{ "message": "{err}" }} }}"#)) -} - -impl ResponseError for ApplicationError { - fn status_code(&self) -> StatusCode { - match self { - Self::MetricsError(_) - | Self::IoError(_) - | Self::ConfigurationError(_) - | Self::InvalidConfigurationValueError(_) - | Self::ApiClientError(_) => StatusCode::INTERNAL_SERVER_ERROR, - } - } - - fn error_response(&self) -> actix_web::HttpResponse { - error_response(self) - } -} - -#[derive(Debug, thiserror::Error, PartialEq, Clone)] -pub enum ApiClientError { - #[error("Header map construction failed")] - HeaderMapConstructionFailed, - #[error("Invalid proxy configuration")] - InvalidProxyConfiguration, - #[error("Client construction failed")] - ClientConstructionFailed, - #[error("Certificate decode failed")] - CertificateDecodeFailed, - #[error("Request body serialization failed")] - BodySerializationFailed, - #[error("Unexpected state reached/Invariants conflicted")] - UnexpectedState, - - #[error("URL encoding of request payload failed")] - UrlEncodingFailed, - #[error("Failed to send request to connector {0}")] - RequestNotSent(String), - #[error("Failed to decode response")] - ResponseDecodingFailed, - - #[error("Server responded with Request Timeout")] - RequestTimeoutReceived, - - #[error("connection closed before a message could complete")] - ConnectionClosedIncompleteMessage, - - #[error("Server responded with Internal Server Error")] - InternalServerErrorReceived, - #[error("Server responded with Bad Gateway")] - BadGatewayReceived, - #[error("Server responded with Service Unavailable")] - ServiceUnavailableReceived, - #[error("Server responded with Gateway Timeout")] - GatewayTimeoutReceived, - #[error("Server responded with unexpected response")] - UnexpectedServerResponse, -} - -impl ApiClientError { - pub fn is_upstream_timeout(&self) -> bool { - self == &Self::RequestTimeoutReceived - } - pub fn is_connection_closed_before_message_could_complete(&self) -> bool { - self == &Self::ConnectionClosedIncompleteMessage - } -} - #[derive(Debug, thiserror::Error, PartialEq)] pub enum ConnectorError { #[error("Error while obtaining URL for the integration")]
feat
Emit a setup error when a restricted keys are used for logging default keys (#5185)
1ddaee44df6eca0f1068f41f82c57f80511b436b
2024-02-15 21:53:03
Sakil Mostak
refactor(connector): [NMI] Add Zip code as mandatory field for 3DS (#3666)
false
diff --git a/crates/router/src/configs/defaults.rs b/crates/router/src/configs/defaults.rs index cafaf8f2abf..e56acde78c2 100644 --- a/crates/router/src/configs/defaults.rs +++ b/crates/router/src/configs/defaults.rs @@ -1499,6 +1499,15 @@ impl Default for super::settings::RequiredFields { value: None, } ), + ( + "billing.address.zip".to_string(), + RequiredFieldInfo { + required_field: "billing.address.zip".to_string(), + display_name: "billing_zip".to_string(), + field_type: enums::FieldType::UserAddressPincode, + value: None, + } + ), ] ), common: HashMap::new(), @@ -3548,6 +3557,15 @@ impl Default for super::settings::RequiredFields { value: None, } ), + ( + "billing.address.zip".to_string(), + RequiredFieldInfo { + required_field: "billing.address.zip".to_string(), + display_name: "billing_zip".to_string(), + field_type: enums::FieldType::UserAddressPincode, + value: None, + } + ), ] ), common: HashMap::new(),
refactor
[NMI] Add Zip code as mandatory field for 3DS (#3666)
5dd4540b2cc5420e4e6ccb88028a6fc78f4a3344
2023-12-14 18:58:00
github-actions
chore(version): v1.101.0
false
diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b041a8b349..ad610bbafde 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,23 @@ All notable changes to HyperSwitch will be documented here. - - - +## 1.101.0 (2023-12-14) + +### Features + +- **payments:** Add outgoing payments webhooks ([#3133](https://github.com/juspay/hyperswitch/pull/3133)) ([`f457846`](https://github.com/juspay/hyperswitch/commit/f4578463d5e1a0f442aacebdfa7af0460489ba8c)) + +### Bug Fixes + +- **connector:** [CashToCode]Fix cashtocode redirection for evoucher pm type ([#3131](https://github.com/juspay/hyperswitch/pull/3131)) ([`71a86a8`](https://github.com/juspay/hyperswitch/commit/71a86a804e15e4d053f92cfddb36a15cf7b77f7a)) +- **locker:** Fix double serialization for json request ([#3134](https://github.com/juspay/hyperswitch/pull/3134)) ([`70b86b7`](https://github.com/juspay/hyperswitch/commit/70b86b71e4809d2a47c6bc1214f72c37d3325c37)) +- **router:** Add routing cache invalidation on payment connector update ([#3132](https://github.com/juspay/hyperswitch/pull/3132)) ([`1f84865`](https://github.com/juspay/hyperswitch/commit/1f848659f135542fdfa967b3b48ad6cdf69fda2c)) + +**Full Changelog:** [`v1.100.0...v1.101.0`](https://github.com/juspay/hyperswitch/compare/v1.100.0...v1.101.0) + +- - - + + ## 1.100.0 (2023-12-14) ### Features
chore
v1.101.0
62067e406a01d3a17ef94a04b0ef0304ebd05a70
2024-10-30 18:02:15
Riddhiagrawal001
chore(users): change entity_type column of roles to non-optional (#6435)
false
diff --git a/crates/diesel_models/src/role.rs b/crates/diesel_models/src/role.rs index 3fb64e645d6..8199bd3979c 100644 --- a/crates/diesel_models/src/role.rs +++ b/crates/diesel_models/src/role.rs @@ -18,7 +18,7 @@ pub struct Role { pub created_by: String, pub last_modified_at: PrimitiveDateTime, pub last_modified_by: String, - pub entity_type: Option<enums::EntityType>, + pub entity_type: enums::EntityType, } #[derive(router_derive::Setter, Clone, Debug, Insertable, router_derive::DebugAsDisplay)] @@ -35,7 +35,7 @@ pub struct RoleNew { pub created_by: String, pub last_modified_at: PrimitiveDateTime, pub last_modified_by: String, - pub entity_type: Option<enums::EntityType>, + pub entity_type: enums::EntityType, } #[derive(Clone, Debug, AsChangeset, router_derive::DebugAsDisplay)] diff --git a/crates/diesel_models/src/schema.rs b/crates/diesel_models/src/schema.rs index 8d2dfc47b62..e2ab676b2d3 100644 --- a/crates/diesel_models/src/schema.rs +++ b/crates/diesel_models/src/schema.rs @@ -1235,7 +1235,7 @@ diesel::table! { #[max_length = 64] last_modified_by -> Varchar, #[max_length = 64] - entity_type -> Nullable<Varchar>, + entity_type -> Varchar, } } diff --git a/crates/diesel_models/src/schema_v2.rs b/crates/diesel_models/src/schema_v2.rs index b5e895cde79..5651bf95dd9 100644 --- a/crates/diesel_models/src/schema_v2.rs +++ b/crates/diesel_models/src/schema_v2.rs @@ -1181,7 +1181,7 @@ diesel::table! { #[max_length = 64] last_modified_by -> Varchar, #[max_length = 64] - entity_type -> Nullable<Varchar>, + entity_type -> Varchar, } } diff --git a/crates/router/src/core/user_role/role.rs b/crates/router/src/core/user_role/role.rs index 1d37f7ac8d1..0250415d4fd 100644 --- a/crates/router/src/core/user_role/role.rs +++ b/crates/router/src/core/user_role/role.rs @@ -92,7 +92,7 @@ pub async fn create_role( org_id: user_from_token.org_id, groups: req.groups, scope: req.role_scope, - entity_type: Some(EntityType::Merchant), + entity_type: EntityType::Merchant, created_by: user_from_token.user_id.clone(), last_modified_by: user_from_token.user_id, created_at: now, diff --git a/crates/router/src/db/role.rs b/crates/router/src/db/role.rs index ce009d38a9e..d13508356e5 100644 --- a/crates/router/src/db/role.rs +++ b/crates/router/src/db/role.rs @@ -354,7 +354,7 @@ impl RoleInterface for MockDb { None => true, }; - matches_merchant && role.org_id == *org_id && role.entity_type == entity_type + matches_merchant && role.org_id == *org_id && Some(role.entity_type) == entity_type }) .take(limit_usize) .cloned() diff --git a/crates/router/src/services/authorization/roles.rs b/crates/router/src/services/authorization/roles.rs index 63d547bfa67..bf66eb92466 100644 --- a/crates/router/src/services/authorization/roles.rs +++ b/crates/router/src/services/authorization/roles.rs @@ -119,7 +119,7 @@ impl From<diesel_models::role::Role> for RoleInfo { role_name: role.role_name, groups: role.groups.into_iter().map(Into::into).collect(), scope: role.scope, - entity_type: role.entity_type.unwrap_or(EntityType::Merchant), + entity_type: role.entity_type, is_invitable: true, is_deletable: true, is_updatable: true, diff --git a/migrations/2024-10-24-123318_update-entity-type-column-in-roles/down.sql b/migrations/2024-10-24-123318_update-entity-type-column-in-roles/down.sql new file mode 100644 index 00000000000..60dfa892e60 --- /dev/null +++ b/migrations/2024-10-24-123318_update-entity-type-column-in-roles/down.sql @@ -0,0 +1,4 @@ +-- This file should undo anything in `up.sql` +ALTER TABLE roles ALTER COLUMN entity_type DROP DEFAULT; + +ALTER TABLE roles ALTER COLUMN entity_type DROP NOT NULL; \ No newline at end of file diff --git a/migrations/2024-10-24-123318_update-entity-type-column-in-roles/up.sql b/migrations/2024-10-24-123318_update-entity-type-column-in-roles/up.sql new file mode 100644 index 00000000000..564a026184e --- /dev/null +++ b/migrations/2024-10-24-123318_update-entity-type-column-in-roles/up.sql @@ -0,0 +1,6 @@ +-- Your SQL goes here +UPDATE roles SET entity_type = 'merchant' WHERE entity_type IS NULL; + +ALTER TABLE roles ALTER COLUMN entity_type SET DEFAULT 'merchant'; + +ALTER TABLE roles ALTER COLUMN entity_type SET NOT NULL; \ No newline at end of file
chore
change entity_type column of roles to non-optional (#6435)
a341e82d4a2c7d3f3e44ce30cfe137b43b7993ee
2025-03-20 15:02:07
Anurag Thakur
feat(router): Return psp_tokenization_enabled in Customer PML (#7519)
false
diff --git a/api-reference-v2/openapi_spec.json b/api-reference-v2/openapi_spec.json index dbe13e3776e..0ae089c5ea0 100644 --- a/api-reference-v2/openapi_spec.json +++ b/api-reference-v2/openapi_spec.json @@ -2834,7 +2834,7 @@ } }, "/v2/customers/{id}/saved-payment-methods": { - "delete": { + "get": { "tags": [ "Payment Methods" ], @@ -7666,6 +7666,7 @@ "prophetpay", "rapyd", "razorpay", + "recurly", "shift4", "square", "stax", @@ -8651,7 +8652,8 @@ "recurring_enabled", "created", "requires_cvv", - "is_default" + "is_default", + "psp_tokenization_enabled" ], "properties": { "id": { @@ -8730,6 +8732,10 @@ } ], "nullable": true + }, + "psp_tokenization_enabled": { + "type": "boolean", + "description": "Whether psp_tokenization is enabled for the payment_method, this will be true when at least\none multi-use token with status `Active` is available for the payment method" } } }, @@ -11603,7 +11609,7 @@ "product_type": { "allOf": [ { - "$ref": "#/components/schemas/api_enums.MerchantProductType" + "$ref": "#/components/schemas/MerchantProductType" } ], "nullable": true @@ -11745,7 +11751,7 @@ "product_type": { "allOf": [ { - "$ref": "#/components/schemas/api_enums.MerchantProductType" + "$ref": "#/components/schemas/MerchantProductType" } ], "nullable": true @@ -12359,6 +12365,17 @@ }, "additionalProperties": false }, + "MerchantProductType": { + "type": "string", + "enum": [ + "orchestration", + "vault", + "recon", + "recovery", + "cost_observability", + "dynamic_routing" + ] + }, "MerchantRecipientData": { "oneOf": [ { @@ -12581,6 +12598,69 @@ } } }, + "NetworkTokenDetailsPaymentMethod": { + "type": "object", + "properties": { + "last4_digits": { + "type": "string", + "nullable": true + }, + "issuer_country": { + "type": "string", + "nullable": true + }, + "network_token_expiry_month": { + "type": "string", + "nullable": true + }, + "network_token_expiry_year": { + "type": "string", + "nullable": true + }, + "nick_name": { + "type": "string", + "nullable": true + }, + "card_holder_name": { + "type": "string", + "nullable": true + }, + "card_isin": { + "type": "string", + "nullable": true + }, + "card_issuer": { + "type": "string", + "nullable": true + }, + "card_network": { + "allOf": [ + { + "$ref": "#/components/schemas/CardNetwork" + } + ], + "nullable": true + }, + "card_type": { + "type": "string", + "nullable": true + }, + "saved_to_locker": { + "type": "boolean" + } + } + }, + "NetworkTokenResponse": { + "type": "object", + "required": [ + "payment_method_data" + ], + "properties": { + "payment_method_data": { + "$ref": "#/components/schemas/NetworkTokenDetailsPaymentMethod" + } + } + }, "NetworkTokenization": { "type": "object", "description": "The network tokenization configuration for creating the payment method session", @@ -13968,7 +14048,7 @@ "PaymentConnectorTransmission": { "type": "string", "enum": [ - "ConnectorCallFailed", + "ConnectorCallUnsuccessful", "ConnectorCallSucceeded" ] }, @@ -20385,6 +20465,7 @@ "prophetpay", "rapyd", "razorpay", + "recurly", "riskified", "shift4", "signifyd", diff --git a/api-reference/openapi_spec.json b/api-reference/openapi_spec.json index 917efcea984..fa4ce7ae5eb 100644 --- a/api-reference/openapi_spec.json +++ b/api-reference/openapi_spec.json @@ -9765,6 +9765,7 @@ "prophetpay", "rapyd", "razorpay", + "recurly", "shift4", "square", "stax", @@ -13933,7 +13934,7 @@ "product_type": { "allOf": [ { - "$ref": "#/components/schemas/api_enums.MerchantProductType" + "$ref": "#/components/schemas/MerchantProductType" } ], "nullable": true @@ -14174,7 +14175,7 @@ "product_type": { "allOf": [ { - "$ref": "#/components/schemas/api_enums.MerchantProductType" + "$ref": "#/components/schemas/MerchantProductType" } ], "nullable": true @@ -15089,6 +15090,17 @@ }, "additionalProperties": false }, + "MerchantProductType": { + "type": "string", + "enum": [ + "orchestration", + "vault", + "recon", + "recovery", + "cost_observability", + "dynamic_routing" + ] + }, "MerchantRecipientData": { "oneOf": [ { @@ -24881,6 +24893,7 @@ "prophetpay", "rapyd", "razorpay", + "recurly", "riskified", "shift4", "signifyd", diff --git a/crates/api_models/src/admin.rs b/crates/api_models/src/admin.rs index b6f1e0a8b96..b3d21c5a0b6 100644 --- a/crates/api_models/src/admin.rs +++ b/crates/api_models/src/admin.rs @@ -113,7 +113,7 @@ pub struct MerchantAccountCreate { pub pm_collect_link_config: Option<BusinessCollectLinkConfig>, /// Product Type of this merchant account - #[schema(value_type = Option<api_enums::MerchantProductType>)] + #[schema(value_type = Option<MerchantProductType>)] pub product_type: Option<api_enums::MerchantProductType>, } @@ -198,6 +198,7 @@ pub struct MerchantAccountCreateWithoutOrgId { #[schema(value_type = Option<Object>, example = r#"{ "city": "NY", "unit": "245" }"#)] pub metadata: Option<pii::SecretSerdeValue>, + #[schema(value_type = Option<MerchantProductType>)] pub product_type: Option<api_enums::MerchantProductType>, } @@ -560,7 +561,7 @@ pub struct MerchantAccountResponse { pub pm_collect_link_config: Option<BusinessCollectLinkConfig>, /// Product Type of this merchant account - #[schema(value_type = Option<api_enums::MerchantProductType>)] + #[schema(value_type = Option<MerchantProductType>)] pub product_type: Option<api_enums::MerchantProductType>, } @@ -596,7 +597,7 @@ pub struct MerchantAccountResponse { pub recon_status: api_enums::ReconStatus, /// Product Type of this merchant account - #[schema(value_type = Option<api_enums::MerchantProductType>)] + #[schema(value_type = Option<MerchantProductType>)] pub product_type: Option<api_enums::MerchantProductType>, } diff --git a/crates/api_models/src/payment_methods.rs b/crates/api_models/src/payment_methods.rs index 6b9b35ac2c0..d665337fda0 100644 --- a/crates/api_models/src/payment_methods.rs +++ b/crates/api_models/src/payment_methods.rs @@ -980,16 +980,21 @@ pub struct CardDetailsPaymentMethod { pub saved_to_locker: bool, } -#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize)] +#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)] pub struct NetworkTokenDetailsPaymentMethod { pub last4_digits: Option<String>, pub issuer_country: Option<String>, + #[schema(value_type = Option<String>)] pub network_token_expiry_month: Option<masking::Secret<String>>, + #[schema(value_type = Option<String>)] pub network_token_expiry_year: Option<masking::Secret<String>>, + #[schema(value_type = Option<String>)] pub nick_name: Option<masking::Secret<String>>, + #[schema(value_type = Option<String>)] pub card_holder_name: Option<masking::Secret<String>>, pub card_isin: Option<String>, pub card_issuer: Option<String>, + #[schema(value_type = Option<CardNetwork>)] pub card_network: Option<api_enums::CardNetwork>, pub card_type: Option<String>, #[serde(default = "saved_in_locker_default")] @@ -2019,6 +2024,10 @@ pub struct CustomerPaymentMethod { ///The network token details for the payment method pub network_tokenization: Option<NetworkTokenResponse>, + + /// Whether psp_tokenization is enabled for the payment_method, this will be true when at least + /// one multi-use token with status `Active` is available for the payment method + pub psp_tokenization_enabled: bool, } #[cfg(all(feature = "v2", feature = "payment_methods_v2"))] diff --git a/crates/openapi/src/openapi.rs b/crates/openapi/src/openapi.rs index 1109c0ca75e..20d1aa64745 100644 --- a/crates/openapi/src/openapi.rs +++ b/crates/openapi/src/openapi.rs @@ -320,6 +320,7 @@ Never share your secret api keys. Keep them guarded and secure. api_models::enums::PaymentLinkDetailsLayout, api_models::enums::PaymentMethodStatus, api_models::enums::UIWidgetFormLayout, + api_models::enums::MerchantProductType, api_models::enums::PaymentConnectorCategory, api_models::enums::CardDiscovery, api_models::enums::FeatureStatus, diff --git a/crates/openapi/src/openapi_v2.rs b/crates/openapi/src/openapi_v2.rs index 8a122b5fe8b..5bbd8dee4b4 100644 --- a/crates/openapi/src/openapi_v2.rs +++ b/crates/openapi/src/openapi_v2.rs @@ -259,6 +259,7 @@ Never share your secret api keys. Keep them guarded and secure. api_models::enums::PaymentMethod, api_models::enums::PaymentMethodIssuerCode, api_models::enums::MandateStatus, + api_models::enums::MerchantProductType, api_models::enums::PaymentExperience, api_models::enums::BankNames, api_models::enums::BankType, @@ -527,6 +528,8 @@ Never share your secret api keys. Keep them guarded and secure. api_models::payment_methods::PaymentMethodSessionRequest, api_models::payment_methods::PaymentMethodSessionResponse, api_models::payment_methods::PaymentMethodsSessionUpdateRequest, + api_models::payment_methods::NetworkTokenResponse, + api_models::payment_methods::NetworkTokenDetailsPaymentMethod, api_models::payment_methods::TokenizeCardRequest, api_models::payment_methods::TokenizeDataRequest, api_models::payment_methods::TokenizePaymentMethodRequest, diff --git a/crates/openapi/src/routes/payment_method.rs b/crates/openapi/src/routes/payment_method.rs index 9304afc69d3..cf1cd15346f 100644 --- a/crates/openapi/src/routes/payment_method.rs +++ b/crates/openapi/src/routes/payment_method.rs @@ -326,7 +326,7 @@ pub async fn payment_method_delete_api() {} /// /// List the payment methods saved for a customer #[utoipa::path( - delete, + get, path = "/v2/customers/{id}/saved-payment-methods", params ( ("id" = String, Path, description = "The unique identifier for the customer"), diff --git a/crates/router/src/core/payment_methods/transformers.rs b/crates/router/src/core/payment_methods/transformers.rs index 87f7e38c935..a7817329607 100644 --- a/crates/router/src/core/payment_methods/transformers.rs +++ b/crates/router/src/core/payment_methods/transformers.rs @@ -985,6 +985,15 @@ impl transformers::ForeignTryFrom<domain::PaymentMethod> for api::CustomerPaymen // TODO: check how we can get this field let recurring_enabled = true; + let psp_tokenization_enabled = item.connector_mandate_details.and_then(|details| { + details.payments.map(|payments| { + payments.values().any(|connector_token_reference| { + connector_token_reference.connector_token_status + == api_enums::ConnectorTokenStatus::Active + }) + }) + }); + Ok(Self { id: item.id, customer_id: item.customer_id, @@ -999,6 +1008,7 @@ impl transformers::ForeignTryFrom<domain::PaymentMethod> for api::CustomerPaymen is_default: false, billing: payment_method_billing, network_tokenization: network_token_resp, + psp_tokenization_enabled: psp_tokenization_enabled.unwrap_or(false), }) } }
feat
Return psp_tokenization_enabled in Customer PML (#7519)
cb256dcdac0533af51a6c77eef0039121a8ee110
2025-03-11 13:43:42
likhinbopanna
chore: update wise connector cypress creds (#7477)
false
diff --git a/.github/workflows/cypress-tests-runner.yml b/.github/workflows/cypress-tests-runner.yml index f73d23c6a87..3b64fe5e252 100644 --- a/.github/workflows/cypress-tests-runner.yml +++ b/.github/workflows/cypress-tests-runner.yml @@ -128,7 +128,7 @@ jobs: CONNECTOR_AUTH_PASSPHRASE: ${{ secrets.CONNECTOR_AUTH_PASSPHRASE }} CONNECTOR_CREDS_S3_BUCKET_URI: ${{ secrets.CONNECTOR_CREDS_S3_BUCKET_URI}} DESTINATION_FILE_NAME: "creds.json.gpg" - S3_SOURCE_FILE_NAME: "57a07166-894a-4f43-b4b5-ee1155138ec9.json.gpg" + S3_SOURCE_FILE_NAME: "61942d87-78d1-4a1b-b040-f40c83a4430c.json.gpg" shell: bash run: | mkdir -p ".github/secrets" ".github/test"
chore
update wise connector cypress creds (#7477)
76ac1a753a08f3ecc8ee264e4bccc47e8b219d1d
2024-02-19 18:14:51
harsh-sharma-juspay
feat(analytics): added dispute as uri param to analytics info api (#3693)
false
diff --git a/crates/analytics/src/clickhouse.rs b/crates/analytics/src/clickhouse.rs index 27d42350509..ead3b1699ec 100644 --- a/crates/analytics/src/clickhouse.rs +++ b/crates/analytics/src/clickhouse.rs @@ -130,7 +130,8 @@ impl AnalyticsDataSource for ClickhouseClient { match table { AnalyticsCollection::Payment | AnalyticsCollection::Refund - | AnalyticsCollection::PaymentIntent => { + | AnalyticsCollection::PaymentIntent + | AnalyticsCollection::Dispute => { TableEngine::CollapsingMergeTree { sign: "sign_flag" } } AnalyticsCollection::SdkEvents => TableEngine::BasicTree, @@ -374,6 +375,7 @@ impl ToSql<ClickhouseClient> for AnalyticsCollection { Self::PaymentIntent => Ok("payment_intents".to_string()), Self::ConnectorEvents => Ok("connector_events_audit".to_string()), Self::OutgoingWebhookEvent => Ok("outgoing_webhook_events_audit".to_string()), + Self::Dispute => Ok("dispute".to_string()), } } } diff --git a/crates/analytics/src/core.rs b/crates/analytics/src/core.rs index 354e1e2f176..6ccf2858e22 100644 --- a/crates/analytics/src/core.rs +++ b/crates/analytics/src/core.rs @@ -26,6 +26,11 @@ pub async fn get_domain_info( download_dimensions: None, dimensions: utils::get_api_event_dimensions(), }, + AnalyticsDomain::Dispute => GetInfoResponse { + metrics: utils::get_dispute_metrics_info(), + download_dimensions: None, + dimensions: utils::get_dispute_dimensions(), + }, }; Ok(info) } diff --git a/crates/analytics/src/sqlx.rs b/crates/analytics/src/sqlx.rs index 562a3a1f64d..1fb7a9b4509 100644 --- a/crates/analytics/src/sqlx.rs +++ b/crates/analytics/src/sqlx.rs @@ -445,6 +445,7 @@ impl ToSql<SqlxClient> for AnalyticsCollection { .attach_printable("ConnectorEvents table is not implemented for Sqlx"))?, Self::OutgoingWebhookEvent => Err(error_stack::report!(ParsingError::UnknownError) .attach_printable("OutgoingWebhookEvents table is not implemented for Sqlx"))?, + Self::Dispute => Ok("dispute".to_string()), } } } diff --git a/crates/analytics/src/types.rs b/crates/analytics/src/types.rs index 18e9e9f4334..356d11bb77d 100644 --- a/crates/analytics/src/types.rs +++ b/crates/analytics/src/types.rs @@ -17,6 +17,7 @@ pub enum AnalyticsDomain { Refunds, SdkEvents, ApiEvents, + Dispute, } #[derive(Debug, strum::AsRefStr, strum::Display, Clone, Copy)] @@ -28,6 +29,7 @@ pub enum AnalyticsCollection { PaymentIntent, ConnectorEvents, OutgoingWebhookEvent, + Dispute, } #[allow(dead_code)] diff --git a/crates/analytics/src/utils.rs b/crates/analytics/src/utils.rs index 6a0aa973a1e..7bff5c87da6 100644 --- a/crates/analytics/src/utils.rs +++ b/crates/analytics/src/utils.rs @@ -1,5 +1,6 @@ use api_models::analytics::{ api_event::{ApiEventDimensions, ApiEventMetrics}, + disputes::{DisputeDimensions, DisputeMetrics}, payments::{PaymentDimensions, PaymentMetrics}, refunds::{RefundDimensions, RefundMetrics}, sdk_events::{SdkEventDimensions, SdkEventMetrics}, @@ -38,3 +39,11 @@ pub fn get_sdk_event_metrics_info() -> Vec<NameDescription> { pub fn get_api_event_metrics_info() -> Vec<NameDescription> { ApiEventMetrics::iter().map(Into::into).collect() } + +pub fn get_dispute_metrics_info() -> Vec<NameDescription> { + DisputeMetrics::iter().map(Into::into).collect() +} + +pub fn get_dispute_dimensions() -> Vec<NameDescription> { + DisputeDimensions::iter().map(Into::into).collect() +} diff --git a/crates/api_models/src/analytics.rs b/crates/api_models/src/analytics.rs index c6ca215f9f7..1115d40b19d 100644 --- a/crates/api_models/src/analytics.rs +++ b/crates/api_models/src/analytics.rs @@ -13,6 +13,7 @@ pub use crate::payments::TimeRange; pub mod api_event; pub mod connector_events; +pub mod disputes; pub mod outgoing_webhook_event; pub mod payments; pub mod refunds; diff --git a/crates/api_models/src/analytics/disputes.rs b/crates/api_models/src/analytics/disputes.rs new file mode 100644 index 00000000000..19d552d45d4 --- /dev/null +++ b/crates/api_models/src/analytics/disputes.rs @@ -0,0 +1,65 @@ +use super::NameDescription; + +#[derive( + Clone, + Debug, + Hash, + PartialEq, + Eq, + serde::Serialize, + serde::Deserialize, + strum::Display, + strum::EnumIter, + strum::AsRefStr, +)] +#[strum(serialize_all = "snake_case")] +#[serde(rename_all = "snake_case")] +pub enum DisputeMetrics { + DisputesChallenged, + DisputesWon, + DisputesLost, + TotalAmountDisputed, + TotalDisputeLostAmount, +} + +#[derive( + Debug, + serde::Serialize, + serde::Deserialize, + strum::AsRefStr, + PartialEq, + PartialOrd, + Eq, + Ord, + strum::Display, + strum::EnumIter, + Clone, + Copy, +)] +#[serde(rename_all = "snake_case")] +#[strum(serialize_all = "snake_case")] +pub enum DisputeDimensions { + // Do not change the order of these enums + // Consult the Dashboard FE folks since these also affects the order of metrics on FE + Connector, + DisputeStatus, + ConnectorStatus, +} + +impl From<DisputeDimensions> for NameDescription { + fn from(value: DisputeDimensions) -> Self { + Self { + name: value.to_string(), + desc: String::new(), + } + } +} + +impl From<DisputeMetrics> for NameDescription { + fn from(value: DisputeMetrics) -> Self { + Self { + name: value.to_string(), + desc: String::new(), + } + } +}
feat
added dispute as uri param to analytics info api (#3693)
fbd40b5ac44b7410da9d4b139b15561e20bca616
2023-07-11 15:10:42
Kartikeya Hegde
fix: map not found error properly in db_not found (#1671)
false
diff --git a/crates/router/src/core/errors.rs b/crates/router/src/core/errors.rs index e615ef71289..0b4e71ffa82 100644 --- a/crates/router/src/core/errors.rs +++ b/crates/router/src/core/errors.rs @@ -98,6 +98,7 @@ impl StorageError { err.current_context(), storage_errors::DatabaseError::NotFound ), + Self::ValueNotFound(_) => true, _ => false, } }
fix
map not found error properly in db_not found (#1671)
a071463b29f9794e7069d57057d3bcc3a238f89b
2024-04-02 15:53:57
Sakil Mostak
refactor(postman): Paypal test cases for Capture (#4265)
false
diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Capture/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Capture/event.test.js index d08e91cd6e8..1fbef271836 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Capture/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Capture/event.test.js @@ -101,9 +101,9 @@ if (jsonData?.amount_received) { // Response body should have value "6540" for "amount_capturable" if (jsonData?.amount_capturable) { pm.test( - "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 6540", function () { - pm.expect(jsonData.amount_capturable).to.eql(540); + pm.expect(jsonData.amount_capturable).to.eql(6540); }, ); } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Retrieve/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Retrieve/event.test.js index 8e84e4b3846..06abc1d37a5 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario11-Create Partial Capture payment/Payments - Retrieve/event.test.js @@ -98,9 +98,9 @@ if (jsonData?.amount_received) { // Response body should have value "6540" for "amount_capturable" if (jsonData?.amount_capturable) { pm.test( - "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", function () { - pm.expect(jsonData.amount_capturable).to.eql(540); + pm.expect(jsonData.amount_capturable).to.eql(6540); }, ); } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Capture/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Capture/event.test.js index d08e91cd6e8..6b58fbb86f0 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Capture/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Capture/event.test.js @@ -101,9 +101,9 @@ if (jsonData?.amount_received) { // Response body should have value "6540" for "amount_capturable" if (jsonData?.amount_capturable) { pm.test( - "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", function () { - pm.expect(jsonData.amount_capturable).to.eql(540); + pm.expect(jsonData.amount_capturable).to.eql(6540); }, ); } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Retrieve/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Retrieve/event.test.js index 8e84e4b3846..06abc1d37a5 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Retrieve/event.test.js @@ -98,9 +98,9 @@ if (jsonData?.amount_received) { // Response body should have value "6540" for "amount_capturable" if (jsonData?.amount_capturable) { pm.test( - "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", function () { - pm.expect(jsonData.amount_capturable).to.eql(540); + pm.expect(jsonData.amount_capturable).to.eql(6540); }, ); } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js index d2574b4816b..0085a8a1146 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Capture/event.test.js @@ -101,9 +101,9 @@ if (jsonData?.amount_received) { // Response body should have value "6540" for "amount_capturable" if (jsonData?.amount_capturable) { pm.test( - "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 6540", function () { - pm.expect(jsonData.amount_capturable).to.eql(0); + pm.expect(jsonData.amount_capturable).to.eql(6540); }, ); } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js index c5396fe43da..021d1f1475c 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Retrieve/event.test.js @@ -98,9 +98,9 @@ if (jsonData?.amount_received) { // Response body should have value "6540" for "amount_capturable" if (jsonData?.amount_capturable) { pm.test( - "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'", function () { - pm.expect(jsonData.amount_capturable).to.eql(0); + pm.expect(jsonData.amount_capturable).to.eql(6540); }, ); } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario8-Create payment with Manual capture with confirm false and surcharge_data/Payments - Capture/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario8-Create payment with Manual capture with confirm false and surcharge_data/Payments - Capture/event.test.js index 432edf05d37..b09744cff12 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario8-Create payment with Manual capture with confirm false and surcharge_data/Payments - Capture/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario8-Create payment with Manual capture with confirm false and surcharge_data/Payments - Capture/event.test.js @@ -101,9 +101,9 @@ if (jsonData?.amount_received) { // Response body should have value "6540" for "amount_capturable" if (jsonData?.amount_capturable) { pm.test( - "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 0", + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 6550", function () { - pm.expect(jsonData.amount_capturable).to.eql(0); + pm.expect(jsonData.amount_capturable).to.eql(6550); }, ); } diff --git a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario8-Create payment with Manual capture with confirm false and surcharge_data/Payments - Retrieve/event.test.js b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario8-Create payment with Manual capture with confirm false and surcharge_data/Payments - Retrieve/event.test.js index 5097d1cf94a..69fd5563460 100644 --- a/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario8-Create payment with Manual capture with confirm false and surcharge_data/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/paypal/Flow Testcases/Happy Cases/Scenario8-Create payment with Manual capture with confirm false and surcharge_data/Payments - Retrieve/event.test.js @@ -98,9 +98,9 @@ if (jsonData?.amount_received) { // Response body should have value "6540" for "amount_capturable" if (jsonData?.amount_capturable) { pm.test( - "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'", + "[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6550'", function () { - pm.expect(jsonData.amount_capturable).to.eql(540); + pm.expect(jsonData.amount_capturable).to.eql(6550); }, ); } diff --git a/postman/collection-json/paypal.postman_collection.json b/postman/collection-json/paypal.postman_collection.json index bcb508da4c0..9063afe7b0d 100644 --- a/postman/collection-json/paypal.postman_collection.json +++ b/postman/collection-json/paypal.postman_collection.json @@ -1116,9 +1116,9 @@ "// Response body should have value \"6540\" for \"amount_capturable\"", "if (jsonData?.amount_capturable) {", " pm.test(", - " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 0\",", + " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 6550\",", " function () {", - " pm.expect(jsonData.amount_capturable).to.eql(0);", + " pm.expect(jsonData.amount_capturable).to.eql(6550);", " },", " );", "}", @@ -1285,9 +1285,9 @@ "// Response body should have value \"6540\" for \"amount_capturable\"", "if (jsonData?.amount_capturable) {", " pm.test(", - " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'\",", + " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6550'\",", " function () {", - " pm.expect(jsonData.amount_capturable).to.eql(540);", + " pm.expect(jsonData.amount_capturable).to.eql(6550);", " },", " );", "}", @@ -3023,9 +3023,9 @@ "// Response body should have value \"6540\" for \"amount_capturable\"", "if (jsonData?.amount_capturable) {", " pm.test(", - " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'\",", + " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'\",", " function () {", - " pm.expect(jsonData.amount_capturable).to.eql(540);", + " pm.expect(jsonData.amount_capturable).to.eql(6540);", " },", " );", "}", @@ -3185,9 +3185,9 @@ "// Response body should have value \"6540\" for \"amount_capturable\"", "if (jsonData?.amount_capturable) {", " pm.test(", - " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'\",", + " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'\",", " function () {", - " pm.expect(jsonData.amount_capturable).to.eql(540);", + " pm.expect(jsonData.amount_capturable).to.eql(6540);", " },", " );", "}", @@ -3500,9 +3500,9 @@ "// Response body should have value \"6540\" for \"amount_capturable\"", "if (jsonData?.amount_capturable) {", " pm.test(", - " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'\",", + " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 6540\",", " function () {", - " pm.expect(jsonData.amount_capturable).to.eql(0);", + " pm.expect(jsonData.amount_capturable).to.eql(6540);", " },", " );", "}", @@ -3662,9 +3662,9 @@ "// Response body should have value \"6540\" for \"amount_capturable\"", "if (jsonData?.amount_capturable) {", " pm.test(", - " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'\",", + " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'\",", " function () {", - " pm.expect(jsonData.amount_capturable).to.eql(0);", + " pm.expect(jsonData.amount_capturable).to.eql(6540);", " },", " );", "}", @@ -3977,9 +3977,9 @@ "// Response body should have value \"6540\" for \"amount_capturable\"", "if (jsonData?.amount_capturable) {", " pm.test(", - " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'\",", + " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 6540\",", " function () {", - " pm.expect(jsonData.amount_capturable).to.eql(540);", + " pm.expect(jsonData.amount_capturable).to.eql(6540);", " },", " );", "}", @@ -4139,9 +4139,9 @@ "// Response body should have value \"6540\" for \"amount_capturable\"", "if (jsonData?.amount_capturable) {", " pm.test(", - " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'\",", + " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'\",", " function () {", - " pm.expect(jsonData.amount_capturable).to.eql(540);", + " pm.expect(jsonData.amount_capturable).to.eql(6540);", " },", " );", "}",
refactor
Paypal test cases for Capture (#4265)
794dbc6a766d12ff3cdf0b782abb4c48b8fa77d0
2023-10-18 18:49:49
Shankar Singh C
feat(apple_pay): add support for decrypted apple pay token for checkout (#2628)
false
diff --git a/crates/router/src/connector/checkout/transformers.rs b/crates/router/src/connector/checkout/transformers.rs index 31deae02360..53182e65ed5 100644 --- a/crates/router/src/connector/checkout/transformers.rs +++ b/crates/router/src/connector/checkout/transformers.rs @@ -1,6 +1,6 @@ use common_utils::{errors::CustomResult, ext_traits::ByteSliceExt}; use error_stack::{IntoReport, ResultExt}; -use masking::{ExposeInterface, Secret}; +use masking::{ExposeInterface, PeekInterface, Secret}; use serde::{Deserialize, Serialize}; use time::PrimitiveDateTime; use url::Url; @@ -282,8 +282,7 @@ impl TryFrom<&CheckoutRouterData<&types::PaymentsAuthorizeRouterData>> for Payme Ok(a) } api::PaymentMethodData::Wallet(wallet_data) => match wallet_data { - api_models::payments::WalletData::GooglePay(_) - | api_models::payments::WalletData::ApplePay(_) => { + api_models::payments::WalletData::GooglePay(_) => { Ok(PaymentSource::Wallets(WalletSource { source_type: CheckoutSourceTypes::Token, token: match item.router_data.get_payment_method_token()? { @@ -294,6 +293,48 @@ impl TryFrom<&CheckoutRouterData<&types::PaymentsAuthorizeRouterData>> for Payme }, })) } + api_models::payments::WalletData::ApplePay(_) => { + let payment_method_token = item.router_data.get_payment_method_token()?; + match payment_method_token { + types::PaymentMethodToken::Token(apple_pay_payment_token) => { + Ok(PaymentSource::Wallets(WalletSource { + source_type: CheckoutSourceTypes::Token, + token: apple_pay_payment_token, + })) + } + types::PaymentMethodToken::ApplePayDecrypt(decrypt_data) => { + let expiry_year_4_digit = Secret::new(format!( + "20{}", + decrypt_data + .clone() + .application_expiration_date + .peek() + .get(0..2) + .ok_or(errors::ConnectorError::RequestEncodingFailed)? + )); + let exp_month = Secret::new( + decrypt_data + .clone() + .application_expiration_date + .peek() + .get(2..4) + .ok_or(errors::ConnectorError::RequestEncodingFailed)? + .to_owned(), + ); + Ok(PaymentSource::ApplePayPredecrypt(Box::new( + ApplePayPredecrypt { + token: decrypt_data.application_primary_account_number, + decrypt_type: "network_token".to_string(), + token_type: "applepay".to_string(), + expiry_month: exp_month, + expiry_year: expiry_year_4_digit, + eci: decrypt_data.payment_data.eci_indicator, + cryptogram: decrypt_data.payment_data.online_payment_cryptogram, + }, + ))) + } + } + } api_models::payments::WalletData::AliPayQr(_) | api_models::payments::WalletData::AliPayRedirect(_) | api_models::payments::WalletData::AliPayHkRedirect(_)
feat
add support for decrypted apple pay token for checkout (#2628)
473d8f7a1b4cecd4d2900737eb8dbe60c6cf5447
2022-12-01 16:50:18
Abhishek
fix(migrations): added unique index on merchant_id and connector_name in merchant_connector_account (#49)
false
diff --git a/migrations/2022-11-30-084736_update-index-in-mca/down.sql b/migrations/2022-11-30-084736_update-index-in-mca/down.sql new file mode 100644 index 00000000000..95caab81f84 --- /dev/null +++ b/migrations/2022-11-30-084736_update-index-in-mca/down.sql @@ -0,0 +1 @@ +DROP INDEX merchant_connector_account_merchant_id_connector_name_index; \ No newline at end of file diff --git a/migrations/2022-11-30-084736_update-index-in-mca/up.sql b/migrations/2022-11-30-084736_update-index-in-mca/up.sql new file mode 100644 index 00000000000..765d70c9237 --- /dev/null +++ b/migrations/2022-11-30-084736_update-index-in-mca/up.sql @@ -0,0 +1 @@ +CREATE UNIQUE INDEX merchant_connector_account_merchant_id_connector_name_index ON merchant_connector_account (merchant_id, connector_name); \ No newline at end of file
fix
added unique index on merchant_id and connector_name in merchant_connector_account (#49)
08eefdba4a7f428ffe7f0dac9799c46b82c49864
2024-05-30 19:21:33
Sahkal Poddar
feat(router): Added amount conversion function in core for connector module (#4710)
false
diff --git a/Cargo.lock b/Cargo.lock index b116982bb24..61f4e8f4210 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1965,7 +1965,9 @@ dependencies = [ "reqwest", "ring 0.17.8", "router_env", + "rust_decimal", "rustc-hash", + "rusty-money", "semver 1.0.22", "serde", "serde_json", diff --git a/crates/api_models/src/refunds.rs b/crates/api_models/src/refunds.rs index 881cc3912ec..c97344ff48b 100644 --- a/crates/api_models/src/refunds.rs +++ b/crates/api_models/src/refunds.rs @@ -1,7 +1,7 @@ use std::collections::HashMap; use common_utils::pii; -pub use common_utils::types::ChargeRefunds; +pub use common_utils::types::{ChargeRefunds, MinorUnit}; use serde::{Deserialize, Serialize}; use time::PrimitiveDateTime; use utoipa::ToSchema; @@ -36,8 +36,8 @@ pub struct RefundRequest { pub merchant_id: Option<String>, /// Total amount for which the refund is to be initiated. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc., If not provided, this will default to the full payment amount - #[schema(minimum = 100, example = 6540)] - pub amount: Option<i64>, + #[schema(value_type = Option<i64> , minimum = 100, example = 6540)] + pub amount: Option<MinorUnit>, /// Reason for the refund. Often useful for displaying to users and your customer support executive. In case the payment went through Stripe, this field needs to be passed with one of these enums: `duplicate`, `fraudulent`, or `requested_by_customer` #[schema(max_length = 255, example = "Customer returned the product")] @@ -115,7 +115,8 @@ pub struct RefundResponse { /// The payment id against which refund is initiated pub payment_id: String, /// The refund amount, which should be less than or equal to the total payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc - pub amount: i64, + #[schema(value_type = i64 , minimum = 100, example = 6540)] + pub amount: MinorUnit, /// The three-letter ISO currency code pub currency: String, /// The status for refund diff --git a/crates/common_utils/Cargo.toml b/crates/common_utils/Cargo.toml index ff64d6517c7..def64e35db0 100644 --- a/crates/common_utils/Cargo.toml +++ b/crates/common_utils/Cargo.toml @@ -43,6 +43,8 @@ utoipa = { version = "4.2.0", features = ["preserve_order", "preserve_path_order uuid = { version = "1.8.0", features = ["v7"] } # First party crates +rust_decimal = "1.35" +rusty-money = { git = "https://github.com/varunsrin/rusty_money", rev = "bbc0150742a0fff905225ff11ee09388e9babdcc", features = ["iso", "crypto"] } common_enums = { version = "0.1.0", path = "../common_enums" } masking = { version = "0.1.0", path = "../masking" } router_env = { version = "0.1.0", path = "../router_env", features = ["log_extra_implicit_fields", "log_custom_entries_to_extra"], optional = true } diff --git a/crates/common_utils/src/errors.rs b/crates/common_utils/src/errors.rs index 967580f0ae5..e4c59ba2a31 100644 --- a/crates/common_utils/src/errors.rs +++ b/crates/common_utils/src/errors.rs @@ -11,6 +11,7 @@ use crate::types::MinorUnit; pub type CustomResult<T, E> = error_stack::Result<T, E>; /// Parsing Errors +#[allow(missing_docs)] // Only to prevent warnings about struct fields not being documented #[derive(Debug, thiserror::Error)] pub enum ParsingError { ///Failed to parse enum @@ -34,6 +35,21 @@ pub enum ParsingError { /// Failed to parse phone number #[error("Failed to parse phone number")] PhoneNumberParsingError, + /// Failed to parse Float value for converting to decimal points + #[error("Failed to parse Float value for converting to decimal points")] + FloatToDecimalConversionFailure, + /// Failed to parse Decimal value for i64 value conversion + #[error("Failed to parse Decimal value for i64 value conversion")] + DecimalToI64ConversionFailure, + /// Failed to parse string value for f64 value conversion + #[error("Failed to parse string value for f64 value conversion")] + StringToFloatConversionFailure, + /// Failed to parse i64 value for f64 value conversion + #[error("Failed to parse i64 value for f64 value conversion")] + I64ToDecimalConversionFailure, + /// Failed to parse String value to Decimal value conversion because `error` + #[error("Failed to parse String value to Decimal value conversion because {error}")] + StringToDecimalConversionFailure { error: String }, } /// Validation errors. diff --git a/crates/common_utils/src/types.rs b/crates/common_utils/src/types.rs index d9a7aef3f57..7ab78ce3257 100644 --- a/crates/common_utils/src/types.rs +++ b/crates/common_utils/src/types.rs @@ -6,6 +6,7 @@ use std::{ str::FromStr, }; +use common_enums::enums; use diesel::{ backend::Backend, deserialize, @@ -16,6 +17,10 @@ use diesel::{ AsExpression, FromSqlRow, Queryable, }; use error_stack::{report, ResultExt}; +use rust_decimal::{ + prelude::{FromPrimitive, ToPrimitive}, + Decimal, +}; use semver::Version; use serde::{de::Visitor, Deserialize, Deserializer, Serialize}; use utoipa::ToSchema; @@ -226,48 +231,92 @@ where } } -#[derive( - Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, FromSqlRow, AsExpression, ToSchema, -)] -#[diesel(sql_type = Jsonb)] -/// Charge object for refunds -pub struct ChargeRefunds { - /// Identifier for charge created for the payment - pub charge_id: String, - - /// Toggle for reverting the application fee that was collected for the payment. - /// If set to false, the funds are pulled from the destination account. - pub revert_platform_fee: Option<bool>, +/// Amount convertor trait for connector +pub trait AmountConvertor: Send { + /// Output type for the connector + type Output; + /// helps in conversion of connector required amount type + fn convert( + &self, + amount: MinorUnit, + currency: enums::Currency, + ) -> Result<Self::Output, error_stack::Report<ParsingError>>; - /// Toggle for reverting the transfer that was made during the charge. - /// If set to false, the funds are pulled from the main platform's account. - pub revert_transfer: Option<bool>, + /// helps in converting back connector required amount type to core minor unit + fn convert_back( + &self, + amount: Self::Output, + currency: enums::Currency, + ) -> Result<MinorUnit, error_stack::Report<ParsingError>>; } -impl<DB: Backend> FromSql<Jsonb, DB> for ChargeRefunds -where - serde_json::Value: FromSql<Jsonb, DB>, -{ - fn from_sql(bytes: DB::RawValue<'_>) -> deserialize::Result<Self> { - let value = <serde_json::Value as FromSql<Jsonb, DB>>::from_sql(bytes)?; - Ok(serde_json::from_value(value)?) +/// Connector required amount type +#[derive(Default, Debug, Clone, Copy, PartialEq)] +pub struct StringMinorUnitForConnector; + +impl AmountConvertor for StringMinorUnitForConnector { + type Output = StringMinorUnit; + fn convert( + &self, + amount: MinorUnit, + _currency: enums::Currency, + ) -> Result<Self::Output, error_stack::Report<ParsingError>> { + amount.to_minor_unit_as_string() + } + + fn convert_back( + &self, + amount: Self::Output, + _currency: enums::Currency, + ) -> Result<MinorUnit, error_stack::Report<ParsingError>> { + amount.to_minor_unit_as_i64() } } -impl ToSql<Jsonb, diesel::pg::Pg> for ChargeRefunds -where - serde_json::Value: ToSql<Jsonb, diesel::pg::Pg>, -{ - fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, diesel::pg::Pg>) -> diesel::serialize::Result { - let value = serde_json::to_value(self)?; +/// Connector required amount type +#[derive(Default, Debug, serde::Deserialize, serde::Serialize, Clone, Copy, PartialEq)] +pub struct StringMajorUnitForConnector; - // the function `reborrow` only works in case of `Pg` backend. But, in case of other backends - // please refer to the diesel migration blog: - // https://github.com/Diesel-rs/Diesel/blob/master/guide_drafts/migration_guide.md#changed-tosql-implementations - <serde_json::Value as ToSql<Jsonb, diesel::pg::Pg>>::to_sql(&value, &mut out.reborrow()) +impl AmountConvertor for StringMajorUnitForConnector { + type Output = StringMajorUnit; + fn convert( + &self, + amount: MinorUnit, + currency: enums::Currency, + ) -> Result<Self::Output, error_stack::Report<ParsingError>> { + amount.to_major_unit_as_string(currency) + } + + fn convert_back( + &self, + amount: StringMajorUnit, + currency: enums::Currency, + ) -> Result<MinorUnit, error_stack::Report<ParsingError>> { + amount.to_minor_unit_as_i64(currency) } } +/// Connector required amount type +#[derive(Default, Debug, serde::Deserialize, serde::Serialize, Clone, Copy, PartialEq)] +pub struct FloatMajorUnitForConnector; + +impl AmountConvertor for FloatMajorUnitForConnector { + type Output = FloatMajorUnit; + fn convert( + &self, + amount: MinorUnit, + currency: enums::Currency, + ) -> Result<Self::Output, error_stack::Report<ParsingError>> { + amount.to_major_unit_as_f64(currency) + } + fn convert_back( + &self, + amount: FloatMajorUnit, + currency: enums::Currency, + ) -> Result<MinorUnit, error_stack::Report<ParsingError>> { + amount.to_minor_unit_as_i64(currency) + } +} /// This Unit struct represents MinorUnit in which core amount works #[derive( Default, @@ -287,9 +336,8 @@ where pub struct MinorUnit(i64); impl MinorUnit { - /// gets amount as i64 value + /// gets amount as i64 value will be removed in future pub fn get_amount_as_i64(&self) -> i64 { - // will be removed in future self.0 } @@ -297,6 +345,50 @@ impl MinorUnit { pub fn new(value: i64) -> Self { Self(value) } + + /// Convert the amount to its major denomination based on Currency and return String + /// Paypal Connector accepts Zero and Two decimal currency but not three decimal and it should be updated as required for 3 decimal currencies. + /// Paypal Ref - https://developer.paypal.com/docs/reports/reference/paypal-supported-currencies/ + fn to_major_unit_as_string( + self, + currency: enums::Currency, + ) -> Result<StringMajorUnit, error_stack::Report<ParsingError>> { + let amount_f64 = self.to_major_unit_as_f64(currency)?; + let amount_string = if currency.is_zero_decimal_currency() { + amount_f64.0.to_string() + } else if currency.is_three_decimal_currency() { + format!("{:.3}", amount_f64.0) + } else { + format!("{:.2}", amount_f64.0) + }; + Ok(StringMajorUnit::new(amount_string)) + } + + /// Convert the amount to its major denomination based on Currency and return f64 + fn to_major_unit_as_f64( + self, + currency: enums::Currency, + ) -> Result<FloatMajorUnit, error_stack::Report<ParsingError>> { + let amount_decimal = + Decimal::from_i64(self.0).ok_or(ParsingError::I64ToDecimalConversionFailure)?; + + let amount = if currency.is_zero_decimal_currency() { + amount_decimal + } else if currency.is_three_decimal_currency() { + amount_decimal / Decimal::from(1000) + } else { + amount_decimal / Decimal::from(100) + }; + let amount_f64 = amount + .to_f64() + .ok_or(ParsingError::FloatToDecimalConversionFailure)?; + Ok(FloatMajorUnit::new(amount_f64)) + } + + ///Convert minor unit to string minor unit + fn to_minor_unit_as_string(self) -> Result<StringMinorUnit, error_stack::Report<ParsingError>> { + Ok(StringMinorUnit::new(self.0.to_string())) + } } impl Display for MinorUnit { @@ -351,3 +443,251 @@ impl Sub for MinorUnit { Self(self.0 - a2.0) } } + +/// Connector specific types to send + +#[derive(Default, Debug, serde::Deserialize, serde::Serialize, Clone, PartialEq)] +pub struct StringMinorUnit(String); + +impl StringMinorUnit { + /// forms a new minor unit in string from amount + fn new(value: String) -> Self { + Self(value) + } + + /// converts to minor unit i64 from minor unit string value + fn to_minor_unit_as_i64(&self) -> Result<MinorUnit, error_stack::Report<ParsingError>> { + let amount_string = &self.0; + let amount_decimal = Decimal::from_str(amount_string).map_err(|e| { + ParsingError::StringToDecimalConversionFailure { + error: e.to_string(), + } + })?; + let amount_i64 = amount_decimal + .to_i64() + .ok_or(ParsingError::DecimalToI64ConversionFailure)?; + Ok(MinorUnit::new(amount_i64)) + } +} + +/// Connector specific types to send +#[derive(Default, Debug, serde::Deserialize, serde::Serialize, Clone, Copy, PartialEq)] +pub struct FloatMajorUnit(f64); + +impl FloatMajorUnit { + /// forms a new major unit from amount + fn new(value: f64) -> Self { + Self(value) + } + + /// forms a new major unit with zero amount + pub fn zero() -> Self { + Self(0.0) + } + + /// converts to minor unit as i64 from FloatMajorUnit + fn to_minor_unit_as_i64( + self, + currency: enums::Currency, + ) -> Result<MinorUnit, error_stack::Report<ParsingError>> { + let amount_decimal = + Decimal::from_f64(self.0).ok_or(ParsingError::FloatToDecimalConversionFailure)?; + + let amount = if currency.is_zero_decimal_currency() { + amount_decimal + } else if currency.is_three_decimal_currency() { + amount_decimal * Decimal::from(1000) + } else { + amount_decimal * Decimal::from(100) + }; + + let amount_i64 = amount + .to_i64() + .ok_or(ParsingError::DecimalToI64ConversionFailure)?; + Ok(MinorUnit::new(amount_i64)) + } +} + +/// Connector specific types to send +#[derive(Default, Debug, serde::Deserialize, serde::Serialize, Clone, PartialEq, Eq)] +pub struct StringMajorUnit(String); + +impl StringMajorUnit { + /// forms a new major unit from amount + fn new(value: String) -> Self { + Self(value) + } + + /// Converts to minor unit as i64 from StringMajorUnit + fn to_minor_unit_as_i64( + &self, + currency: enums::Currency, + ) -> Result<MinorUnit, error_stack::Report<ParsingError>> { + let amount_decimal = Decimal::from_str(&self.0).map_err(|e| { + ParsingError::StringToDecimalConversionFailure { + error: e.to_string(), + } + })?; + + let amount = if currency.is_zero_decimal_currency() { + amount_decimal + } else if currency.is_three_decimal_currency() { + amount_decimal * Decimal::from(1000) + } else { + amount_decimal * Decimal::from(100) + }; + let amount_i64 = amount + .to_i64() + .ok_or(ParsingError::DecimalToI64ConversionFailure)?; + Ok(MinorUnit::new(amount_i64)) + } +} + +#[cfg(test)] +mod amount_conversion_tests { + #![allow(clippy::unwrap_used)] + use super::*; + const TWO_DECIMAL_CURRENCY: enums::Currency = enums::Currency::USD; + const THREE_DECIMAL_CURRENCY: enums::Currency = enums::Currency::BHD; + const ZERO_DECIMAL_CURRENCY: enums::Currency = enums::Currency::JPY; + #[test] + fn amount_conversion_to_float_major_unit() { + let request_amount = MinorUnit::new(999999999); + let required_conversion = FloatMajorUnitForConnector; + + // Two decimal currency conversions + let converted_amount = required_conversion + .convert(request_amount, TWO_DECIMAL_CURRENCY) + .unwrap(); + assert_eq!(converted_amount.0, 9999999.99); + let converted_back_amount = required_conversion + .convert_back(converted_amount, TWO_DECIMAL_CURRENCY) + .unwrap(); + assert_eq!(converted_back_amount, request_amount); + + // Three decimal currency conversions + let converted_amount = required_conversion + .convert(request_amount, THREE_DECIMAL_CURRENCY) + .unwrap(); + assert_eq!(converted_amount.0, 999999.999); + let converted_back_amount = required_conversion + .convert_back(converted_amount, THREE_DECIMAL_CURRENCY) + .unwrap(); + assert_eq!(converted_back_amount, request_amount); + + // Zero decimal currency conversions + let converted_amount = required_conversion + .convert(request_amount, ZERO_DECIMAL_CURRENCY) + .unwrap(); + assert_eq!(converted_amount.0, 999999999.0); + + let converted_back_amount = required_conversion + .convert_back(converted_amount, ZERO_DECIMAL_CURRENCY) + .unwrap(); + assert_eq!(converted_back_amount, request_amount); + } + + #[test] + fn amount_conversion_to_string_major_unit() { + let request_amount = MinorUnit::new(999999999); + let required_conversion = StringMajorUnitForConnector; + + // Two decimal currency conversions + let converted_amount_two_decimal_currency = required_conversion + .convert(request_amount, TWO_DECIMAL_CURRENCY) + .unwrap(); + assert_eq!( + converted_amount_two_decimal_currency.0, + "9999999.99".to_string() + ); + let converted_back_amount = required_conversion + .convert_back(converted_amount_two_decimal_currency, TWO_DECIMAL_CURRENCY) + .unwrap(); + assert_eq!(converted_back_amount, request_amount); + + // Three decimal currency conversions + let converted_amount_three_decimal_currency = required_conversion + .convert(request_amount, THREE_DECIMAL_CURRENCY) + .unwrap(); + assert_eq!( + converted_amount_three_decimal_currency.0, + "999999.999".to_string() + ); + let converted_back_amount = required_conversion + .convert_back( + converted_amount_three_decimal_currency, + THREE_DECIMAL_CURRENCY, + ) + .unwrap(); + assert_eq!(converted_back_amount, request_amount); + + // Zero decimal currency conversions + let converted_amount = required_conversion + .convert(request_amount, ZERO_DECIMAL_CURRENCY) + .unwrap(); + assert_eq!(converted_amount.0, "999999999".to_string()); + + let converted_back_amount = required_conversion + .convert_back(converted_amount, ZERO_DECIMAL_CURRENCY) + .unwrap(); + assert_eq!(converted_back_amount, request_amount); + } + + #[test] + fn amount_conversion_to_string_minor_unit() { + let request_amount = MinorUnit::new(999999999); + let currency = TWO_DECIMAL_CURRENCY; + let required_conversion = StringMinorUnitForConnector; + let converted_amount = required_conversion + .convert(request_amount, currency) + .unwrap(); + assert_eq!(converted_amount.0, "999999999".to_string()); + let converted_back_amount = required_conversion + .convert_back(converted_amount, currency) + .unwrap(); + assert_eq!(converted_back_amount, request_amount); + } +} + +// Charges structs +#[derive( + Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, FromSqlRow, AsExpression, ToSchema, +)] +#[diesel(sql_type = Jsonb)] +/// Charge object for refunds +pub struct ChargeRefunds { + /// Identifier for charge created for the payment + pub charge_id: String, + + /// Toggle for reverting the application fee that was collected for the payment. + /// If set to false, the funds are pulled from the destination account. + pub revert_platform_fee: Option<bool>, + + /// Toggle for reverting the transfer that was made during the charge. + /// If set to false, the funds are pulled from the main platform's account. + pub revert_transfer: Option<bool>, +} + +impl<DB: Backend> FromSql<Jsonb, DB> for ChargeRefunds +where + serde_json::Value: FromSql<Jsonb, DB>, +{ + fn from_sql(bytes: DB::RawValue<'_>) -> deserialize::Result<Self> { + let value = <serde_json::Value as FromSql<Jsonb, DB>>::from_sql(bytes)?; + Ok(serde_json::from_value(value)?) + } +} + +impl ToSql<Jsonb, diesel::pg::Pg> for ChargeRefunds +where + serde_json::Value: ToSql<Jsonb, diesel::pg::Pg>, +{ + fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, diesel::pg::Pg>) -> diesel::serialize::Result { + let value = serde_json::to_value(self)?; + + // the function `reborrow` only works in case of `Pg` backend. But, in case of other backends + // please refer to the diesel migration blog: + // https://github.com/Diesel-rs/Diesel/blob/master/guide_drafts/migration_guide.md#changed-tosql-implementations + <serde_json::Value as ToSql<Jsonb, diesel::pg::Pg>>::to_sql(&value, &mut out.reborrow()) + } +} diff --git a/crates/diesel_models/src/refund.rs b/crates/diesel_models/src/refund.rs index aac282992a8..7d5b20c3d0c 100644 --- a/crates/diesel_models/src/refund.rs +++ b/crates/diesel_models/src/refund.rs @@ -1,4 +1,7 @@ -use common_utils::{pii, types::ChargeRefunds}; +use common_utils::{ + pii, + types::{ChargeRefunds, MinorUnit}, +}; use diesel::{AsChangeset, Identifiable, Insertable, Queryable}; use serde::{Deserialize, Serialize}; use time::PrimitiveDateTime; @@ -20,9 +23,9 @@ pub struct Refund { pub connector_refund_id: Option<String>, pub external_reference_id: Option<String>, pub refund_type: storage_enums::RefundType, - pub total_amount: i64, + pub total_amount: MinorUnit, pub currency: storage_enums::Currency, - pub refund_amount: i64, + pub refund_amount: MinorUnit, pub refund_status: storage_enums::RefundStatus, pub sent_to_gateway: bool, pub refund_error_message: Option<String>, @@ -65,9 +68,9 @@ pub struct RefundNew { pub connector: String, pub connector_refund_id: Option<String>, pub refund_type: storage_enums::RefundType, - pub total_amount: i64, + pub total_amount: MinorUnit, pub currency: storage_enums::Currency, - pub refund_amount: i64, + pub refund_amount: MinorUnit, pub refund_status: storage_enums::RefundStatus, pub sent_to_gateway: bool, pub metadata: Option<pii::SecretSerdeValue>, diff --git a/crates/hyperswitch_domain_models/src/router_request_types.rs b/crates/hyperswitch_domain_models/src/router_request_types.rs index 5a4838f9b79..30827e61c70 100644 --- a/crates/hyperswitch_domain_models/src/router_request_types.rs +++ b/crates/hyperswitch_domain_models/src/router_request_types.rs @@ -1,7 +1,9 @@ pub mod authentication; pub mod fraud_check; use api_models::payments::RequestSurchargeDetails; -use common_utils::{consts, errors, ext_traits::OptionExt, id_type, pii, types as common_types}; +use common_utils::{ + consts, errors, ext_traits::OptionExt, id_type, pii, types as common_types, types::MinorUnit, +}; use diesel_models::enums as storage_enums; use error_stack::ResultExt; use masking::Secret; @@ -57,6 +59,9 @@ pub struct PaymentsAuthorizeData { pub metadata: Option<pii::SecretSerdeValue>, pub authentication_data: Option<AuthenticationData>, pub charges: Option<PaymentCharges>, + + // New amount for amount frame work + pub minor_amount: MinorUnit, } #[derive(Debug, serde::Deserialize, Clone)] @@ -77,6 +82,10 @@ pub struct PaymentsCaptureData { pub browser_info: Option<BrowserInformation>, pub metadata: Option<pii::SecretSerdeValue>, // This metadata is used to store the metadata shared during the payment intent request. + + // New amount for amount frame work + pub minor_payment_amount: MinorUnit, + pub minor_amount_to_capture: MinorUnit, } #[derive(Debug, Clone, Default)] @@ -296,6 +305,9 @@ pub struct CompleteAuthorizeData { pub connector_meta: Option<serde_json::Value>, pub complete_authorize_url: Option<String>, pub metadata: Option<pii::SecretSerdeValue>, + + // New amount for amount frame work + pub minor_amount: MinorUnit, } #[derive(Debug, Clone)] @@ -387,18 +399,18 @@ impl ResponseId { #[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] pub struct SurchargeDetails { /// original_amount - pub original_amount: common_utils::types::MinorUnit, + pub original_amount: MinorUnit, /// surcharge value pub surcharge: common_utils::types::Surcharge, /// tax on surcharge value pub tax_on_surcharge: Option<common_utils::types::Percentage<{ consts::SURCHARGE_PERCENTAGE_PRECISION_LENGTH }>>, /// surcharge amount for this payment - pub surcharge_amount: common_utils::types::MinorUnit, + pub surcharge_amount: MinorUnit, /// tax on surcharge amount for this payment - pub tax_on_surcharge_amount: common_utils::types::MinorUnit, + pub tax_on_surcharge_amount: MinorUnit, /// sum of original amount, - pub final_amount: common_utils::types::MinorUnit, + pub final_amount: MinorUnit, } impl SurchargeDetails { @@ -410,7 +422,7 @@ impl SurchargeDetails { && request_surcharge_details.tax_amount.unwrap_or_default() == self.tax_on_surcharge_amount } - pub fn get_total_surcharge_amount(&self) -> common_utils::types::MinorUnit { + pub fn get_total_surcharge_amount(&self) -> MinorUnit { self.surcharge_amount + self.tax_on_surcharge_amount } } @@ -460,6 +472,7 @@ pub struct RefundsData { pub currency: storage_enums::Currency, /// Amount for the payment against which this refund is issued pub payment_amount: i64, + pub reason: Option<String>, pub webhook_url: Option<String>, /// Amount to be refunded @@ -469,6 +482,10 @@ pub struct RefundsData { pub browser_info: Option<BrowserInformation>, /// Charges associated with the payment pub charges: Option<ChargeRefunds>, + + // New amount for amount frame work + pub minor_payment_amount: MinorUnit, + pub minor_refund_amount: MinorUnit, } #[derive(Debug, serde::Deserialize, Clone)] diff --git a/crates/router/src/compatibility/stripe/refunds/types.rs b/crates/router/src/compatibility/stripe/refunds/types.rs index 10a01836144..d00da0d8588 100644 --- a/crates/router/src/compatibility/stripe/refunds/types.rs +++ b/crates/router/src/compatibility/stripe/refunds/types.rs @@ -46,7 +46,7 @@ impl From<StripeCreateRefundRequest> for refunds::RefundRequest { fn from(req: StripeCreateRefundRequest) -> Self { Self { refund_id: req.refund_id, - amount: req.amount, + amount: req.amount.map(common_utils::types::MinorUnit::new), payment_id: req.payment_intent, reason: req.reason, refund_type: Some(refunds::RefundType::Instant), @@ -82,7 +82,7 @@ impl From<refunds::RefundResponse> for StripeRefundResponse { fn from(res: refunds::RefundResponse) -> Self { Self { id: res.refund_id, - amount: res.amount, + amount: res.amount.get_amount_as_i64(), currency: res.currency.to_ascii_lowercase(), payment_intent: res.payment_id, status: res.status.into(), diff --git a/crates/router/src/connector/nmi.rs b/crates/router/src/connector/nmi.rs index 744eeb4a975..2c0712c5408 100644 --- a/crates/router/src/connector/nmi.rs +++ b/crates/router/src/connector/nmi.rs @@ -1,8 +1,11 @@ pub mod transformers; -use std::fmt::Debug; - -use common_utils::{crypto, ext_traits::ByteSliceExt, request::RequestContent}; +use common_utils::{ + crypto, + ext_traits::ByteSliceExt, + request::RequestContent, + types::{AmountConvertor, FloatMajorUnit, FloatMajorUnitForConnector}, +}; use diesel_models::enums; use error_stack::{report, ResultExt}; use regex::Regex; @@ -25,8 +28,18 @@ use crate::{ }, }; -#[derive(Clone, Debug)] -pub struct Nmi; +#[derive(Clone)] +pub struct Nmi { + amount_converter: &'static (dyn AmountConvertor<Output = FloatMajorUnit> + Sync), +} + +impl Nmi { + pub const fn new() -> &'static Self { + &Self { + amount_converter: &FloatMajorUnitForConnector, + } + } +} impl api::Payment for Nmi {} impl api::PaymentSession for Nmi {} @@ -325,12 +338,12 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P req: &types::PaymentsAuthorizeRouterData, _connectors: &settings::Connectors, ) -> CustomResult<RequestContent, errors::ConnectorError> { - let connector_router_data = nmi::NmiRouterData::try_from(( - &self.get_currency_unit(), + let amount = connector_utils::convert_amount( + self.amount_converter, + req.request.minor_amount, req.request.currency, - req.request.amount, - req, - ))?; + )?; + let connector_router_data = nmi::NmiRouterData::from((amount, req)); let connector_req = nmi::NmiPaymentsRequest::try_from(&connector_router_data)?; Ok(RequestContent::FormUrlEncoded(Box::new(connector_req))) } @@ -413,12 +426,12 @@ impl req: &types::PaymentsCompleteAuthorizeRouterData, _connectors: &settings::Connectors, ) -> CustomResult<RequestContent, errors::ConnectorError> { - let connector_router_data = nmi::NmiRouterData::try_from(( - &self.get_currency_unit(), + let amount = connector_utils::convert_amount( + self.amount_converter, + req.request.minor_amount, req.request.currency, - req.request.amount, - req, - ))?; + )?; + let connector_router_data = nmi::NmiRouterData::from((amount, req)); let connector_req = nmi::NmiCompleteRequest::try_from(&connector_router_data)?; Ok(RequestContent::FormUrlEncoded(Box::new(connector_req))) } @@ -565,12 +578,12 @@ impl ConnectorIntegration<api::Capture, types::PaymentsCaptureData, types::Payme req: &types::PaymentsCaptureRouterData, _connectors: &settings::Connectors, ) -> CustomResult<RequestContent, errors::ConnectorError> { - let connector_router_data = nmi::NmiRouterData::try_from(( - &self.get_currency_unit(), + let amount = connector_utils::convert_amount( + self.amount_converter, + req.request.minor_amount_to_capture, req.request.currency, - req.request.amount_to_capture, - req, - ))?; + )?; + let connector_router_data = nmi::NmiRouterData::from((amount, req)); let connector_req = nmi::NmiCaptureRequest::try_from(&connector_router_data)?; Ok(RequestContent::FormUrlEncoded(Box::new(connector_req))) } @@ -713,12 +726,13 @@ impl ConnectorIntegration<api::Execute, types::RefundsData, types::RefundsRespon req: &types::RefundsRouterData<api::Execute>, _connectors: &settings::Connectors, ) -> CustomResult<RequestContent, errors::ConnectorError> { - let connector_router_data = nmi::NmiRouterData::try_from(( - &self.get_currency_unit(), + let refund_amount = connector_utils::convert_amount( + self.amount_converter, + req.request.minor_refund_amount, req.request.currency, - req.request.refund_amount, - req, - ))?; + )?; + + let connector_router_data = nmi::NmiRouterData::from((refund_amount, req)); let connector_req = nmi::NmiRefundRequest::try_from(&connector_router_data)?; Ok(RequestContent::FormUrlEncoded(Box::new(connector_req))) } diff --git a/crates/router/src/connector/nmi/transformers.rs b/crates/router/src/connector/nmi/transformers.rs index 44836002024..c18feefa2f3 100644 --- a/crates/router/src/connector/nmi/transformers.rs +++ b/crates/router/src/connector/nmi/transformers.rs @@ -5,6 +5,7 @@ use common_utils::{ errors::CustomResult, ext_traits::XmlExt, pii::{self, Email}, + types::FloatMajorUnit, }; use error_stack::{report, Report, ResultExt}; use masking::{ExposeInterface, PeekInterface, Secret}; @@ -57,25 +58,16 @@ impl TryFrom<&ConnectorAuthType> for NmiAuthType { #[derive(Debug, Serialize)] pub struct NmiRouterData<T> { - pub amount: f64, + pub amount: FloatMajorUnit, pub router_data: T, } -impl<T> TryFrom<(&api::CurrencyUnit, enums::Currency, i64, T)> for NmiRouterData<T> { - type Error = Report<errors::ConnectorError>; - - fn try_from( - (_currency_unit, currency, amount, router_data): ( - &api::CurrencyUnit, - enums::Currency, - i64, - T, - ), - ) -> Result<Self, Self::Error> { - Ok(Self { - amount: utils::to_currency_base_unit_asf64(amount, currency)?, +impl<T> From<(FloatMajorUnit, T)> for NmiRouterData<T> { + fn from((amount, router_data): (FloatMajorUnit, T)) -> Self { + Self { + amount, router_data, - }) + } } } @@ -251,7 +243,7 @@ impl #[derive(Debug, Serialize)] pub struct NmiCompleteRequest { - amount: f64, + amount: FloatMajorUnit, #[serde(rename = "type")] transaction_type: TransactionType, security_key: Secret<String>, @@ -422,7 +414,7 @@ impl ForeignFrom<(NmiCompleteResponse, u16)> for types::ErrorResponse { pub struct NmiPaymentsRequest { #[serde(rename = "type")] transaction_type: TransactionType, - amount: f64, + amount: FloatMajorUnit, security_key: Secret<String>, currency: enums::Currency, #[serde(flatten)] @@ -675,7 +667,7 @@ impl TryFrom<&types::SetupMandateRouterData> for NmiPaymentsRequest { Ok(Self { transaction_type: TransactionType::Validate, security_key: auth_type.api_key, - amount: 0.0, + amount: FloatMajorUnit::zero(), currency: item.request.currency, payment_method, merchant_defined_field: None, @@ -707,7 +699,7 @@ pub struct NmiCaptureRequest { pub transaction_type: TransactionType, pub security_key: Secret<String>, pub transactionid: String, - pub amount: Option<f64>, + pub amount: Option<FloatMajorUnit>, } impl TryFrom<&NmiRouterData<&types::PaymentsCaptureRouterData>> for NmiCaptureRequest { @@ -1062,7 +1054,7 @@ pub struct NmiRefundRequest { security_key: Secret<String>, transactionid: String, orderid: String, - amount: f64, + amount: FloatMajorUnit, } impl<F> TryFrom<&NmiRouterData<&types::RefundsRouterData<F>>> for NmiRefundRequest { diff --git a/crates/router/src/connector/stripe.rs b/crates/router/src/connector/stripe.rs index febb039768c..171cde7bc9d 100644 --- a/crates/router/src/connector/stripe.rs +++ b/crates/router/src/connector/stripe.rs @@ -1,6 +1,6 @@ pub mod transformers; -use std::{collections::HashMap, fmt::Debug, ops::Deref}; +use std::{collections::HashMap, ops::Deref}; use common_utils::request::RequestContent; use diesel_models::enums; diff --git a/crates/router/src/connector/utils.rs b/crates/router/src/connector/utils.rs index a9c78cb4bf1..ba0ef166808 100644 --- a/crates/router/src/connector/utils.rs +++ b/crates/router/src/connector/utils.rs @@ -13,7 +13,7 @@ use common_utils::{ ext_traits::StringExt, id_type, pii::{self, Email, IpAddress}, - types::MinorUnit, + types::{AmountConvertor, MinorUnit}, }; use diesel_models::enums; use error_stack::{report, ResultExt}; @@ -2618,3 +2618,23 @@ impl From<domain::payments::PaymentMethodData> for PaymentMethodDataType { } } } + +pub fn convert_amount<T>( + amount_convertor: &dyn AmountConvertor<Output = T>, + amount: MinorUnit, + currency: enums::Currency, +) -> Result<T, error_stack::Report<errors::ConnectorError>> { + amount_convertor + .convert(amount, currency) + .change_context(errors::ConnectorError::AmountConversionFailed) +} + +pub fn convert_back<T>( + amount_convertor: &dyn AmountConvertor<Output = T>, + amount: T, + currency: enums::Currency, +) -> Result<MinorUnit, error_stack::Report<errors::ConnectorError>> { + amount_convertor + .convert_back(amount, currency) + .change_context(errors::ConnectorError::AmountConversionFailed) +} diff --git a/crates/router/src/core/errors.rs b/crates/router/src/core/errors.rs index 3a8cab8c516..0e9e4022798 100644 --- a/crates/router/src/core/errors.rs +++ b/crates/router/src/core/errors.rs @@ -219,6 +219,8 @@ pub enum ConnectorError { }, #[error("Invalid Configuration")] InvalidConnectorConfig { config: &'static str }, + #[error("Failed to convert amount to required type")] + AmountConversionFailed, } #[derive(Debug, thiserror::Error)] diff --git a/crates/router/src/core/errors/utils.rs b/crates/router/src/core/errors/utils.rs index 1e2f5a2c305..8ec95514f88 100644 --- a/crates/router/src/core/errors/utils.rs +++ b/crates/router/src/core/errors/utils.rs @@ -215,7 +215,8 @@ impl<T> ConnectorErrorExt<T> for error_stack::Result<T, errors::ConnectorError> | errors::ConnectorError::InSufficientBalanceInPaymentMethod | errors::ConnectorError::RequestTimeoutReceived | errors::ConnectorError::CurrencyNotSupported { .. } - | errors::ConnectorError::InvalidConnectorConfig { .. } => { + | errors::ConnectorError::InvalidConnectorConfig { .. } + | errors::ConnectorError::AmountConversionFailed { .. } => { err.change_context(errors::ApiErrorResponse::RefundFailed { data: None }) } }) @@ -309,7 +310,8 @@ impl<T> ConnectorErrorExt<T> for error_stack::Result<T, errors::ConnectorError> errors::ConnectorError::MissingPaymentMethodType | errors::ConnectorError::InSufficientBalanceInPaymentMethod | errors::ConnectorError::RequestTimeoutReceived | - errors::ConnectorError::ProcessingStepFailed(None) => errors::ApiErrorResponse::InternalServerError + errors::ConnectorError::ProcessingStepFailed(None)| + errors::ConnectorError::AmountConversionFailed => errors::ApiErrorResponse::InternalServerError }; err.change_context(error) }) @@ -399,7 +401,8 @@ impl<T> ConnectorErrorExt<T> for error_stack::Result<T, errors::ConnectorError> | errors::ConnectorError::InSufficientBalanceInPaymentMethod | errors::ConnectorError::RequestTimeoutReceived | errors::ConnectorError::CurrencyNotSupported { .. } - | errors::ConnectorError::ProcessingStepFailed(None) => { + | errors::ConnectorError::ProcessingStepFailed(None) + | errors::ConnectorError::AmountConversionFailed { .. } => { logger::error!(%error,"Setup Mandate flow failed"); errors::ApiErrorResponse::PaymentAuthorizationFailed { data: None } } diff --git a/crates/router/src/core/payments/transformers.rs b/crates/router/src/core/payments/transformers.rs index d8a7092455b..a5859ea6dc6 100644 --- a/crates/router/src/core/payments/transformers.rs +++ b/crates/router/src/core/payments/transformers.rs @@ -1260,6 +1260,7 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsAuthoriz statement_descriptor: payment_data.payment_intent.statement_descriptor_name, capture_method: payment_data.payment_attempt.capture_method, amount: amount.get_amount_as_i64(), + minor_amount: amount, currency: payment_data.currency, browser_info, email: payment_data.email, @@ -1420,12 +1421,14 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsCaptureD let amount = MinorUnit::from(payment_data.amount); Ok(Self { amount_to_capture: amount_to_capture.get_amount_as_i64(), // This should be removed once we start moving to connector module + minor_amount_to_capture: amount_to_capture, currency: payment_data.currency, connector_transaction_id: connector .connector .connector_transaction_id(payment_data.payment_attempt.clone())? .ok_or(errors::ApiErrorResponse::ResourceIdNotFound)?, payment_amount: amount.get_amount_as_i64(), // This should be removed once we start moving to connector module + minor_payment_amount: amount, connector_meta: payment_data.payment_attempt.connector_metadata, multiple_capture_data: match payment_data.multiple_capture_data { Some(multiple_capture_data) => Some(MultipleCaptureRequestData { @@ -1702,6 +1705,7 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::CompleteAuthoriz statement_descriptor_suffix: payment_data.payment_intent.statement_descriptor_suffix, capture_method: payment_data.payment_attempt.capture_method, amount: amount.get_amount_as_i64(), // need to change once we move to connector module + minor_amount: amount, currency: payment_data.currency, browser_info, email: payment_data.email, diff --git a/crates/router/src/core/refunds.rs b/crates/router/src/core/refunds.rs index b9861ea1f23..9ab1ec0eb88 100644 --- a/crates/router/src/core/refunds.rs +++ b/crates/router/src/core/refunds.rs @@ -5,7 +5,10 @@ use std::collections::HashMap; #[cfg(feature = "olap")] use api_models::admin::MerchantConnectorInfo; -use common_utils::ext_traits::{AsyncExt, ValueExt}; +use common_utils::{ + ext_traits::{AsyncExt, ValueExt}, + types::MinorUnit, +}; use error_stack::{report, ResultExt}; use masking::PeekInterface; use router_env::{instrument, tracing}; @@ -75,14 +78,12 @@ pub async fn refund_create_core( // Amount is not passed in request refer from payment intent. amount = req .amount - .or(payment_intent - .amount_captured - .map(|capture_amount| capture_amount.get_amount_as_i64())) + .or(payment_intent.amount_captured) .ok_or(errors::ApiErrorResponse::InternalServerError) .attach_printable("amount captured is none in a successful payment")?; //[#299]: Can we change the flow based on some workflow idea - utils::when(amount <= 0, || { + utils::when(amount <= MinorUnit::new(0), || { Err(report!(errors::ApiErrorResponse::InvalidDataFormat { field_name: "amount".to_string(), expected_format: "positive integer".to_string() @@ -178,7 +179,7 @@ pub async fn trigger_refund_to_gateway( &routed_through, merchant_account, key_store, - (payment_attempt.amount.get_amount_as_i64(), currency), + (payment_attempt.amount, currency), payment_intent, payment_attempt, refund, @@ -458,7 +459,7 @@ pub async fn sync_refund_with_gateway( &connector_id, merchant_account, key_store, - (payment_attempt.amount.get_amount_as_i64(), currency), + (payment_attempt.amount, currency), payment_intent, payment_attempt, refund, @@ -588,7 +589,7 @@ pub async fn validate_and_create_refund( key_store: &domain::MerchantKeyStore, payment_attempt: &storage::PaymentAttempt, payment_intent: &storage::PaymentIntent, - refund_amount: i64, + refund_amount: MinorUnit, req: refunds::RefundRequest, creds_identifier: Option<String>, ) -> RouterResult<refunds::RefundResponse> { @@ -680,7 +681,7 @@ pub async fn validate_and_create_refund( validator::validate_refund_amount( total_amount_captured.get_amount_as_i64(), &all_refunds, - refund_amount, + refund_amount.get_amount_as_i64(), ) .change_context(errors::ApiErrorResponse::RefundAmountExceedsPaymentAmount)?; @@ -705,7 +706,7 @@ pub async fn validate_and_create_refund( .set_connector_transaction_id(connecter_transaction_id.to_string()) .set_connector(connector) .set_refund_type(req.refund_type.unwrap_or_default().foreign_into()) - .set_total_amount(payment_attempt.amount.get_amount_as_i64()) + .set_total_amount(payment_attempt.amount) .set_refund_amount(refund_amount) .set_currency(currency) .set_created_at(Some(common_utils::date_time::now())) diff --git a/crates/router/src/core/refunds/validator.rs b/crates/router/src/core/refunds/validator.rs index 58be964d702..1167fde5677 100644 --- a/crates/router/src/core/refunds/validator.rs +++ b/crates/router/src/core/refunds/validator.rs @@ -54,7 +54,7 @@ pub fn validate_refund_amount( if refund.refund_status != enums::RefundStatus::Failure && refund.refund_status != enums::RefundStatus::TransactionFailure { - Some(refund.refund_amount) + Some(refund.refund_amount.get_amount_as_i64()) } else { None } diff --git a/crates/router/src/core/utils.rs b/crates/router/src/core/utils.rs index ca464cc6270..e585724e96a 100644 --- a/crates/router/src/core/utils.rs +++ b/crates/router/src/core/utils.rs @@ -6,7 +6,7 @@ use api_models::payouts::PayoutVendorAccountDetails; use common_enums::{IntentStatus, RequestIncrementalAuthorization}; #[cfg(feature = "payouts")] use common_utils::{crypto::Encryptable, pii::Email}; -use common_utils::{errors::CustomResult, ext_traits::AsyncExt}; +use common_utils::{errors::CustomResult, ext_traits::AsyncExt, types::MinorUnit}; use error_stack::{report, ResultExt}; use hyperswitch_domain_models::{payment_address::PaymentAddress, router_data::ErrorResponse}; #[cfg(feature = "payouts")] @@ -218,7 +218,7 @@ pub async fn construct_refund_router_data<'a, F>( connector_id: &str, merchant_account: &domain::MerchantAccount, key_store: &domain::MerchantKeyStore, - money: (i64, enums::Currency), + money: (MinorUnit, enums::Currency), payment_intent: &'a storage::PaymentIntent, payment_attempt: &storage::PaymentAttempt, refund: &'a storage::Refund, @@ -323,9 +323,11 @@ pub async fn construct_refund_router_data<'a, F>( request: types::RefundsData { refund_id: refund.refund_id.clone(), connector_transaction_id: refund.connector_transaction_id.clone(), - refund_amount: refund.refund_amount, + refund_amount: refund.refund_amount.get_amount_as_i64(), + minor_refund_amount: refund.refund_amount, currency, - payment_amount, + payment_amount: payment_amount.get_amount_as_i64(), + minor_payment_amount: payment_amount, webhook_url, connector_metadata: payment_attempt.connector_metadata.clone(), reason: refund.refund_reason.clone(), diff --git a/crates/router/src/db/refund.rs b/crates/router/src/db/refund.rs index 1b1bfed3871..c5edd863caf 100644 --- a/crates/router/src/db/refund.rs +++ b/crates/router/src/db/refund.rs @@ -1,6 +1,8 @@ #[cfg(feature = "olap")] use std::collections::HashSet; +#[cfg(feature = "olap")] +use common_utils::types::MinorUnit; use diesel_models::{errors::DatabaseError, refund::RefundUpdateInternal}; use error_stack::ResultExt; @@ -1024,8 +1026,10 @@ impl RefundInterface for MockDb { .amount_filter .as_ref() .map_or(true, |amount| { - refund.refund_amount >= amount.start_amount.unwrap_or(i64::MIN) - && refund.refund_amount <= amount.end_amount.unwrap_or(i64::MAX) + refund.refund_amount + >= MinorUnit::new(amount.start_amount.unwrap_or(i64::MIN)) + && refund.refund_amount + <= MinorUnit::new(amount.end_amount.unwrap_or(i64::MAX)) }) }) .filter(|refund| { @@ -1173,8 +1177,10 @@ impl RefundInterface for MockDb { .amount_filter .as_ref() .map_or(true, |amount| { - refund.refund_amount >= amount.start_amount.unwrap_or(i64::MIN) - && refund.refund_amount <= amount.end_amount.unwrap_or(i64::MAX) + refund.refund_amount + >= MinorUnit::new(amount.start_amount.unwrap_or(i64::MIN)) + && refund.refund_amount + <= MinorUnit::new(amount.end_amount.unwrap_or(i64::MAX)) }) }) .filter(|refund| { diff --git a/crates/router/src/services/kafka/refund.rs b/crates/router/src/services/kafka/refund.rs index 4bfe2cd31ec..d5ef71bf651 100644 --- a/crates/router/src/services/kafka/refund.rs +++ b/crates/router/src/services/kafka/refund.rs @@ -1,3 +1,4 @@ +use common_utils::types::MinorUnit; use diesel_models::{enums as storage_enums, refund::Refund}; use time::OffsetDateTime; @@ -12,9 +13,9 @@ pub struct KafkaRefund<'a> { pub connector_refund_id: Option<&'a String>, pub external_reference_id: Option<&'a String>, pub refund_type: &'a storage_enums::RefundType, - pub total_amount: &'a i64, + pub total_amount: &'a MinorUnit, pub currency: &'a storage_enums::Currency, - pub refund_amount: &'a i64, + pub refund_amount: &'a MinorUnit, pub refund_status: &'a storage_enums::RefundStatus, pub sent_to_gateway: &'a bool, pub refund_error_message: Option<&'a String>, diff --git a/crates/router/src/types.rs b/crates/router/src/types.rs index fc1b59f431c..e17ec791637 100644 --- a/crates/router/src/types.rs +++ b/crates/router/src/types.rs @@ -21,7 +21,7 @@ use std::marker::PhantomData; pub use api_models::{enums::Connector, mandates}; #[cfg(feature = "payouts")] pub use api_models::{enums::PayoutConnectors, payouts as payout_types}; -pub use common_utils::request::RequestContent; +pub use common_utils::{pii, pii::Email, request::RequestContent, types::MinorUnit}; #[cfg(feature = "payouts")] pub use hyperswitch_domain_models::router_request_types::PayoutsData; #[cfg(feature = "payouts")] @@ -761,6 +761,7 @@ impl ForeignFrom<&SetupMandateRouterData> for PaymentsAuthorizeData { email: data.request.email.clone(), customer_name: data.request.customer_name.clone(), amount: 0, + minor_amount: MinorUnit::new(0), statement_descriptor: None, capture_method: None, webhook_url: None, diff --git a/crates/router/src/types/api.rs b/crates/router/src/types/api.rs index 9ad0542243a..7aa6aad93cf 100644 --- a/crates/router/src/types/api.rs +++ b/crates/router/src/types/api.rs @@ -170,7 +170,6 @@ pub trait Connector: Send + Refund + Payment - + Debug + ConnectorRedirectResponse + IncomingWebhook + ConnectorAccessToken @@ -192,7 +191,6 @@ pub struct Pe; impl< T: Refund + Payment - + Debug + ConnectorRedirectResponse + Send + IncomingWebhook @@ -224,7 +222,7 @@ pub enum GetToken { /// Routing algorithm will output merchant connector identifier instead of connector name /// In order to support backwards compatibility for older routing algorithms and merchant accounts /// the support for connector name is retained -#[derive(Clone, Debug)] +#[derive(Clone)] pub struct ConnectorData { pub connector: BoxedConnector, pub connector_name: types::Connector, @@ -284,7 +282,7 @@ impl ConnectorData { let connector_name = api_enums::Connector::from_str(name) .change_context(errors::ConnectorError::InvalidConnectorName) .change_context(errors::ApiErrorResponse::InternalServerError) - .attach_printable_lazy(|| format!("unable to parse connector name {connector:?}"))?; + .attach_printable_lazy(|| format!("unable to parse connector name {name}"))?; Ok(Self { connector, connector_name, @@ -304,9 +302,7 @@ impl ConnectorData { let payout_connector_name = api_enums::PayoutConnectors::from_str(name) .change_context(errors::ConnectorError::InvalidConnectorName) .change_context(errors::ApiErrorResponse::InternalServerError) - .attach_printable_lazy(|| { - format!("unable to parse payout connector name {connector:?}") - })?; + .attach_printable_lazy(|| format!("unable to parse payout connector name {name}"))?; let connector_name = api_enums::Connector::from(payout_connector_name); Ok(Self { connector, @@ -364,7 +360,7 @@ impl ConnectorData { enums::Connector::Klarna => Ok(Box::new(&connector::Klarna)), // enums::Connector::Mifinity => Ok(Box::new(&connector::Mifinity)), Added as template code for future usage enums::Connector::Mollie => Ok(Box::new(&connector::Mollie)), - enums::Connector::Nmi => Ok(Box::new(&connector::Nmi)), + enums::Connector::Nmi => Ok(Box::new(connector::Nmi::new())), enums::Connector::Noon => Ok(Box::new(&connector::Noon)), enums::Connector::Nuvei => Ok(Box::new(&connector::Nuvei)), enums::Connector::Opennode => Ok(Box::new(&connector::Opennode)), diff --git a/crates/router/src/types/api/authentication.rs b/crates/router/src/types/api/authentication.rs index 9837059dc01..85d4d3718c7 100644 --- a/crates/router/src/types/api/authentication.rs +++ b/crates/router/src/types/api/authentication.rs @@ -119,7 +119,7 @@ pub trait ExternalAuthentication: { } -#[derive(Clone, Debug)] +#[derive(Clone)] pub struct AuthenticationConnectorData { pub connector: BoxedConnector, pub connector_name: enums::AuthenticationConnectors, diff --git a/crates/router/src/types/api/fraud_check.rs b/crates/router/src/types/api/fraud_check.rs index 45c79930e80..c413126ee04 100644 --- a/crates/router/src/types/api/fraud_check.rs +++ b/crates/router/src/types/api/fraud_check.rs @@ -55,7 +55,7 @@ pub trait FraudCheckRecordReturn: { } -#[derive(Clone, Debug)] +#[derive(Clone)] pub struct FraudCheckConnectorData { pub connector: BoxedConnector, pub connector_name: enums::FrmConnectors, diff --git a/crates/router/src/types/api/verify_connector.rs b/crates/router/src/types/api/verify_connector.rs index cf7ba2382a3..60749f64789 100644 --- a/crates/router/src/types/api/verify_connector.rs +++ b/crates/router/src/types/api/verify_connector.rs @@ -1,6 +1,5 @@ pub mod paypal; pub mod stripe; - use error_stack::ResultExt; use crate::{ @@ -12,7 +11,7 @@ use crate::{ AppState, }; -#[derive(Clone, Debug)] +#[derive(Clone)] pub struct VerifyConnectorData { pub connector: &'static (dyn api::Connector + Sync), pub connector_auth: types::ConnectorAuthType, @@ -26,6 +25,7 @@ impl VerifyConnectorData { email: None, customer_name: None, amount: 1000, + minor_amount: common_utils::types::MinorUnit::new(1000), confirm: true, currency: storage_enums::Currency::USD, metadata: None, diff --git a/crates/router/src/utils/ext_traits.rs b/crates/router/src/utils/ext_traits.rs index 7b08dc296c7..33fdb4c9b25 100644 --- a/crates/router/src/utils/ext_traits.rs +++ b/crates/router/src/utils/ext_traits.rs @@ -26,15 +26,12 @@ pub trait OptionExt<T> { fn update_value(&mut self, value: Option<T>); } -impl<T> OptionExt<T> for Option<T> -where - T: std::fmt::Debug, -{ +impl<T> OptionExt<T> for Option<T> { fn check_value_present(&self, field_name: &'static str) -> RouterResult<()> { when(self.is_none(), || { Err( Report::new(ApiErrorResponse::MissingRequiredField { field_name }) - .attach_printable(format!("Missing required field {field_name} in {self:?}")), + .attach_printable(format!("Missing required field {field_name}")), ) }) } @@ -46,7 +43,7 @@ where Some(v) => Ok(v), None => Err( Report::new(ApiErrorResponse::MissingRequiredField { field_name }) - .attach_printable(format!("Missing required field {field_name} in {self:?}")), + .attach_printable(format!("Missing required field {field_name}")), ), } } @@ -63,7 +60,7 @@ where E::from_str(value.as_ref()) .change_context(errors::ParsingError::UnknownError) - .attach_printable_lazy(|| format!("Invalid {{ {enum_name}: {value:?} }} ")) + .attach_printable_lazy(|| format!("Invalid {{ {enum_name} }} ")) } fn parse_value<U>(self, type_name: &'static str) -> CustomResult<U, errors::ParsingError> diff --git a/crates/router/src/utils/user/sample_data.rs b/crates/router/src/utils/user/sample_data.rs index 256b115dbba..ea690af35ae 100644 --- a/crates/router/src/utils/user/sample_data.rs +++ b/crates/router/src/utils/user/sample_data.rs @@ -2,7 +2,7 @@ use api_models::{ enums::Connector::{DummyConnector4, DummyConnector7}, user::sample_data::SampleDataRequest, }; -use common_utils::id_type; +use common_utils::{id_type, types::MinorUnit}; use diesel_models::{user::sample_data::PaymentAttemptBatchNew, RefundNew}; use error_stack::ResultExt; use hyperswitch_domain_models::payments::payment_intent::PaymentIntentNew; @@ -179,7 +179,7 @@ pub async fn generate_sample_data( true => common_enums::IntentStatus::Failed, _ => common_enums::IntentStatus::Succeeded, }, - amount: common_utils::types::MinorUnit::new(amount * 100), + amount: MinorUnit::new(amount * 100), currency: Some( *currency_vec .get((num - 1) % currency_vec_len) @@ -197,7 +197,7 @@ pub async fn generate_sample_data( ), attempt_count: 1, customer_id: Some(dashboard_customer_id.clone()), - amount_captured: Some(common_utils::types::MinorUnit::new(amount * 100)), + amount_captured: Some(MinorUnit::new(amount * 100)), profile_id: Some(profile_id.clone()), return_url: Default::default(), metadata: Default::default(), @@ -291,8 +291,8 @@ pub async fn generate_sample_data( currency: *currency_vec .get((num - 1) % currency_vec_len) .unwrap_or(&common_enums::Currency::USD), - total_amount: amount * 100, - refund_amount: amount * 100, + total_amount: MinorUnit::new(amount * 100), + refund_amount: MinorUnit::new(amount * 100), refund_status: common_enums::RefundStatus::Success, sent_to_gateway: true, refund_type: diesel_models::enums::RefundType::InstantRefund, diff --git a/crates/router/tests/connectors/nmi.rs b/crates/router/tests/connectors/nmi.rs index 1d719e052a0..d5f1ebd4fad 100644 --- a/crates/router/tests/connectors/nmi.rs +++ b/crates/router/tests/connectors/nmi.rs @@ -13,7 +13,7 @@ impl utils::Connector for NmiTest { fn get_data(&self) -> types::api::ConnectorData { use router::connector::Nmi; types::api::ConnectorData { - connector: Box::new(&Nmi), + connector: Box::new(Nmi::new()), connector_name: types::Connector::Nmi, get_token: types::api::GetToken::Connector, merchant_connector_id: None, diff --git a/crates/router/tests/connectors/utils.rs b/crates/router/tests/connectors/utils.rs index ae93ca326ba..b7be24f2a15 100644 --- a/crates/router/tests/connectors/utils.rs +++ b/crates/router/tests/connectors/utils.rs @@ -11,7 +11,7 @@ use router::{ core::{errors::ConnectorError, payments}, db::StorageImpl, routes, services, - types::{self, storage::enums, AccessToken, PaymentAddress, RouterData}, + types::{self, storage::enums, AccessToken, MinorUnit, PaymentAddress, RouterData}, }; use test_utils::connector_auth::ConnectorAuthType; use tokio::sync::oneshot; @@ -414,11 +414,13 @@ pub trait ConnectorActions: Connector { let request = self.generate_data( payment_data.unwrap_or_else(|| types::RefundsData { payment_amount: 1000, + minor_payment_amount: MinorUnit::new(1000), currency: enums::Currency::USD, refund_id: uuid::Uuid::new_v4().to_string(), connector_transaction_id: "".to_string(), webhook_url: None, refund_amount: 100, + minor_refund_amount: MinorUnit::new(100), connector_metadata: None, reason: None, connector_refund_id: Some(refund_id), @@ -915,6 +917,7 @@ impl Default for PaymentAuthorizeType { let data = types::PaymentsAuthorizeData { payment_method_data: types::domain::PaymentMethodData::Card(CCardType::default().0), amount: 100, + minor_amount: MinorUnit::new(100), currency: enums::Currency::USD, confirm: true, statement_descriptor_suffix: None, @@ -1012,10 +1015,12 @@ impl Default for PaymentRefundType { fn default() -> Self { let data = types::RefundsData { payment_amount: 100, + minor_payment_amount: MinorUnit::new(100), currency: enums::Currency::USD, refund_id: uuid::Uuid::new_v4().to_string(), connector_transaction_id: String::new(), refund_amount: 100, + minor_refund_amount: MinorUnit::new(100), webhook_url: None, connector_metadata: None, reason: Some("Customer returned product".to_string()), diff --git a/openapi/openapi_spec.json b/openapi/openapi_spec.json index 9defe94f94c..fe3c934f4ab 100644 --- a/openapi/openapi_spec.json +++ b/openapi/openapi_spec.json @@ -17400,7 +17400,9 @@ "amount": { "type": "integer", "format": "int64", - "description": "The refund amount, which should be less than or equal to the total payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc" + "description": "The refund amount, which should be less than or equal to the total payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc", + "example": 6540, + "minimum": 100 }, "currency": { "type": "string",
feat
Added amount conversion function in core for connector module (#4710)
6ee1cad46931e2ceb8a6280e469aa1735d60c970
2024-07-12 18:34:57
Prajjwal Kumar
chore: making of function create_encrypted_data (#5251)
false
diff --git a/crates/router/src/core/payment_methods/cards.rs b/crates/router/src/core/payment_methods/cards.rs index ee6ac7731c2..33e188b8ca0 100644 --- a/crates/router/src/core/payment_methods/cards.rs +++ b/crates/router/src/core/payment_methods/cards.rs @@ -46,6 +46,8 @@ use super::surcharge_decision_configs::{ }; #[cfg(not(feature = "connector_choice_mca_id"))] use crate::core::utils::get_connector_label; +#[cfg(feature = "payouts")] +use crate::types::domain::types::AsyncLift; use crate::{ configs::settings, core::{ @@ -67,10 +69,7 @@ use crate::{ services, types::{ api::{self, routing as routing_types, PaymentMethodCreateExt}, - domain::{ - self, - types::{decrypt, encrypt_optional, AsyncLift}, - }, + domain::{self, types::decrypt}, storage::{self, enums, PaymentMethodListContext, PaymentTokenData}, transformers::{ForeignFrom, ForeignTryFrom}, }, @@ -351,9 +350,14 @@ pub async fn skip_locker_call_and_migrate_payment_method( .change_context(errors::ApiErrorResponse::InternalServerError) .attach_printable("Failed to parse connector mandate details")?; - let payment_method_billing_address = create_encrypted_data(key_store, req.billing.clone()) + let payment_method_billing_address: Option<Encryptable<Secret<serde_json::Value>>> = req + .billing + .clone() + .async_map(|billing| create_encrypted_data(key_store, billing)) .await - .map(|details| details.into()); + .transpose() + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("Unable to encrypt Payment method billing address")?; let customer = db .find_customer_by_customer_id_merchant_id( @@ -484,10 +488,13 @@ pub async fn skip_locker_call_and_migrate_payment_method( .as_ref() .map(|card| PaymentMethodsData::Card(CardDetailsPaymentMethod::from(card.clone()))); - let payment_method_data_encrypted = - create_encrypted_data(key_store, payment_method_card_details) + let payment_method_data_encrypted: Option<Encryptable<Secret<serde_json::Value>>> = + payment_method_card_details + .async_map(|card_details| create_encrypted_data(key_store, card_details)) .await - .map(|details| details.into()); + .transpose() + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("Unable to encrypt Payment method card details")?; let payment_method_metadata: Option<serde_json::Value> = req.metadata.as_ref().map(|data| data.peek()).cloned(); @@ -508,7 +515,7 @@ pub async fn skip_locker_call_and_migrate_payment_method( payment_method_issuer: req.payment_method_issuer.clone(), scheme: req.card_network.clone(), metadata: payment_method_metadata.map(Secret::new), - payment_method_data: payment_method_data_encrypted, + payment_method_data: payment_method_data_encrypted.map(Into::into), connector_mandate_details: Some(connector_mandate_details), customer_acceptance: None, client_secret: None, @@ -527,7 +534,7 @@ pub async fn skip_locker_call_and_migrate_payment_method( created_at: current_time, last_modified: current_time, last_used_at: current_time, - payment_method_billing_address, + payment_method_billing_address: payment_method_billing_address.map(Into::into), updated_by: None, }, merchant_account.storage_scheme, @@ -591,9 +598,14 @@ pub async fn get_client_secret_or_add_payment_method( #[cfg(feature = "payouts")] let condition = req.card.is_some() || req.bank_transfer.is_some() || req.wallet.is_some(); - let payment_method_billing_address = create_encrypted_data(key_store, req.billing.clone()) + let payment_method_billing_address: Option<Encryptable<Secret<serde_json::Value>>> = req + .billing + .clone() + .async_map(|billing| create_encrypted_data(key_store, billing)) .await - .map(|details| details.into()); + .transpose() + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("Unable to encrypt Payment method billing address")?; let connector_mandate_details = req .connector_mandate_details @@ -622,7 +634,7 @@ pub async fn get_client_secret_or_add_payment_method( Some(enums::PaymentMethodStatus::AwaitingData), None, merchant_account.storage_scheme, - payment_method_billing_address, + payment_method_billing_address.map(Into::into), None, ) .await?; @@ -793,13 +805,17 @@ pub async fn add_payment_method_data( saved_to_locker: true, }; - let updated_pmd = Some(PaymentMethodsData::Card(updated_card)); - let pm_data_encrypted = create_encrypted_data(&key_store, updated_pmd) + let pm_data_encrypted: Encryptable<Secret<serde_json::Value>> = + create_encrypted_data( + &key_store, + PaymentMethodsData::Card(updated_card), + ) .await - .map(|details| details.into()); + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("Unable to encrypt payment method data")?; let pm_update = storage::PaymentMethodUpdate::AdditionalDataUpdate { - payment_method_data: pm_data_encrypted, + payment_method_data: Some(pm_data_encrypted.into()), status: Some(enums::PaymentMethodStatus::Active), locker_id: Some(locker_id), payment_method: req.payment_method, @@ -870,9 +886,14 @@ pub async fn add_payment_method( let merchant_id = &merchant_account.merchant_id; let customer_id = req.customer_id.clone().get_required_value("customer_id")?; let payment_method = req.payment_method.get_required_value("payment_method")?; - let payment_method_billing_address = create_encrypted_data(key_store, req.billing.clone()) + let payment_method_billing_address: Option<Encryptable<Secret<serde_json::Value>>> = req + .billing + .clone() + .async_map(|billing| create_encrypted_data(key_store, billing)) .await - .map(|details| details.into()); + .transpose() + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("Unable to encrypt Payment method billing address")?; let connector_mandate_details = req .connector_mandate_details @@ -1041,12 +1062,16 @@ pub async fn add_payment_method( let updated_pmd = updated_card.as_ref().map(|card| { PaymentMethodsData::Card(CardDetailsPaymentMethod::from(card.clone())) }); - let pm_data_encrypted = create_encrypted_data(key_store, updated_pmd) - .await - .map(|details| details.into()); + let pm_data_encrypted: Option<Encryptable<Secret<serde_json::Value>>> = + updated_pmd + .async_map(|updated_pmd| create_encrypted_data(key_store, updated_pmd)) + .await + .transpose() + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("Unable to encrypt payment method data")?; let pm_update = storage::PaymentMethodUpdate::PaymentMethodDataUpdate { - payment_method_data: pm_data_encrypted, + payment_method_data: pm_data_encrypted.map(Into::into), }; db.update_payment_method( @@ -1086,7 +1111,7 @@ pub async fn add_payment_method( connector_mandate_details, req.network_transaction_id.clone(), merchant_account.storage_scheme, - payment_method_billing_address, + payment_method_billing_address.map(Into::into), ) .await?; @@ -1117,9 +1142,14 @@ pub async fn insert_payment_method( .card .clone() .map(|card| PaymentMethodsData::Card(CardDetailsPaymentMethod::from(card.clone()))); - let pm_data_encrypted = create_encrypted_data(key_store, pm_card_details) + + let pm_data_encrypted: Option<Encryptable<Secret<serde_json::Value>>> = pm_card_details + .clone() + .async_map(|pm_card| create_encrypted_data(key_store, pm_card)) .await - .map(|details| details.into()); + .transpose() + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("Unable to encrypt payment method data")?; create_payment_method( db, @@ -1130,7 +1160,7 @@ pub async fn insert_payment_method( merchant_id, pm_metadata, customer_acceptance, - pm_data_encrypted, + pm_data_encrypted.map(Into::into), key_store, connector_mandate_details, None, @@ -1307,12 +1337,16 @@ pub async fn update_customer_payment_method( let updated_pmd = updated_card .as_ref() .map(|card| PaymentMethodsData::Card(CardDetailsPaymentMethod::from(card.clone()))); - let pm_data_encrypted = create_encrypted_data(&key_store, updated_pmd) + + let pm_data_encrypted: Option<Encryptable<Secret<serde_json::Value>>> = updated_pmd + .async_map(|updated_pmd| create_encrypted_data(&key_store, updated_pmd)) .await - .map(|details| details.into()); + .transpose() + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("Unable to encrypt payment method data")?; let pm_update = storage::PaymentMethodUpdate::PaymentMethodDataUpdate { - payment_method_data: pm_data_encrypted, + payment_method_data: pm_data_encrypted.map(Into::into), }; add_card_resp @@ -1436,7 +1470,7 @@ pub async fn add_bank_to_locker( let secret: Secret<String> = Secret::new(v.to_string()); secret }) - .async_lift(|inner| encrypt_optional(inner, key)) + .async_lift(|inner| domain::types::encrypt_optional(inner, key)) .await } .await @@ -4563,31 +4597,25 @@ pub async fn delete_payment_method( pub async fn create_encrypted_data<T>( key_store: &domain::MerchantKeyStore, - data: Option<T>, -) -> Option<Encryptable<Secret<serde_json::Value>>> + data: T, +) -> Result<Encryptable<Secret<serde_json::Value>>, error_stack::Report<errors::StorageError>> where T: Debug + serde::Serialize, { let key = key_store.key.get_inner().peek(); - data.as_ref() - .map(Encode::encode_to_value) - .transpose() + let encoded_data = Encode::encode_to_value(&data) .change_context(errors::StorageError::SerializationFailed) - .attach_printable("Unable to convert data to a value") - .unwrap_or_else(|error| { - logger::error!(?error); - None - }) - .map(Secret::<_, masking::WithType>::new) - .async_lift(|inner| encrypt_optional(inner, key)) + .attach_printable("Unable to encode data")?; + + let secret_data = Secret::<_, masking::WithType>::new(encoded_data); + + let encrypted_data = domain::types::encrypt(secret_data, key) .await .change_context(errors::StorageError::EncryptionError) - .attach_printable("Unable to encrypt data") - .unwrap_or_else(|error| { - logger::error!(?error); - None - }) + .attach_printable("Unable to encrypt data")?; + + Ok(encrypted_data) } pub async fn list_countries_currencies_for_connector_payment_method( diff --git a/crates/router/src/core/payments/helpers.rs b/crates/router/src/core/payments/helpers.rs index 8183a01fcac..4249955c24f 100644 --- a/crates/router/src/core/payments/helpers.rs +++ b/crates/router/src/core/payments/helpers.rs @@ -1612,8 +1612,11 @@ pub async fn create_customer_if_not_exist<'a, F: Clone, R>( payment_data.payment_intent.customer_details = raw_customer_details .clone() - .async_and_then(|_| async { create_encrypted_data(key_store, raw_customer_details).await }) - .await; + .async_map(|customer_details| create_encrypted_data(key_store, customer_details)) + .await + .transpose() + .change_context(errors::StorageError::EncryptionError) + .attach_printable("Unable to encrypt customer details")?; let customer_id = request_customer_details .customer_id diff --git a/crates/router/src/core/payments/operations/payment_confirm.rs b/crates/router/src/core/payments/operations/payment_confirm.rs index 771ee137474..3af3bc52190 100644 --- a/crates/router/src/core/payments/operations/payment_confirm.rs +++ b/crates/router/src/core/payments/operations/payment_confirm.rs @@ -1222,12 +1222,20 @@ impl<F: Clone> UpdateTracker<F, PaymentData<F>, api::PaymentsRequest> for Paymen let billing_address = payment_data.address.get_payment_billing(); let billing_details = billing_address - .async_and_then(|_| async { create_encrypted_data(key_store, billing_address).await }) - .await; + .async_map(|billing_details| create_encrypted_data(key_store, billing_details)) + .await + .transpose() + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("Unable to encrypt billing details")?; + let shipping_address = payment_data.address.get_shipping(); let shipping_details = shipping_address - .async_and_then(|_| async { create_encrypted_data(key_store, shipping_address).await }) - .await; + .async_map(|shipping_details| create_encrypted_data(key_store, shipping_details)) + .await + .transpose() + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("Unable to encrypt shipping details")?; + let m_payment_data_payment_intent = payment_data.payment_intent.clone(); let m_customer_id = customer_id.clone(); let m_shipping_address_id = shipping_address_id.clone(); diff --git a/crates/router/src/core/payments/operations/payment_create.rs b/crates/router/src/core/payments/operations/payment_create.rs index 4e0bbec9f17..b7076d07826 100644 --- a/crates/router/src/core/payments/operations/payment_create.rs +++ b/crates/router/src/core/payments/operations/payment_create.rs @@ -642,10 +642,11 @@ impl<F: Clone> UpdateTracker<F, PaymentData<F>, api::PaymentsRequest> for Paymen // details are provided in Payment Create Request let customer_details = raw_customer_details .clone() - .async_and_then(|_| async { - create_encrypted_data(key_store, raw_customer_details).await - }) - .await; + .async_map(|customer_details| create_encrypted_data(key_store, customer_details)) + .await + .transpose() + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("Unable to encrypt customer details")?; payment_data.payment_intent = state .store @@ -1047,20 +1048,22 @@ impl PaymentCreate { let billing_details = request .billing .clone() - .async_and_then(|_| async { - create_encrypted_data(key_store, request.billing.clone()).await - }) - .await; + .async_map(|billing_details| create_encrypted_data(key_store, billing_details)) + .await + .transpose() + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("Unable to encrypt billing details")?; // Derivation of directly supplied Shipping Address data in our Payment Create Request // Encrypting our Shipping Address Details to be stored in Payment Intent let shipping_details = request .shipping .clone() - .async_and_then(|_| async { - create_encrypted_data(key_store, request.shipping.clone()).await - }) - .await; + .async_map(|shipping_details| create_encrypted_data(key_store, shipping_details)) + .await + .transpose() + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("Unable to encrypt shipping details")?; // Derivation of directly supplied Customer data in our Payment Create Request let raw_customer_details = if request.get_customer_id().is_none() @@ -1080,11 +1083,12 @@ impl PaymentCreate { }; // Encrypting our Customer Details to be stored in Payment Intent - let customer_details = if raw_customer_details.is_some() { - create_encrypted_data(key_store, raw_customer_details).await - } else { - None - }; + let customer_details = raw_customer_details + .async_map(|customer_details| create_encrypted_data(key_store, customer_details)) + .await + .transpose() + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("Unable to encrypt customer details")?; Ok(storage::PaymentIntent { payment_id: payment_id.to_string(), diff --git a/crates/router/src/core/payments/operations/payment_update.rs b/crates/router/src/core/payments/operations/payment_update.rs index 8af5a86d7c3..98006e574ca 100644 --- a/crates/router/src/core/payments/operations/payment_update.rs +++ b/crates/router/src/core/payments/operations/payment_update.rs @@ -715,22 +715,21 @@ impl<F: Clone> UpdateTracker<F, PaymentData<F>, api::PaymentsRequest> for Paymen let billing_details = payment_data .address .get_payment_billing() - .async_and_then(|_| async { - create_encrypted_data( - key_store, - payment_data.address.get_payment_billing().cloned(), - ) - .await - }) - .await; + .async_map(|billing_details| create_encrypted_data(key_store, billing_details)) + .await + .transpose() + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("Unable to encrypt billing details")?; let shipping_details = payment_data .address .get_shipping() - .async_and_then(|_| async { - create_encrypted_data(key_store, payment_data.address.get_shipping().cloned()).await - }) - .await; + .async_map(|shipping_details| create_encrypted_data(key_store, shipping_details)) + .await + .transpose() + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("Unable to encrypt shipping details")?; + let order_details = payment_data.payment_intent.order_details.clone(); let metadata = payment_data.payment_intent.metadata.clone(); let frm_metadata = payment_data.payment_intent.frm_metadata.clone(); diff --git a/crates/router/src/core/payments/tokenization.rs b/crates/router/src/core/payments/tokenization.rs index 3fb67abd57e..b77bdb7515e 100644 --- a/crates/router/src/core/payments/tokenization.rs +++ b/crates/router/src/core/payments/tokenization.rs @@ -3,11 +3,12 @@ use std::collections::HashMap; use api_models::payment_methods::PaymentMethodsData; use common_enums::PaymentMethod; use common_utils::{ - ext_traits::{Encode, ValueExt}, + crypto::Encryptable, + ext_traits::{AsyncExt, Encode, ValueExt}, id_type, pii, }; use error_stack::{report, ResultExt}; -use masking::{ExposeInterface, PeekInterface}; +use masking::{ExposeInterface, PeekInterface, Secret}; use router_env::{instrument, metrics::add_attributes, tracing}; use super::helpers; @@ -15,7 +16,9 @@ use crate::{ consts, core::{ errors::{self, ConnectorErrorExt, RouterResult, StorageErrorExt}, - mandate, payment_methods, payments, + mandate, + payment_methods::{self, cards::create_encrypted_data}, + payments, }, logger, routes::{metrics, SessionState}, @@ -64,7 +67,7 @@ pub async fn save_payment_method<FData>( key_store: &domain::MerchantKeyStore, amount: Option<i64>, currency: Option<storage_enums::Currency>, - billing_name: Option<masking::Secret<String>>, + billing_name: Option<Secret<String>>, payment_method_billing_address: Option<&api::Address>, business_profile: &storage::business_profile::BusinessProfile, ) -> RouterResult<(Option<String>, Option<common_enums::PaymentMethodStatus>)> @@ -209,18 +212,22 @@ where PaymentMethodsData::Card(CardDetailsPaymentMethod::from(card.clone())) }); - let pm_data_encrypted = - payment_methods::cards::create_encrypted_data(key_store, pm_card_details) + let pm_data_encrypted: Option<Encryptable<Secret<serde_json::Value>>> = + pm_card_details + .async_map(|pm_card| create_encrypted_data(key_store, pm_card)) .await - .map(|details| details.into()); - - let encrypted_payment_method_billing_address = - payment_methods::cards::create_encrypted_data( - key_store, - payment_method_billing_address, - ) + .transpose() + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("Unable to encrypt payment method data")?; + + let encrypted_payment_method_billing_address: Option< + Encryptable<Secret<serde_json::Value>>, + > = payment_method_billing_address + .async_map(|address| create_encrypted_data(key_store, address.clone())) .await - .map(|details| details.into()); + .transpose() + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("Unable to encrypt payment method billing address")?; let mut payment_method_id = resp.payment_method_id.clone(); let mut locker_id = None; @@ -311,13 +318,14 @@ where merchant_id, pm_metadata, customer_acceptance, - pm_data_encrypted, + pm_data_encrypted.map(Into::into), key_store, connector_mandate_details, None, network_transaction_id, merchant_account.storage_scheme, - encrypted_payment_method_billing_address, + encrypted_payment_method_billing_address + .map(Into::into), resp.card.and_then(|card| { card.card_network .map(|card_network| card_network.to_string()) @@ -411,7 +419,8 @@ where connector_mandate_details, network_transaction_id, merchant_account.storage_scheme, - encrypted_payment_method_billing_address, + encrypted_payment_method_billing_address + .map(Into::into), ) .await } else { @@ -506,18 +515,19 @@ where card.clone(), )) }); - let pm_data_encrypted = - payment_methods::cards::create_encrypted_data( - key_store, - updated_pmd, - ) + let pm_data_encrypted: Option< + Encryptable<Secret<serde_json::Value>>, + > = updated_pmd + .async_map(|pmd| create_encrypted_data(key_store, pmd)) .await - .map(|details| details.into()); + .transpose() + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("Unable to encrypt payment method data")?; payment_methods::cards::update_payment_method_and_last_used( db, existing_pm, - pm_data_encrypted, + pm_data_encrypted.map(Into::into), merchant_account.storage_scheme, ) .await @@ -599,13 +609,13 @@ where merchant_id, pm_metadata, customer_acceptance, - pm_data_encrypted, + pm_data_encrypted.map(Into::into), key_store, connector_mandate_details, None, network_transaction_id, merchant_account.storage_scheme, - encrypted_payment_method_billing_address, + encrypted_payment_method_billing_address.map(Into::into), resp.card.and_then(|card| { card.card_network .map(|card_network| card_network.to_string()) @@ -877,9 +887,9 @@ pub fn update_router_data_with_payment_method_token_result<F: Clone, T>( match payment_method_token_result.payment_method_token_result { Ok(pm_token_result) => { router_data.payment_method_token = pm_token_result.map(|pm_token| { - hyperswitch_domain_models::router_data::PaymentMethodToken::Token( - masking::Secret::new(pm_token), - ) + hyperswitch_domain_models::router_data::PaymentMethodToken::Token(Secret::new( + pm_token, + )) }); true diff --git a/crates/router/src/core/payouts/helpers.rs b/crates/router/src/core/payouts/helpers.rs index fcd4f4aeeb4..2b71fedb2a3 100644 --- a/crates/router/src/core/payouts/helpers.rs +++ b/crates/router/src/core/payouts/helpers.rs @@ -452,9 +452,12 @@ pub async fn save_payout_data_to_locker( ) }); ( - cards::create_encrypted_data(key_store, Some(pm_data)) - .await - .map(|details| details.into()), + Some( + cards::create_encrypted_data(key_store, pm_data) + .await + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("Unable to encrypt customer details")?, + ), payment_method, ) } else { @@ -494,7 +497,7 @@ pub async fn save_payout_data_to_locker( &merchant_account.merchant_id, None, None, - card_details_encrypted.clone(), + card_details_encrypted.clone().map(Into::into), key_store, None, None, @@ -557,7 +560,7 @@ pub async fn save_payout_data_to_locker( // Update card's metadata in payment_methods table let pm_update = storage::PaymentMethodUpdate::PaymentMethodDataUpdate { - payment_method_data: card_details_encrypted, + payment_method_data: card_details_encrypted.map(Into::into), }; db.update_payment_method(existing_pm, pm_update, merchant_account.storage_scheme) .await diff --git a/crates/router/src/core/pm_auth.rs b/crates/router/src/core/pm_auth.rs index b3d228ced63..2a9dc1a4e9e 100644 --- a/crates/router/src/core/pm_auth.rs +++ b/crates/router/src/core/pm_auth.rs @@ -432,13 +432,13 @@ async fn store_bank_details_in_payment_methods( ); let payment_method_data = payment_methods::PaymentMethodsData::BankDetails(pmd); - let encrypted_data = - cards::create_encrypted_data(&key_store, Some(payment_method_data)) - .await - .map(|details| details.into()) - .ok_or(ApiErrorResponse::InternalServerError)?; + let encrypted_data = cards::create_encrypted_data(&key_store, payment_method_data) + .await + .change_context(ApiErrorResponse::InternalServerError) + .attach_printable("Unable to encrypt customer details")?; + let pm_update = storage::PaymentMethodUpdate::PaymentMethodDataUpdate { - payment_method_data: Some(encrypted_data), + payment_method_data: Some(encrypted_data.into()), }; update_entries.push((pm.clone(), pm_update)); @@ -447,8 +447,8 @@ async fn store_bank_details_in_payment_methods( let encrypted_data = cards::create_encrypted_data(&key_store, Some(payment_method_data)) .await - .map(|details| details.into()) - .ok_or(ApiErrorResponse::InternalServerError)?; + .change_context(ApiErrorResponse::InternalServerError) + .attach_printable("Unable to encrypt customer details")?; let pm_id = generate_id(consts::ID_LENGTH, "pm"); let now = common_utils::date_time::now(); let pm_new = storage::PaymentMethodNew { @@ -461,7 +461,7 @@ async fn store_bank_details_in_payment_methods( payment_method_issuer: None, scheme: None, metadata: None, - payment_method_data: Some(encrypted_data), + payment_method_data: Some(encrypted_data.into()), payment_method_issuer_code: None, accepted_currency: None, token: None,
chore
making of function create_encrypted_data (#5251)
4ccd25d0dc0703f9ac9ff441bedc8a9ce4ce78c6
2024-06-26 15:18:23
Mani Chandra
feat(email): Add `auth_id` in email types and send `auth_id` in email URLs (#5120)
false
diff --git a/config/config.example.toml b/config/config.example.toml index f29876e648b..10f8ba7a5e7 100644 --- a/config/config.example.toml +++ b/config/config.example.toml @@ -346,7 +346,6 @@ wildcard_origin = false # If true, allows any origin to make req [email] sender_email = "[email protected]" # Sender email aws_region = "" # AWS region used by AWS SES -base_url = "" # Base url used when adding links that should redirect to self allowed_unverified_days = 1 # Number of days the api calls ( with jwt token ) can be made without verifying the email active_email_client = "SES" # The currently active email client @@ -359,6 +358,7 @@ sts_role_session_name = "" # An identifier for the assumed role session, used to password_validity_in_days = 90 # Number of days after which password should be updated two_factor_auth_expiry_in_secs = 300 # Number of seconds after which 2FA should be done again if doing update/change from inside totp_issuer_name = "Hyperswitch" # Name of the issuer for TOTP +base_url = "" # Base url used for user specific redirects and emails #tokenization configuration which describe token lifetime and payment method for specific connector [tokenization] diff --git a/config/deployments/env_specific.toml b/config/deployments/env_specific.toml index 652b4950316..68df3d28e24 100644 --- a/config/deployments/env_specific.toml +++ b/config/deployments/env_specific.toml @@ -58,7 +58,6 @@ wildcard_origin = false # If true, allows any origin to make req [email] sender_email = "[email protected]" # Sender email aws_region = "" # AWS region used by AWS SES -base_url = "" # Dashboard base url used when adding links that should redirect to self, say https://app.hyperswitch.io for example allowed_unverified_days = 1 # Number of days the api calls ( with jwt token ) can be made without verifying the email active_email_client = "SES" # The currently active email client diff --git a/config/deployments/integration_test.toml b/config/deployments/integration_test.toml index f5f69568da6..b75062c9340 100644 --- a/config/deployments/integration_test.toml +++ b/config/deployments/integration_test.toml @@ -118,6 +118,7 @@ slack_invite_url = "https://join.slack.com/t/hyperswitch-io/shared_invite/zt-2aw password_validity_in_days = 90 two_factor_auth_expiry_in_secs = 300 totp_issuer_name = "Hyperswitch Integ" +base_url = "https://integ.hyperswitch.io" [frm] enabled = true diff --git a/config/deployments/production.toml b/config/deployments/production.toml index bbaf22067b5..98008212fc0 100644 --- a/config/deployments/production.toml +++ b/config/deployments/production.toml @@ -125,6 +125,7 @@ slack_invite_url = "https://join.slack.com/t/hyperswitch-io/shared_invite/zt-2aw password_validity_in_days = 90 two_factor_auth_expiry_in_secs = 300 totp_issuer_name = "Hyperswitch Production" +base_url = "https://live.hyperswitch.io" [frm] enabled = false diff --git a/config/deployments/sandbox.toml b/config/deployments/sandbox.toml index de274ad9411..040986f7948 100644 --- a/config/deployments/sandbox.toml +++ b/config/deployments/sandbox.toml @@ -125,6 +125,7 @@ slack_invite_url = "https://join.slack.com/t/hyperswitch-io/shared_invite/zt-2aw password_validity_in_days = 90 two_factor_auth_expiry_in_secs = 300 totp_issuer_name = "Hyperswitch Sandbox" +base_url = "https://app.hyperswitch.io" [frm] enabled = true diff --git a/config/development.toml b/config/development.toml index 4e230cd2025..ecece79a696 100644 --- a/config/development.toml +++ b/config/development.toml @@ -264,7 +264,6 @@ wildcard_origin = true [email] sender_email = "[email protected]" aws_region = "" -base_url = "http://localhost:8080" allowed_unverified_days = 1 active_email_client = "SES" @@ -276,6 +275,7 @@ sts_role_session_name = "" password_validity_in_days = 90 two_factor_auth_expiry_in_secs = 300 totp_issuer_name = "Hyperswitch Dev" +base_url = "http://localhost:8080" [bank_config.eps] stripe = { banks = "arzte_und_apotheker_bank,austrian_anadi_bank_ag,bank_austria,bankhaus_carl_spangler,bankhaus_schelhammer_und_schattera_ag,bawag_psk_ag,bks_bank_ag,brull_kallmus_bank_ag,btv_vier_lander_bank,capital_bank_grawe_gruppe_ag,dolomitenbank,easybank_ag,erste_bank_und_sparkassen,hypo_alpeadriabank_international_ag,hypo_noe_lb_fur_niederosterreich_u_wien,hypo_oberosterreich_salzburg_steiermark,hypo_tirol_bank_ag,hypo_vorarlberg_bank_ag,hypo_bank_burgenland_aktiengesellschaft,marchfelder_bank,oberbank_ag,raiffeisen_bankengruppe_osterreich,schoellerbank_ag,sparda_bank_wien,volksbank_gruppe,volkskreditbank_ag,vr_bank_braunau" } diff --git a/config/docker_compose.toml b/config/docker_compose.toml index 791f2510824..643893c7cb2 100644 --- a/config/docker_compose.toml +++ b/config/docker_compose.toml @@ -56,6 +56,7 @@ recon_admin_api_key = "recon_test_admin" password_validity_in_days = 90 two_factor_auth_expiry_in_secs = 300 totp_issuer_name = "Hyperswitch" +base_url = "http://localhost:8080" [locker] host = "" diff --git a/crates/api_models/src/user.rs b/crates/api_models/src/user.rs index 6d567e7dca1..0006afea0d9 100644 --- a/crates/api_models/src/user.rs +++ b/crates/api_models/src/user.rs @@ -355,3 +355,8 @@ pub struct AuthMethodDetails { pub auth_type: common_enums::UserAuthType, pub name: Option<OpenIdProvider>, } + +#[derive(Debug, serde::Deserialize, serde::Serialize)] +pub struct AuthIdQueryParam { + pub auth_id: Option<String>, +} diff --git a/crates/external_services/src/email.rs b/crates/external_services/src/email.rs index 07552cb519f..fc577a012c3 100644 --- a/crates/external_services/src/email.rs +++ b/crates/external_services/src/email.rs @@ -126,9 +126,6 @@ pub struct EmailSettings { /// The AWS region to send SES requests to. pub aws_region: String, - /// Base-url used when adding links that should redirect to self - pub base_url: String, - /// Number of days for verification of the email pub allowed_unverified_days: i64, diff --git a/crates/router/src/configs/settings.rs b/crates/router/src/configs/settings.rs index 80756391741..0569c4dbed6 100644 --- a/crates/router/src/configs/settings.rs +++ b/crates/router/src/configs/settings.rs @@ -484,6 +484,7 @@ pub struct UserSettings { pub password_validity_in_days: u16, pub two_factor_auth_expiry_in_secs: i64, pub totp_issuer_name: String, + pub base_url: String, } #[derive(Debug, Deserialize, Clone)] diff --git a/crates/router/src/core/user.rs b/crates/router/src/core/user.rs index 505cee0c4ac..0fd583143cc 100644 --- a/crates/router/src/core/user.rs +++ b/crates/router/src/core/user.rs @@ -39,6 +39,7 @@ pub mod sample_data; pub async fn signup_with_merchant_id( state: SessionState, request: user_api::SignUpWithMerchantIdRequest, + auth_id: Option<String>, ) -> UserResponse<user_api::SignUpWithMerchantIdResponse> { let new_user = domain::NewUser::try_from(request.clone())?; new_user @@ -64,6 +65,7 @@ pub async fn signup_with_merchant_id( user_name: domain::UserName::new(user_from_db.get_name())?, settings: state.conf.clone(), subject: "Get back to Hyperswitch - Reset Your Password Now", + auth_id, }; let send_email_result = state @@ -241,6 +243,7 @@ pub async fn signin_token_only_flow( pub async fn connect_account( state: SessionState, request: user_api::ConnectAccountRequest, + auth_id: Option<String>, ) -> UserResponse<user_api::ConnectAccountResponse> { let find_user = state.global_store.find_user_by_email(&request.email).await; @@ -253,6 +256,7 @@ pub async fn connect_account( settings: state.conf.clone(), user_name: domain::UserName::new(user_from_db.get_name())?, subject: "Unlock Hyperswitch: Use Your Magic Link to Sign In", + auth_id, }; let send_email_result = state @@ -303,6 +307,7 @@ pub async fn connect_account( recipient_email: domain::UserEmail::from_pii_email(user_from_db.get_email())?, settings: state.conf.clone(), subject: "Welcome to the Hyperswitch community!", + auth_id, }; let send_email_result = state @@ -401,6 +406,7 @@ pub async fn change_password( pub async fn forgot_password( state: SessionState, request: user_api::ForgotPasswordRequest, + auth_id: Option<String>, ) -> UserResponse<()> { let user_email = domain::UserEmail::from_pii_email(request.email)?; @@ -422,6 +428,7 @@ pub async fn forgot_password( settings: state.conf.clone(), user_name: domain::UserName::new(user_from_db.get_name())?, subject: "Get back to Hyperswitch - Reset Your Password Now", + auth_id, }; state @@ -596,6 +603,7 @@ pub async fn invite_multiple_user( requests: Vec<user_api::InviteUserRequest>, req_state: ReqState, is_token_only: Option<bool>, + auth_id: Option<String>, ) -> UserResponse<Vec<InviteMultipleUserResponse>> { if requests.len() > 10 { return Err(report!(UserErrors::MaxInvitationsError)) @@ -603,7 +611,15 @@ pub async fn invite_multiple_user( } let responses = futures::future::join_all(requests.iter().map(|request| async { - match handle_invitation(&state, &user_from_token, request, &req_state, is_token_only).await + match handle_invitation( + &state, + &user_from_token, + request, + &req_state, + is_token_only, + &auth_id, + ) + .await { Ok(response) => response, Err(error) => InviteMultipleUserResponse { @@ -625,6 +641,7 @@ async fn handle_invitation( request: &user_api::InviteUserRequest, req_state: &ReqState, is_token_only: Option<bool>, + auth_id: &Option<String>, ) -> UserResult<InviteMultipleUserResponse> { let inviter_user = user_from_token.get_user_from_db(state).await?; @@ -656,7 +673,14 @@ async fn handle_invitation( .await; if let Ok(invitee_user) = invitee_user { - handle_existing_user_invitation(state, user_from_token, request, invitee_user.into()).await + handle_existing_user_invitation( + state, + user_from_token, + request, + invitee_user.into(), + auth_id, + ) + .await } else if invitee_user .as_ref() .map_err(|e| e.current_context().is_db_not_found()) @@ -669,6 +693,7 @@ async fn handle_invitation( request, req_state.clone(), is_token_only, + auth_id, ) .await } else { @@ -676,12 +701,13 @@ async fn handle_invitation( } } -//TODO: send email +#[allow(unused_variables)] async fn handle_existing_user_invitation( state: &SessionState, user_from_token: &auth::UserFromToken, request: &user_api::InviteUserRequest, invitee_user_from_db: domain::UserFromStorage, + auth_id: &Option<String>, ) -> UserResult<InviteMultipleUserResponse> { let now = common_utils::date_time::now(); state @@ -722,6 +748,7 @@ async fn handle_existing_user_invitation( settings: state.conf.clone(), subject: "You have been invited to join Hyperswitch Community!", merchant_id: user_from_token.merchant_id.clone(), + auth_id: auth_id.clone(), }; is_email_sent = state @@ -748,12 +775,14 @@ async fn handle_existing_user_invitation( }) } +#[allow(unused_variables)] async fn handle_new_user_invitation( state: &SessionState, user_from_token: &auth::UserFromToken, request: &user_api::InviteUserRequest, req_state: ReqState, is_token_only: Option<bool>, + auth_id: &Option<String>, ) -> UserResult<InviteMultipleUserResponse> { let new_user = domain::NewUser::try_from((request.clone(), user_from_token.clone()))?; @@ -809,6 +838,7 @@ async fn handle_new_user_invitation( settings: state.conf.clone(), subject: "You have been invited to join Hyperswitch Community!", merchant_id: user_from_token.merchant_id.clone(), + auth_id: auth_id.clone(), }) } else { Box::new(email_types::InviteUser { @@ -817,6 +847,7 @@ async fn handle_new_user_invitation( settings: state.conf.clone(), subject: "You have been invited to join Hyperswitch Community!", merchant_id: user_from_token.merchant_id.clone(), + auth_id: auth_id.clone(), }) }; let send_email_result = state @@ -862,7 +893,7 @@ pub async fn resend_invite( state: SessionState, user_from_token: auth::UserFromToken, request: user_api::ReInviteUserRequest, - _req_state: ReqState, + auth_id: Option<String>, ) -> UserResponse<()> { let invitee_email = domain::UserEmail::from_pii_email(request.email)?; let user: domain::UserFromStorage = state @@ -906,6 +937,7 @@ pub async fn resend_invite( settings: state.conf.clone(), subject: "You have been invited to join Hyperswitch Community!", merchant_id: user_from_token.merchant_id, + auth_id, }; state .email_client @@ -1518,6 +1550,7 @@ pub async fn verify_email_token_only_flow( pub async fn send_verification_mail( state: SessionState, req: user_api::SendVerifyEmailRequest, + auth_id: Option<String>, ) -> UserResponse<()> { let user_email = domain::UserEmail::try_from(req.email)?; let user = state @@ -1540,6 +1573,7 @@ pub async fn send_verification_mail( recipient_email: domain::UserEmail::from_pii_email(user.email)?, settings: state.conf.clone(), subject: "Welcome to the Hyperswitch community!", + auth_id, }; state diff --git a/crates/router/src/routes/user.rs b/crates/router/src/routes/user.rs index f297e41e4e0..816e7f7e2f8 100644 --- a/crates/router/src/routes/user.rs +++ b/crates/router/src/routes/user.rs @@ -39,15 +39,19 @@ pub async fn user_signup_with_merchant_id( state: web::Data<AppState>, http_req: HttpRequest, json_payload: web::Json<user_api::SignUpWithMerchantIdRequest>, + query: web::Query<user_api::AuthIdQueryParam>, ) -> HttpResponse { let flow = Flow::UserSignUpWithMerchantId; let req_payload = json_payload.into_inner(); + let auth_id = query.into_inner().auth_id; Box::pin(api::server_wrap( flow.clone(), state, &http_req, req_payload.clone(), - |state, _, req_body, _| user_core::signup_with_merchant_id(state, req_body), + |state, _, req_body, _| { + user_core::signup_with_merchant_id(state, req_body, auth_id.clone()) + }, &auth::AdminApiAuth, api_locking::LockAction::NotApplicable, )) @@ -113,15 +117,17 @@ pub async fn user_connect_account( state: web::Data<AppState>, http_req: HttpRequest, json_payload: web::Json<user_api::ConnectAccountRequest>, + query: web::Query<user_api::AuthIdQueryParam>, ) -> HttpResponse { let flow = Flow::UserConnectAccount; let req_payload = json_payload.into_inner(); + let auth_id = query.into_inner().auth_id; Box::pin(api::server_wrap( flow.clone(), state, &http_req, req_payload.clone(), - |state, _, req_body, _| user_core::connect_account(state, req_body), + |state, _, req_body, _| user_core::connect_account(state, req_body, auth_id.clone()), &auth::NoAuth, api_locking::LockAction::NotApplicable, )) @@ -382,14 +388,16 @@ pub async fn forgot_password( state: web::Data<AppState>, req: HttpRequest, payload: web::Json<user_api::ForgotPasswordRequest>, + query: web::Query<user_api::AuthIdQueryParam>, ) -> HttpResponse { let flow = Flow::ForgotPassword; + let auth_id = query.into_inner().auth_id; Box::pin(api::server_wrap( flow, state.clone(), &req, payload.into_inner(), - |state, _, payload, _| user_core::forgot_password(state, payload), + |state, _, payload, _| user_core::forgot_password(state, payload, auth_id.clone()), &auth::NoAuth, api_locking::LockAction::NotApplicable, )) @@ -431,21 +439,31 @@ pub async fn reset_password( .await } } + pub async fn invite_multiple_user( state: web::Data<AppState>, req: HttpRequest, payload: web::Json<Vec<user_api::InviteUserRequest>>, - query: web::Query<user_api::TokenOnlyQueryParam>, + token_only_query_param: web::Query<user_api::TokenOnlyQueryParam>, + auth_id_query_param: web::Query<user_api::AuthIdQueryParam>, ) -> HttpResponse { let flow = Flow::InviteMultipleUser; - let is_token_only = query.into_inner().token_only; + let is_token_only = token_only_query_param.into_inner().token_only; + let auth_id = auth_id_query_param.into_inner().auth_id; Box::pin(api::server_wrap( flow, state.clone(), &req, payload.into_inner(), |state, user, payload, req_state| { - user_core::invite_multiple_user(state, user, payload, req_state, is_token_only) + user_core::invite_multiple_user( + state, + user, + payload, + req_state, + is_token_only, + auth_id.clone(), + ) }, &auth::JWTAuth(Permission::UsersWrite), api_locking::LockAction::NotApplicable, @@ -458,14 +476,18 @@ pub async fn resend_invite( state: web::Data<AppState>, req: HttpRequest, payload: web::Json<user_api::ReInviteUserRequest>, + query: web::Query<user_api::AuthIdQueryParam>, ) -> HttpResponse { let flow = Flow::ReInviteUser; + let auth_id = query.into_inner().auth_id; Box::pin(api::server_wrap( flow, state.clone(), &req, payload.into_inner(), - user_core::resend_invite, + |state, user, req_payload, _| { + user_core::resend_invite(state, user, req_payload, auth_id.clone()) + }, &auth::JWTAuth(Permission::UsersWrite), api_locking::LockAction::NotApplicable, )) @@ -551,14 +573,16 @@ pub async fn verify_email_request( state: web::Data<AppState>, http_req: HttpRequest, json_payload: web::Json<user_api::SendVerifyEmailRequest>, + query: web::Query<user_api::AuthIdQueryParam>, ) -> HttpResponse { let flow = Flow::VerifyEmailRequest; + let auth_id = query.into_inner().auth_id; Box::pin(api::server_wrap( flow, state.clone(), &http_req, json_payload.into_inner(), - |state, _, req_body, _| user_core::send_verification_mail(state, req_body), + |state, _, req_body, _| user_core::send_verification_mail(state, req_body, auth_id.clone()), &auth::NoAuth, api_locking::LockAction::NotApplicable, )) diff --git a/crates/router/src/services/email/types.rs b/crates/router/src/services/email/types.rs index 878cd87ea23..1d4e77ff68a 100644 --- a/crates/router/src/services/email/types.rs +++ b/crates/router/src/services/email/types.rs @@ -190,14 +190,21 @@ pub fn get_link_with_token( base_url: impl std::fmt::Display, token: impl std::fmt::Display, action: impl std::fmt::Display, + auth_id: &Option<impl std::fmt::Display>, ) -> String { - format!("{base_url}/user/{action}?token={token}") + let email_url = format!("{base_url}/user/{action}?token={token}"); + if let Some(auth_id) = auth_id { + format!("{email_url}&auth_id={auth_id}") + } else { + email_url + } } pub struct VerifyEmail { pub recipient_email: domain::UserEmail, pub settings: std::sync::Arc<configs::Settings>, pub subject: &'static str, + pub auth_id: Option<String>, } /// Currently only HTML is supported @@ -213,8 +220,12 @@ impl EmailData for VerifyEmail { .await .change_context(EmailError::TokenGenerationFailure)?; - let verify_email_link = - get_link_with_token(&self.settings.email.base_url, token, "verify_email"); + let verify_email_link = get_link_with_token( + &self.settings.user.base_url, + token, + "verify_email", + &self.auth_id, + ); let body = html::get_html_body(EmailBody::Verify { link: verify_email_link, @@ -233,6 +244,7 @@ pub struct ResetPassword { pub user_name: domain::UserName, pub settings: std::sync::Arc<configs::Settings>, pub subject: &'static str, + pub auth_id: Option<String>, } #[async_trait::async_trait] @@ -247,8 +259,12 @@ impl EmailData for ResetPassword { .await .change_context(EmailError::TokenGenerationFailure)?; - let reset_password_link = - get_link_with_token(&self.settings.email.base_url, token, "set_password"); + let reset_password_link = get_link_with_token( + &self.settings.user.base_url, + token, + "set_password", + &self.auth_id, + ); let body = html::get_html_body(EmailBody::Reset { link: reset_password_link, @@ -268,6 +284,7 @@ pub struct MagicLink { pub user_name: domain::UserName, pub settings: std::sync::Arc<configs::Settings>, pub subject: &'static str, + pub auth_id: Option<String>, } #[async_trait::async_trait] @@ -282,8 +299,12 @@ impl EmailData for MagicLink { .await .change_context(EmailError::TokenGenerationFailure)?; - let magic_link_login = - get_link_with_token(&self.settings.email.base_url, token, "verify_email"); + let magic_link_login = get_link_with_token( + &self.settings.user.base_url, + token, + "verify_email", + &self.auth_id, + ); let body = html::get_html_body(EmailBody::MagicLink { link: magic_link_login, @@ -305,6 +326,7 @@ pub struct InviteUser { pub settings: std::sync::Arc<configs::Settings>, pub subject: &'static str, pub merchant_id: String, + pub auth_id: Option<String>, } #[async_trait::async_trait] @@ -319,8 +341,12 @@ impl EmailData for InviteUser { .await .change_context(EmailError::TokenGenerationFailure)?; - let invite_user_link = - get_link_with_token(&self.settings.email.base_url, token, "set_password"); + let invite_user_link = get_link_with_token( + &self.settings.user.base_url, + token, + "set_password", + &self.auth_id, + ); let body = html::get_html_body(EmailBody::InviteUser { link: invite_user_link, @@ -341,6 +367,7 @@ pub struct InviteRegisteredUser { pub settings: std::sync::Arc<configs::Settings>, pub subject: &'static str, pub merchant_id: String, + pub auth_id: Option<String>, } #[async_trait::async_trait] @@ -356,9 +383,10 @@ impl EmailData for InviteRegisteredUser { .change_context(EmailError::TokenGenerationFailure)?; let invite_user_link = get_link_with_token( - &self.settings.email.base_url, + &self.settings.user.base_url, token, "accept_invite_from_email", + &self.auth_id, ); let body = html::get_html_body(EmailBody::AcceptInviteFromEmail { link: invite_user_link,
feat
Add `auth_id` in email types and send `auth_id` in email URLs (#5120)
f96a87d08ca003411d63dcd9ef4dda6439d20e07
2024-12-10 16:49:17
Riddhiagrawal001
refactor(users): remove lineage checks in roles get operations (#6701)
false
diff --git a/crates/diesel_models/src/query/role.rs b/crates/diesel_models/src/query/role.rs index 065a5b6e114..6f6a1404ee2 100644 --- a/crates/diesel_models/src/query/role.rs +++ b/crates/diesel_models/src/query/role.rs @@ -26,6 +26,7 @@ impl Role { .await } + // TODO: Remove once find_by_role_id_in_lineage is stable pub async fn find_by_role_id_in_merchant_scope( conn: &PgPooledConn, role_id: &str, @@ -43,7 +44,27 @@ impl Role { .await } - pub async fn find_by_role_id_in_org_scope( + pub async fn find_by_role_id_in_lineage( + conn: &PgPooledConn, + role_id: &str, + merchant_id: &id_type::MerchantId, + org_id: &id_type::OrganizationId, + ) -> StorageResult<Self> { + generics::generic_find_one::<<Self as HasTable>::Table, _, _>( + conn, + dsl::role_id + .eq(role_id.to_owned()) + .and(dsl::org_id.eq(org_id.to_owned())) + .and( + dsl::scope.eq(RoleScope::Organization).or(dsl::merchant_id + .eq(merchant_id.to_owned()) + .and(dsl::scope.eq(RoleScope::Merchant))), + ), + ) + .await + } + + pub async fn find_by_role_id_and_org_id( conn: &PgPooledConn, role_id: &str, org_id: &id_type::OrganizationId, @@ -88,9 +109,11 @@ impl Role { merchant_id: &id_type::MerchantId, org_id: &id_type::OrganizationId, ) -> StorageResult<Vec<Self>> { - let predicate = dsl::merchant_id.eq(merchant_id.to_owned()).or(dsl::org_id - .eq(org_id.to_owned()) - .and(dsl::scope.eq(RoleScope::Organization))); + let predicate = dsl::org_id.eq(org_id.to_owned()).and( + dsl::scope.eq(RoleScope::Organization).or(dsl::merchant_id + .eq(merchant_id.to_owned()) + .and(dsl::scope.eq(RoleScope::Merchant))), + ); generics::generic_filter::<<Self as HasTable>::Table, _, _, _>( conn, @@ -115,9 +138,10 @@ impl Role { if let Some(merchant_id) = merchant_id { query = query.filter( - dsl::merchant_id + (dsl::merchant_id .eq(merchant_id) - .or(dsl::scope.eq(RoleScope::Organization)), + .and(dsl::scope.eq(RoleScope::Merchant))) + .or(dsl::scope.eq(RoleScope::Organization)), ); } diff --git a/crates/diesel_models/src/user_role.rs b/crates/diesel_models/src/user_role.rs index 04f3264b45e..08449685b29 100644 --- a/crates/diesel_models/src/user_role.rs +++ b/crates/diesel_models/src/user_role.rs @@ -29,16 +29,19 @@ pub struct UserRole { impl UserRole { pub fn get_entity_id_and_type(&self) -> Option<(String, EntityType)> { - match (self.version, self.role_id.as_str()) { - (enums::UserRoleVersion::V1, consts::ROLE_ID_ORGANIZATION_ADMIN) => { + match (self.version, self.entity_type, self.role_id.as_str()) { + (enums::UserRoleVersion::V1, None, consts::ROLE_ID_ORGANIZATION_ADMIN) => { let org_id = self.org_id.clone()?.get_string_repr().to_string(); Some((org_id, EntityType::Organization)) } - (enums::UserRoleVersion::V1, _) => { + (enums::UserRoleVersion::V1, None, _) => { let merchant_id = self.merchant_id.clone()?.get_string_repr().to_string(); Some((merchant_id, EntityType::Merchant)) } - (enums::UserRoleVersion::V2, _) => self.entity_id.clone().zip(self.entity_type), + (enums::UserRoleVersion::V1, Some(_), _) => { + self.entity_id.clone().zip(self.entity_type) + } + (enums::UserRoleVersion::V2, _, _) => self.entity_id.clone().zip(self.entity_type), } } } diff --git a/crates/router/src/analytics.rs b/crates/router/src/analytics.rs index 752c3a52284..ff2744b824e 100644 --- a/crates/router/src/analytics.rs +++ b/crates/router/src/analytics.rs @@ -1847,15 +1847,10 @@ pub mod routes { json_payload.into_inner(), |state, auth: UserFromToken, req, _| async move { let role_id = auth.role_id; - let role_info = RoleInfo::from_role_id_in_merchant_scope( - &state, - &role_id, - &auth.merchant_id, - &auth.org_id, - ) - .await - .change_context(UserErrors::InternalServerError) - .change_context(OpenSearchError::UnknownError)?; + let role_info = RoleInfo::from_role_id_and_org_id(&state, &role_id, &auth.org_id) + .await + .change_context(UserErrors::InternalServerError) + .change_context(OpenSearchError::UnknownError)?; let permission_groups = role_info.get_permission_groups(); if !permission_groups.contains(&common_enums::PermissionGroup::OperationsView) { return Err(OpenSearchError::AccessForbiddenError)?; @@ -1887,7 +1882,7 @@ pub mod routes { let role_id = user_role.role_id.clone(); let org_id = user_role.org_id.clone().unwrap_or_default(); async move { - RoleInfo::from_role_id_in_org_scope(&state, &role_id, &org_id) + RoleInfo::from_role_id_and_org_id(&state, &role_id, &org_id) .await .change_context(UserErrors::InternalServerError) .change_context(OpenSearchError::UnknownError) @@ -1974,15 +1969,10 @@ pub mod routes { indexed_req, |state, auth: UserFromToken, req, _| async move { let role_id = auth.role_id; - let role_info = RoleInfo::from_role_id_in_merchant_scope( - &state, - &role_id, - &auth.merchant_id, - &auth.org_id, - ) - .await - .change_context(UserErrors::InternalServerError) - .change_context(OpenSearchError::UnknownError)?; + let role_info = RoleInfo::from_role_id_and_org_id(&state, &role_id, &auth.org_id) + .await + .change_context(UserErrors::InternalServerError) + .change_context(OpenSearchError::UnknownError)?; let permission_groups = role_info.get_permission_groups(); if !permission_groups.contains(&common_enums::PermissionGroup::OperationsView) { return Err(OpenSearchError::AccessForbiddenError)?; @@ -2013,7 +2003,7 @@ pub mod routes { let role_id = user_role.role_id.clone(); let org_id = user_role.org_id.clone().unwrap_or_default(); async move { - RoleInfo::from_role_id_in_org_scope(&state, &role_id, &org_id) + RoleInfo::from_role_id_and_org_id(&state, &role_id, &org_id) .await .change_context(UserErrors::InternalServerError) .change_context(OpenSearchError::UnknownError) diff --git a/crates/router/src/core/user.rs b/crates/router/src/core/user.rs index f99c44cf298..629476b2591 100644 --- a/crates/router/src/core/user.rs +++ b/crates/router/src/core/user.rs @@ -104,10 +104,9 @@ pub async fn get_user_details( ) -> UserResponse<user_api::GetUserDetailsResponse> { let user = user_from_token.get_user_from_db(&state).await?; let verification_days_left = utils::user::get_verification_days_left(&state, &user)?; - let role_info = roles::RoleInfo::from_role_id_in_merchant_scope( + let role_info = roles::RoleInfo::from_role_id_and_org_id( &state, &user_from_token.role_id, - &user_from_token.merchant_id, &user_from_token.org_id, ) .await @@ -553,7 +552,7 @@ async fn handle_invitation( .into()); } - let role_info = roles::RoleInfo::from_role_id_in_merchant_scope( + let role_info = roles::RoleInfo::from_role_id_in_lineage( state, &request.role_id, &user_from_token.merchant_id, @@ -1371,10 +1370,9 @@ pub async fn list_user_roles_details( .await .to_not_found_response(UserErrors::InvalidRoleOperation)?; - let requestor_role_info = roles::RoleInfo::from_role_id_in_merchant_scope( + let requestor_role_info = roles::RoleInfo::from_role_id_and_org_id( &state, &user_from_token.role_id, - &user_from_token.merchant_id, &user_from_token.org_id, ) .await @@ -1526,7 +1524,7 @@ pub async fn list_user_roles_details( .collect::<HashSet<_>>() .into_iter() .map(|role_id| async { - let role_info = roles::RoleInfo::from_role_id_in_org_scope( + let role_info = roles::RoleInfo::from_role_id_and_org_id( &state, &role_id, &user_from_token.org_id, @@ -2533,10 +2531,9 @@ pub async fn list_orgs_for_user( state: SessionState, user_from_token: auth::UserFromToken, ) -> UserResponse<Vec<user_api::ListOrgsForUserResponse>> { - let role_info = roles::RoleInfo::from_role_id_in_merchant_scope( + let role_info = roles::RoleInfo::from_role_id_and_org_id( &state, &user_from_token.role_id, - &user_from_token.merchant_id, &user_from_token.org_id, ) .await @@ -2611,10 +2608,9 @@ pub async fn list_merchants_for_user_in_org( state: SessionState, user_from_token: auth::UserFromToken, ) -> UserResponse<Vec<user_api::ListMerchantsForUserInOrgResponse>> { - let role_info = roles::RoleInfo::from_role_id_in_merchant_scope( + let role_info = roles::RoleInfo::from_role_id_and_org_id( &state, &user_from_token.role_id, - &user_from_token.merchant_id, &user_from_token.org_id, ) .await @@ -2687,10 +2683,9 @@ pub async fn list_profiles_for_user_in_org_and_merchant_account( state: SessionState, user_from_token: auth::UserFromToken, ) -> UserResponse<Vec<user_api::ListProfilesForUserInOrgAndMerchantAccountResponse>> { - let role_info = roles::RoleInfo::from_role_id_in_merchant_scope( + let role_info = roles::RoleInfo::from_role_id_and_org_id( &state, &user_from_token.role_id, - &user_from_token.merchant_id, &user_from_token.org_id, ) .await @@ -2780,10 +2775,9 @@ pub async fn switch_org_for_user( .into()); } - let role_info = roles::RoleInfo::from_role_id_in_merchant_scope( + let role_info = roles::RoleInfo::from_role_id_and_org_id( &state, &user_from_token.role_id, - &user_from_token.merchant_id, &user_from_token.org_id, ) .await @@ -2876,13 +2870,8 @@ pub async fn switch_org_for_user( ) .await?; - utils::user_role::set_role_permissions_in_cache_by_role_id_merchant_id_org_id( - &state, - &role_id, - &merchant_id, - &request.org_id, - ) - .await; + utils::user_role::set_role_info_in_cache_by_role_id_org_id(&state, &role_id, &request.org_id) + .await; let response = user_api::TokenResponse { token: token.clone(), @@ -2905,10 +2894,9 @@ pub async fn switch_merchant_for_user_in_org( } let key_manager_state = &(&state).into(); - let role_info = roles::RoleInfo::from_role_id_in_merchant_scope( + let role_info = roles::RoleInfo::from_role_id_and_org_id( &state, &user_from_token.role_id, - &user_from_token.merchant_id, &user_from_token.org_id, ) .await @@ -3065,13 +3053,7 @@ pub async fn switch_merchant_for_user_in_org( ) .await?; - utils::user_role::set_role_permissions_in_cache_by_role_id_merchant_id_org_id( - &state, - &role_id, - &merchant_id, - &org_id, - ) - .await; + utils::user_role::set_role_info_in_cache_by_role_id_org_id(&state, &role_id, &org_id).await; let response = user_api::TokenResponse { token: token.clone(), @@ -3094,10 +3076,9 @@ pub async fn switch_profile_for_user_in_org_and_merchant( } let key_manager_state = &(&state).into(); - let role_info = roles::RoleInfo::from_role_id_in_merchant_scope( + let role_info = roles::RoleInfo::from_role_id_and_org_id( &state, &user_from_token.role_id, - &user_from_token.merchant_id, &user_from_token.org_id, ) .await @@ -3175,10 +3156,9 @@ pub async fn switch_profile_for_user_in_org_and_merchant( ) .await?; - utils::user_role::set_role_permissions_in_cache_by_role_id_merchant_id_org_id( + utils::user_role::set_role_info_in_cache_by_role_id_org_id( &state, &role_id, - &user_from_token.merchant_id, &user_from_token.org_id, ) .await; diff --git a/crates/router/src/core/user_role.rs b/crates/router/src/core/user_role.rs index 31ec665b2ab..d8fdff0e623 100644 --- a/crates/router/src/core/user_role.rs +++ b/crates/router/src/core/user_role.rs @@ -83,10 +83,9 @@ pub async fn get_parent_group_info( state: SessionState, user_from_token: auth::UserFromToken, ) -> UserResponse<Vec<role_api::ParentGroupInfo>> { - let role_info = roles::RoleInfo::from_role_id_in_merchant_scope( + let role_info = roles::RoleInfo::from_role_id_and_org_id( &state, &user_from_token.role_id, - &user_from_token.merchant_id, &user_from_token.org_id, ) .await @@ -119,7 +118,7 @@ pub async fn update_user_role( req: user_role_api::UpdateUserRoleRequest, _req_state: ReqState, ) -> UserResponse<()> { - let role_info = roles::RoleInfo::from_role_id_in_merchant_scope( + let role_info = roles::RoleInfo::from_role_id_in_lineage( &state, &req.role_id, &user_from_token.merchant_id, @@ -144,10 +143,9 @@ pub async fn update_user_role( .attach_printable("User Changing their own role"); } - let updator_role = roles::RoleInfo::from_role_id_in_merchant_scope( + let updator_role = roles::RoleInfo::from_role_id_and_org_id( &state, &user_from_token.role_id, - &user_from_token.merchant_id, &user_from_token.org_id, ) .await @@ -181,10 +179,9 @@ pub async fn update_user_role( }; if let Some(user_role) = v2_user_role_to_be_updated { - let role_to_be_updated = roles::RoleInfo::from_role_id_in_merchant_scope( + let role_to_be_updated = roles::RoleInfo::from_role_id_and_org_id( &state, &user_role.role_id, - &user_from_token.merchant_id, &user_from_token.org_id, ) .await @@ -262,10 +259,9 @@ pub async fn update_user_role( }; if let Some(user_role) = v1_user_role_to_be_updated { - let role_to_be_updated = roles::RoleInfo::from_role_id_in_merchant_scope( + let role_to_be_updated = roles::RoleInfo::from_role_id_and_org_id( &state, &user_role.role_id, - &user_from_token.merchant_id, &user_from_token.org_id, ) .await @@ -489,10 +485,9 @@ pub async fn delete_user_role( .attach_printable("User deleting himself"); } - let deletion_requestor_role_info = roles::RoleInfo::from_role_id_in_merchant_scope( + let deletion_requestor_role_info = roles::RoleInfo::from_role_id_and_org_id( &state, &user_from_token.role_id, - &user_from_token.merchant_id, &user_from_token.org_id, ) .await @@ -527,7 +522,7 @@ pub async fn delete_user_role( }; if let Some(role_to_be_deleted) = user_role_v2 { - let target_role_info = roles::RoleInfo::from_role_id_in_merchant_scope( + let target_role_info = roles::RoleInfo::from_role_id_in_lineage( &state, &role_to_be_deleted.role_id, &user_from_token.merchant_id, @@ -597,7 +592,7 @@ pub async fn delete_user_role( }; if let Some(role_to_be_deleted) = user_role_v1 { - let target_role_info = roles::RoleInfo::from_role_id_in_merchant_scope( + let target_role_info = roles::RoleInfo::from_role_id_in_lineage( &state, &role_to_be_deleted.role_id, &user_from_token.merchant_id, @@ -685,10 +680,9 @@ pub async fn list_users_in_lineage( user_from_token: auth::UserFromToken, request: user_role_api::ListUsersInEntityRequest, ) -> UserResponse<Vec<user_role_api::ListUsersInEntityResponse>> { - let requestor_role_info = roles::RoleInfo::from_role_id_in_merchant_scope( + let requestor_role_info = roles::RoleInfo::from_role_id_and_org_id( &state, &user_from_token.role_id, - &user_from_token.merchant_id, &user_from_token.org_id, ) .await @@ -783,7 +777,7 @@ pub async fn list_users_in_lineage( let role_info_map = futures::future::try_join_all(user_roles_set.iter().map(|user_role| async { - roles::RoleInfo::from_role_id_in_org_scope( + roles::RoleInfo::from_role_id_and_org_id( &state, &user_role.role_id, &user_from_token.org_id, diff --git a/crates/router/src/core/user_role/role.rs b/crates/router/src/core/user_role/role.rs index 9f251f55bdf..714bf9fed3c 100644 --- a/crates/router/src/core/user_role/role.rs +++ b/crates/router/src/core/user_role/role.rs @@ -76,8 +76,10 @@ pub async fn create_role( ) .await?; + let user_role_info = user_from_token.get_role_info_from_db(&state).await?; + if matches!(req.role_scope, RoleScope::Organization) - && user_from_token.role_id != common_utils::consts::ROLE_ID_ORGANIZATION_ADMIN + && user_role_info.get_entity_type() != EntityType::Organization { return Err(report!(UserErrors::InvalidRoleOperation)) .attach_printable("Non org admin user creating org level role"); @@ -116,14 +118,10 @@ pub async fn get_role_with_groups( user_from_token: UserFromToken, role: role_api::GetRoleRequest, ) -> UserResponse<role_api::RoleInfoWithGroupsResponse> { - let role_info = roles::RoleInfo::from_role_id_in_merchant_scope( - &state, - &role.role_id, - &user_from_token.merchant_id, - &user_from_token.org_id, - ) - .await - .to_not_found_response(UserErrors::InvalidRoleId)?; + let role_info = + roles::RoleInfo::from_role_id_and_org_id(&state, &role.role_id, &user_from_token.org_id) + .await + .to_not_found_response(UserErrors::InvalidRoleId)?; if role_info.is_internal() { return Err(UserErrors::InvalidRoleId.into()); @@ -144,14 +142,10 @@ pub async fn get_parent_info_for_role( user_from_token: UserFromToken, role: role_api::GetRoleRequest, ) -> UserResponse<role_api::RoleInfoWithParents> { - let role_info = roles::RoleInfo::from_role_id_in_merchant_scope( - &state, - &role.role_id, - &user_from_token.merchant_id, - &user_from_token.org_id, - ) - .await - .to_not_found_response(UserErrors::InvalidRoleId)?; + let role_info = + roles::RoleInfo::from_role_id_and_org_id(&state, &role.role_id, &user_from_token.org_id) + .await + .to_not_found_response(UserErrors::InvalidRoleId)?; if role_info.is_internal() { return Err(UserErrors::InvalidRoleId.into()); @@ -207,7 +201,7 @@ pub async fn update_role( utils::user_role::validate_role_groups(groups)?; } - let role_info = roles::RoleInfo::from_role_id_in_merchant_scope( + let role_info = roles::RoleInfo::from_role_id_in_lineage( &state, role_id, &user_from_token.merchant_id, @@ -216,8 +210,10 @@ pub async fn update_role( .await .to_not_found_response(UserErrors::InvalidRoleOperation)?; + let user_role_info = user_from_token.get_role_info_from_db(&state).await?; + if matches!(role_info.get_scope(), RoleScope::Organization) - && user_from_token.role_id != common_utils::consts::ROLE_ID_ORGANIZATION_ADMIN + && user_role_info.get_entity_type() != EntityType::Organization { return Err(report!(UserErrors::InvalidRoleOperation)) .attach_printable("Non org admin user changing org level role"); diff --git a/crates/router/src/db/kafka_store.rs b/crates/router/src/db/kafka_store.rs index 47c9adafb71..2fd30a3610b 100644 --- a/crates/router/src/db/kafka_store.rs +++ b/crates/router/src/db/kafka_store.rs @@ -3521,6 +3521,7 @@ impl RoleInterface for KafkaStore { self.diesel_store.find_role_by_role_id(role_id).await } + //TODO:Remove once find_by_role_id_in_lineage is stable async fn find_role_by_role_id_in_merchant_scope( &self, role_id: &str, @@ -3532,13 +3533,24 @@ impl RoleInterface for KafkaStore { .await } - async fn find_role_by_role_id_in_org_scope( + async fn find_role_by_role_id_in_lineage( + &self, + role_id: &str, + merchant_id: &id_type::MerchantId, + org_id: &id_type::OrganizationId, + ) -> CustomResult<storage::Role, errors::StorageError> { + self.diesel_store + .find_role_by_role_id_in_lineage(role_id, merchant_id, org_id) + .await + } + + async fn find_by_role_id_and_org_id( &self, role_id: &str, org_id: &id_type::OrganizationId, ) -> CustomResult<storage::Role, errors::StorageError> { self.diesel_store - .find_role_by_role_id_in_org_scope(role_id, org_id) + .find_by_role_id_and_org_id(role_id, org_id) .await } diff --git a/crates/router/src/db/role.rs b/crates/router/src/db/role.rs index d13508356e5..877a4c54077 100644 --- a/crates/router/src/db/role.rs +++ b/crates/router/src/db/role.rs @@ -23,6 +23,7 @@ pub trait RoleInterface { role_id: &str, ) -> CustomResult<storage::Role, errors::StorageError>; + //TODO:Remove once find_by_role_id_in_lineage is stable async fn find_role_by_role_id_in_merchant_scope( &self, role_id: &str, @@ -30,7 +31,14 @@ pub trait RoleInterface { org_id: &id_type::OrganizationId, ) -> CustomResult<storage::Role, errors::StorageError>; - async fn find_role_by_role_id_in_org_scope( + async fn find_role_by_role_id_in_lineage( + &self, + role_id: &str, + merchant_id: &id_type::MerchantId, + org_id: &id_type::OrganizationId, + ) -> CustomResult<storage::Role, errors::StorageError>; + + async fn find_by_role_id_and_org_id( &self, role_id: &str, org_id: &id_type::OrganizationId, @@ -86,6 +94,7 @@ impl RoleInterface for Store { .map_err(|error| report!(errors::StorageError::from(error))) } + //TODO:Remove once find_by_role_id_in_lineage is stable #[instrument(skip_all)] async fn find_role_by_role_id_in_merchant_scope( &self, @@ -100,13 +109,26 @@ impl RoleInterface for Store { } #[instrument(skip_all)] - async fn find_role_by_role_id_in_org_scope( + async fn find_role_by_role_id_in_lineage( &self, role_id: &str, + merchant_id: &id_type::MerchantId, org_id: &id_type::OrganizationId, ) -> CustomResult<storage::Role, errors::StorageError> { let conn = connection::pg_connection_read(self).await?; - storage::Role::find_by_role_id_in_org_scope(&conn, role_id, org_id) + storage::Role::find_by_role_id_in_lineage(&conn, role_id, merchant_id, org_id) + .await + .map_err(|error| report!(errors::StorageError::from(error))) + } + + #[instrument(skip_all)] + async fn find_by_role_id_and_org_id( + &self, + role_id: &str, + org_id: &id_type::OrganizationId, + ) -> CustomResult<storage::Role, errors::StorageError> { + let conn = connection::pg_connection_read(self).await?; + storage::Role::find_by_role_id_and_org_id(&conn, role_id, org_id) .await .map_err(|error| report!(errors::StorageError::from(error))) } @@ -217,6 +239,7 @@ impl RoleInterface for MockDb { ) } + // TODO: Remove once find_by_role_id_in_lineage is stable async fn find_role_by_role_id_in_merchant_scope( &self, role_id: &str, @@ -241,7 +264,33 @@ impl RoleInterface for MockDb { ) } - async fn find_role_by_role_id_in_org_scope( + async fn find_role_by_role_id_in_lineage( + &self, + role_id: &str, + merchant_id: &id_type::MerchantId, + org_id: &id_type::OrganizationId, + ) -> CustomResult<storage::Role, errors::StorageError> { + let roles = self.roles.lock().await; + roles + .iter() + .find(|role| { + role.role_id == role_id + && role.org_id == *org_id + && ((role.scope == enums::RoleScope::Organization) + || (role.merchant_id == *merchant_id + && role.scope == enums::RoleScope::Merchant)) + }) + .cloned() + .ok_or( + errors::StorageError::ValueNotFound(format!( + "No role available in merchant scope for role_id = {role_id}, \ + merchant_id = {merchant_id:?} and org_id = {org_id:?}" + )) + .into(), + ) + } + + async fn find_by_role_id_and_org_id( &self, role_id: &str, org_id: &id_type::OrganizationId, diff --git a/crates/router/src/services/authorization.rs b/crates/router/src/services/authorization.rs index e0feaa5e817..2b7e8bd7340 100644 --- a/crates/router/src/services/authorization.rs +++ b/crates/router/src/services/authorization.rs @@ -33,8 +33,7 @@ where return Ok(role_info.clone()); } - let role_info = - get_role_info_from_db(state, &token.role_id, &token.merchant_id, &token.org_id).await?; + let role_info = get_role_info_from_db(state, &token.role_id, &token.org_id).await?; let token_expiry = i64::try_from(token.exp).change_context(ApiErrorResponse::InternalServerError)?; @@ -68,7 +67,6 @@ pub fn get_cache_key_from_role_id(role_id: &str) -> String { async fn get_role_info_from_db<A>( state: &A, role_id: &str, - merchant_id: &id_type::MerchantId, org_id: &id_type::OrganizationId, ) -> RouterResult<roles::RoleInfo> where @@ -76,7 +74,7 @@ where { state .store() - .find_role_by_role_id_in_merchant_scope(role_id, merchant_id, org_id) + .find_by_role_id_and_org_id(role_id, org_id) .await .map(roles::RoleInfo::from) .to_not_found_response(ApiErrorResponse::InvalidJwtToken) diff --git a/crates/router/src/services/authorization/roles.rs b/crates/router/src/services/authorization/roles.rs index a6c5cee1c4e..dcffa3107c9 100644 --- a/crates/router/src/services/authorization/roles.rs +++ b/crates/router/src/services/authorization/roles.rs @@ -116,7 +116,7 @@ impl RoleInfo { acl } - pub async fn from_role_id_in_merchant_scope( + pub async fn from_role_id_in_lineage( state: &SessionState, role_id: &str, merchant_id: &id_type::MerchantId, @@ -127,13 +127,13 @@ impl RoleInfo { } else { state .store - .find_role_by_role_id_in_merchant_scope(role_id, merchant_id, org_id) + .find_role_by_role_id_in_lineage(role_id, merchant_id, org_id) .await .map(Self::from) } } - pub async fn from_role_id_in_org_scope( + pub async fn from_role_id_and_org_id( state: &SessionState, role_id: &str, org_id: &id_type::OrganizationId, @@ -143,7 +143,7 @@ impl RoleInfo { } else { state .store - .find_role_by_role_id_in_org_scope(role_id, org_id) + .find_by_role_id_and_org_id(role_id, org_id) .await .map(Self::from) } diff --git a/crates/router/src/types/domain/user/decision_manager.rs b/crates/router/src/types/domain/user/decision_manager.rs index 519edf4e9ce..bf5556dd9a7 100644 --- a/crates/router/src/types/domain/user/decision_manager.rs +++ b/crates/router/src/types/domain/user/decision_manager.rs @@ -337,8 +337,7 @@ impl NextFlow { .change_context(UserErrors::InternalServerError)? .pop() .ok_or(UserErrors::InternalServerError)?; - utils::user_role::set_role_permissions_in_cache_by_user_role(state, &user_role) - .await; + utils::user_role::set_role_info_in_cache_by_user_role(state, &user_role).await; jwt_flow.generate_jwt(state, self, &user_role).await } @@ -357,8 +356,7 @@ impl NextFlow { { self.user.get_verification_days_left(state)?; } - utils::user_role::set_role_permissions_in_cache_by_user_role(state, user_role) - .await; + utils::user_role::set_role_info_in_cache_by_user_role(state, user_role).await; jwt_flow.generate_jwt(state, self, user_role).await } diff --git a/crates/router/src/utils/user.rs b/crates/router/src/utils/user.rs index 9886705ec66..abd59684243 100644 --- a/crates/router/src/utils/user.rs +++ b/crates/router/src/utils/user.rs @@ -77,14 +77,9 @@ impl UserFromToken { } pub async fn get_role_info_from_db(&self, state: &SessionState) -> UserResult<RoleInfo> { - RoleInfo::from_role_id_in_merchant_scope( - state, - &self.role_id, - &self.merchant_id, - &self.org_id, - ) - .await - .change_context(UserErrors::InternalServerError) + RoleInfo::from_role_id_and_org_id(state, &self.role_id, &self.org_id) + .await + .change_context(UserErrors::InternalServerError) } } diff --git a/crates/router/src/utils/user_role.rs b/crates/router/src/utils/user_role.rs index 3412219d0e9..b8f93bff943 100644 --- a/crates/router/src/utils/user_role.rs +++ b/crates/router/src/utils/user_role.rs @@ -71,55 +71,43 @@ pub async fn validate_role_name( Ok(()) } -pub async fn set_role_permissions_in_cache_by_user_role( +pub async fn set_role_info_in_cache_by_user_role( state: &SessionState, user_role: &UserRole, ) -> bool { - let Some(ref merchant_id) = user_role.merchant_id else { - return false; - }; - let Some(ref org_id) = user_role.org_id else { return false; }; - set_role_permissions_in_cache_if_required( - state, - user_role.role_id.as_str(), - merchant_id, - org_id, - ) - .await - .map_err(|e| logger::error!("Error setting permissions in cache {:?}", e)) - .is_ok() + set_role_info_in_cache_if_required(state, user_role.role_id.as_str(), org_id) + .await + .map_err(|e| logger::error!("Error setting permissions in cache {:?}", e)) + .is_ok() } -pub async fn set_role_permissions_in_cache_by_role_id_merchant_id_org_id( +pub async fn set_role_info_in_cache_by_role_id_org_id( state: &SessionState, role_id: &str, - merchant_id: &id_type::MerchantId, org_id: &id_type::OrganizationId, ) -> bool { - set_role_permissions_in_cache_if_required(state, role_id, merchant_id, org_id) + set_role_info_in_cache_if_required(state, role_id, org_id) .await .map_err(|e| logger::error!("Error setting permissions in cache {:?}", e)) .is_ok() } -pub async fn set_role_permissions_in_cache_if_required( +pub async fn set_role_info_in_cache_if_required( state: &SessionState, role_id: &str, - merchant_id: &id_type::MerchantId, org_id: &id_type::OrganizationId, ) -> UserResult<()> { if roles::predefined_roles::PREDEFINED_ROLES.contains_key(role_id) { return Ok(()); } - let role_info = - roles::RoleInfo::from_role_id_in_merchant_scope(state, role_id, merchant_id, org_id) - .await - .change_context(UserErrors::InternalServerError) - .attach_printable("Error getting role_info from role_id")?; + let role_info = roles::RoleInfo::from_role_id_and_org_id(state, role_id, org_id) + .await + .change_context(UserErrors::InternalServerError) + .attach_printable("Error getting role_info from role_id")?; authz::set_role_info_in_cache( state, diff --git a/migrations/2024-12-02-110129_update-user-role-entity-type/down.sql b/migrations/2024-12-02-110129_update-user-role-entity-type/down.sql new file mode 100644 index 00000000000..c7c9cbeb401 --- /dev/null +++ b/migrations/2024-12-02-110129_update-user-role-entity-type/down.sql @@ -0,0 +1,2 @@ +-- This file should undo anything in `up.sql` +SELECT 1; \ No newline at end of file diff --git a/migrations/2024-12-02-110129_update-user-role-entity-type/up.sql b/migrations/2024-12-02-110129_update-user-role-entity-type/up.sql new file mode 100644 index 00000000000..f2759f030d5 --- /dev/null +++ b/migrations/2024-12-02-110129_update-user-role-entity-type/up.sql @@ -0,0 +1,10 @@ +-- Your SQL goes here +UPDATE user_roles +SET + entity_type = CASE + WHEN role_id = 'org_admin' THEN 'organization' + ELSE 'merchant' + END +WHERE + version = 'v1' + AND entity_type IS NULL; \ No newline at end of file
refactor
remove lineage checks in roles get operations (#6701)
19c502398f980d20b9e0a4fe98c33a2239c90c5b
2024-03-05 18:56:09
Mani Chandra
feat(roles): Add caching for custom roles (#3946)
false
diff --git a/crates/api_models/src/user.rs b/crates/api_models/src/user.rs index 8f77f72aad5..1641c0ae536 100644 --- a/crates/api_models/src/user.rs +++ b/crates/api_models/src/user.rs @@ -128,8 +128,6 @@ pub struct SwitchMerchantIdRequest { pub merchant_id: String, } -pub type SwitchMerchantResponse = DashboardEntryResponse; - #[derive(serde::Deserialize, Debug, serde::Serialize)] pub struct CreateInternalUserRequest { pub name: Secret<String>, diff --git a/crates/api_models/src/user_role.rs b/crates/api_models/src/user_role.rs index 80d3861969a..411bf823a22 100644 --- a/crates/api_models/src/user_role.rs +++ b/crates/api_models/src/user_role.rs @@ -1,8 +1,6 @@ use common_enums::PermissionGroup; use common_utils::pii; -use crate::user::DashboardEntryResponse; - pub mod role; #[derive(Debug, serde::Serialize)] @@ -99,8 +97,6 @@ pub struct AcceptInvitationRequest { pub need_dashboard_entry_response: Option<bool>, } -pub type AcceptInvitationResponse = DashboardEntryResponse; - #[derive(Debug, serde::Deserialize, serde::Serialize)] pub struct DeleteUserRoleRequest { pub email: pii::Email, diff --git a/crates/router/src/consts.rs b/crates/router/src/consts.rs index 72f160990e5..87a16b73a8b 100644 --- a/crates/router/src/consts.rs +++ b/crates/router/src/consts.rs @@ -78,6 +78,8 @@ pub const EMAIL_TOKEN_TIME_IN_SECS: u64 = 60 * 60 * 24; // 1 day #[cfg(feature = "email")] pub const EMAIL_TOKEN_BLACKLIST_PREFIX: &str = "BET_"; +pub const ROLE_CACHE_PREFIX: &str = "CR_"; + #[cfg(feature = "olap")] pub const VERIFY_CONNECTOR_ID_PREFIX: &str = "conn_verify"; #[cfg(feature = "olap")] diff --git a/crates/router/src/core/user.rs b/crates/router/src/core/user.rs index b8b8cbd24c7..fceee528057 100644 --- a/crates/router/src/core/user.rs +++ b/crates/router/src/core/user.rs @@ -94,6 +94,7 @@ pub async fn signup( ) .await?; let token = utils::user::generate_jwt_auth_token(&state, &user_from_db, &user_role).await?; + utils::user_role::set_role_permissions_in_cache_by_user_role(&state, &user_role).await; Ok(ApplicationResponse::Json( utils::user::get_dashboard_entry_response(&state, user_from_db, user_role, token)?, @@ -121,6 +122,7 @@ pub async fn signin_without_invite_checks( let user_role = user_from_db.get_role_from_db(state.clone()).await?; let token = utils::user::generate_jwt_auth_token(&state, &user_from_db, &user_role).await?; + utils::user_role::set_role_permissions_in_cache_by_user_role(&state, &user_role).await; Ok(ApplicationResponse::Json( utils::user::get_dashboard_entry_response(&state, user_from_db, user_role, token)?, @@ -966,6 +968,8 @@ pub async fn accept_invite_from_email( let token = utils::user::generate_jwt_auth_token(&state, &user_from_db, &update_status_result).await?; + utils::user_role::set_role_permissions_in_cache_by_user_role(&state, &update_status_result) + .await; Ok(ApplicationResponse::Json( utils::user::get_dashboard_entry_response( @@ -1044,7 +1048,7 @@ pub async fn switch_merchant_id( state: AppState, request: user_api::SwitchMerchantIdRequest, user_from_token: auth::UserFromToken, -) -> UserResponse<user_api::SwitchMerchantResponse> { +) -> UserResponse<user_api::DashboardEntryResponse> { if user_from_token.merchant_id == request.merchant_id { return Err(UserErrors::InvalidRoleOperationWithMessage( "User switching to same merchant id".to_string(), @@ -1093,13 +1097,14 @@ pub async fn switch_merchant_id( .organization_id; let token = utils::user::generate_jwt_auth_token_with_custom_role_attributes( - state, + &state, &user, request.merchant_id.clone(), - org_id, + org_id.clone(), user_from_token.role_id.clone(), ) .await?; + (token, user_from_token.role_id) } else { let user_roles = state @@ -1120,11 +1125,13 @@ pub async fn switch_merchant_id( .attach_printable("User doesn't have access to switch")?; let token = utils::user::generate_jwt_auth_token(&state, &user, user_role).await?; + utils::user_role::set_role_permissions_in_cache_by_user_role(&state, user_role).await; + (token, user_role.role_id.clone()) }; Ok(ApplicationResponse::Json( - user_api::SwitchMerchantResponse { + user_api::DashboardEntryResponse { token, name: user.get_name(), email: user.get_email(), @@ -1266,6 +1273,7 @@ pub async fn verify_email_without_invite_checks( .await .map_err(|e| logger::error!(?e)); let token = utils::user::generate_jwt_auth_token(&state, &user_from_db, &user_role).await?; + utils::user_role::set_role_permissions_in_cache_by_user_role(&state, &user_role).await; Ok(ApplicationResponse::Json( utils::user::get_dashboard_entry_response(&state, user_from_db, user_role, token)?, diff --git a/crates/router/src/core/user_role.rs b/crates/router/src/core/user_role.rs index 9dca9b43d96..b81b980c07a 100644 --- a/crates/router/src/core/user_role.rs +++ b/crates/router/src/core/user_role.rs @@ -159,6 +159,7 @@ pub async fn transfer_org_ownership( .to_not_found_response(UserErrors::InvalidRoleOperation)?; let token = utils::user::generate_jwt_auth_token(&state, &user_from_db, &user_role).await?; + utils::user_role::set_role_permissions_in_cache_by_user_role(&state, &user_role).await; Ok(ApplicationResponse::Json( utils::user::get_dashboard_entry_response(&state, user_from_db, user_role, token)?, @@ -169,7 +170,7 @@ pub async fn accept_invitation( state: AppState, user_token: auth::UserWithoutMerchantFromToken, req: user_role_api::AcceptInvitationRequest, -) -> UserResponse<user_role_api::AcceptInvitationResponse> { +) -> UserResponse<user_api::DashboardEntryResponse> { let user_role = futures::future::join_all(req.merchant_ids.iter().map(|merchant_id| async { state .store @@ -202,6 +203,8 @@ pub async fn accept_invitation( .into(); let token = utils::user::generate_jwt_auth_token(&state, &user_from_db, &user_role).await?; + utils::user_role::set_role_permissions_in_cache_by_user_role(&state, &user_role).await; + return Ok(ApplicationResponse::Json( utils::user::get_dashboard_entry_response(&state, user_from_db, user_role, token)?, )); diff --git a/crates/router/src/services/authentication/blacklist.rs b/crates/router/src/services/authentication/blacklist.rs index 346e563ee32..2ee8302be63 100644 --- a/crates/router/src/services/authentication/blacklist.rs +++ b/crates/router/src/services/authentication/blacklist.rs @@ -17,6 +17,7 @@ use crate::{ use crate::{ core::errors::{UserErrors, UserResult}, routes::AppState, + services::authorization as authz, }; #[cfg(feature = "olap")] @@ -47,10 +48,23 @@ pub async fn insert_role_in_blacklist(state: &AppState, role_id: &str) -> UserRe date_time::now_unix_timestamp(), expiry, ) + .await + .change_context(UserErrors::InternalServerError)?; + invalidate_role_cache(state, role_id) .await .change_context(UserErrors::InternalServerError) } +#[cfg(feature = "olap")] +async fn invalidate_role_cache(state: &AppState, role_id: &str) -> RouterResult<()> { + let redis_conn = get_redis_connection(state)?; + redis_conn + .delete_key(authz::get_cache_key_from_role_id(role_id).as_str()) + .await + .map(|_| ()) + .change_context(ApiErrorResponse::InternalServerError) +} + pub async fn check_user_in_blacklist<A: AppStateInfo>( state: &A, user_id: &str, diff --git a/crates/router/src/services/authorization.rs b/crates/router/src/services/authorization.rs index 2a516cc82d5..dc6d82d4e92 100644 --- a/crates/router/src/services/authorization.rs +++ b/crates/router/src/services/authorization.rs @@ -1,7 +1,13 @@ +use std::sync::Arc; + use common_enums::PermissionGroup; +use error_stack::{IntoReport, ResultExt}; +use redis_interface::RedisConnectionPool; +use router_env::logger; use super::authentication::AuthToken; use crate::{ + consts, core::errors::{ApiErrorResponse, RouterResult, StorageErrorExt}, routes::app::AppStateInfo, }; @@ -19,22 +25,95 @@ pub async fn get_permissions<A>( where A: AppStateInfo + Sync, { - if let Some(role_info) = roles::predefined_roles::PREDEFINED_ROLES.get(token.role_id.as_str()) { - Ok(get_permissions_from_groups( - role_info.get_permission_groups(), - )) - } else { - state - .store() - .find_role_by_role_id_in_merchant_scope( - &token.role_id, - &token.merchant_id, - &token.org_id, - ) - .await - .map(|role| get_permissions_from_groups(&role.groups)) - .to_not_found_response(ApiErrorResponse::InvalidJwtToken) + if let Some(permissions) = get_permissions_from_predefined_roles(&token.role_id) { + return Ok(permissions); + } + + if let Ok(permissions) = get_permissions_from_cache(state, &token.role_id) + .await + .map_err(|e| logger::error!("Failed to get permissions from cache {}", e)) + { + return Ok(permissions); } + + let permissions = + get_permissions_from_db(state, &token.role_id, &token.merchant_id, &token.org_id).await?; + + let token_expiry: i64 = token + .exp + .try_into() + .into_report() + .change_context(ApiErrorResponse::InternalServerError)?; + let cache_ttl = token_expiry - common_utils::date_time::now_unix_timestamp(); + + set_permissions_in_cache(state, &token.role_id, &permissions, cache_ttl) + .await + .map_err(|e| logger::error!("Failed to set permissions in cache {}", e)) + .ok(); + Ok(permissions) +} + +async fn get_permissions_from_cache<A>( + state: &A, + role_id: &str, +) -> RouterResult<Vec<permissions::Permission>> +where + A: AppStateInfo + Sync, +{ + let redis_conn = get_redis_connection(state)?; + + redis_conn + .get_and_deserialize_key(&get_cache_key_from_role_id(role_id), "Vec<Permission>") + .await + .change_context(ApiErrorResponse::InternalServerError) +} + +pub fn get_cache_key_from_role_id(role_id: &str) -> String { + format!("{}{}", consts::ROLE_CACHE_PREFIX, role_id) +} + +fn get_permissions_from_predefined_roles(role_id: &str) -> Option<Vec<permissions::Permission>> { + roles::predefined_roles::PREDEFINED_ROLES + .get(role_id) + .map(|role_info| get_permissions_from_groups(role_info.get_permission_groups())) +} + +async fn get_permissions_from_db<A>( + state: &A, + role_id: &str, + merchant_id: &str, + org_id: &str, +) -> RouterResult<Vec<permissions::Permission>> +where + A: AppStateInfo + Sync, +{ + state + .store() + .find_role_by_role_id_in_merchant_scope(role_id, merchant_id, org_id) + .await + .map(|role| get_permissions_from_groups(&role.groups)) + .to_not_found_response(ApiErrorResponse::InvalidJwtToken) +} + +pub async fn set_permissions_in_cache<A>( + state: &A, + role_id: &str, + permissions: &Vec<permissions::Permission>, + expiry: i64, +) -> RouterResult<()> +where + A: AppStateInfo + Sync, +{ + let redis_conn = get_redis_connection(state)?; + + redis_conn + .serialize_and_set_key_with_expiry( + &get_cache_key_from_role_id(role_id), + permissions, + expiry, + ) + .await + .change_context(ApiErrorResponse::InternalServerError) } pub fn get_permissions_from_groups(groups: &[PermissionGroup]) -> Vec<permissions::Permission> { @@ -62,3 +141,11 @@ pub fn check_authorization( .into(), ) } + +fn get_redis_connection<A: AppStateInfo>(state: &A) -> RouterResult<Arc<RedisConnectionPool>> { + state + .store() + .get_redis_conn() + .change_context(ApiErrorResponse::InternalServerError) + .attach_printable("Failed to get redis connection") +} diff --git a/crates/router/src/services/authorization/info.rs b/crates/router/src/services/authorization/info.rs index d6a20b7f8ed..7b82e84d64c 100644 --- a/crates/router/src/services/authorization/info.rs +++ b/crates/router/src/services/authorization/info.rs @@ -187,7 +187,7 @@ fn get_group_description(group: PermissionGroup) -> &'static str { "View Payments, Refunds, Mandates, Disputes and Customers" } PermissionGroup::OperationsManage => { - "Create,modify and delete Payments, Refunds, Mandates, Disputes and Customers" + "Create, modify and delete Payments, Refunds, Mandates, Disputes and Customers" } PermissionGroup::ConnectorsView => { "View connected Payment Processors, Payout Processors and Fraud & Risk Manager details" diff --git a/crates/router/src/services/authorization/permissions.rs b/crates/router/src/services/authorization/permissions.rs index 8d436618b32..edf9a40915c 100644 --- a/crates/router/src/services/authorization/permissions.rs +++ b/crates/router/src/services/authorization/permissions.rs @@ -1,6 +1,8 @@ use strum::Display; -#[derive(PartialEq, Display, Clone, Debug, Copy, Eq, Hash)] +#[derive( + PartialEq, Display, Clone, Debug, Copy, Eq, Hash, serde::Deserialize, serde::Serialize, +)] pub enum Permission { PaymentRead, PaymentWrite, diff --git a/crates/router/src/types/domain/user.rs b/crates/router/src/types/domain/user.rs index d6e878456e8..1850eb4b81a 100644 --- a/crates/router/src/types/domain/user.rs +++ b/crates/router/src/types/domain/user.rs @@ -861,8 +861,11 @@ impl SignInWithSingleRoleStrategy { async fn get_signin_response(self, state: &AppState) -> UserResult<user_api::SignInResponse> { let token = utils::user::generate_jwt_auth_token(state, &self.user, &self.user_role).await?; + utils::user_role::set_role_permissions_in_cache_by_user_role(state, &self.user_role).await; + let dashboard_entry_response = utils::user::get_dashboard_entry_response(state, self.user, self.user_role, token)?; + Ok(user_api::SignInResponse::DashboardEntry( dashboard_entry_response, )) diff --git a/crates/router/src/utils/user.rs b/crates/router/src/utils/user.rs index c3b795d1a57..cfab331f148 100644 --- a/crates/router/src/utils/user.rs +++ b/crates/router/src/utils/user.rs @@ -87,7 +87,7 @@ pub async fn generate_jwt_auth_token( } pub async fn generate_jwt_auth_token_with_custom_role_attributes( - state: AppState, + state: &AppState, user: &UserFromStorage, merchant_id: String, org_id: String, diff --git a/crates/router/src/utils/user_role.rs b/crates/router/src/utils/user_role.rs index bb83b82f2da..a0ac1400582 100644 --- a/crates/router/src/utils/user_role.rs +++ b/crates/router/src/utils/user_role.rs @@ -1,11 +1,14 @@ use api_models::user_role as user_role_api; use common_enums::PermissionGroup; -use error_stack::ResultExt; +use diesel_models::user_role::UserRole; +use error_stack::{IntoReport, ResultExt}; +use router_env::logger; use crate::{ + consts, core::errors::{UserErrors, UserResult}, routes::AppState, - services::authorization::{permissions::Permission, roles}, + services::authorization::{self as authz, permissions::Permission, roles}, types::domain, }; @@ -83,3 +86,47 @@ pub async fn validate_role_name( Ok(()) } + +pub async fn set_role_permissions_in_cache_by_user_role( + state: &AppState, + user_role: &UserRole, +) -> bool { + set_role_permissions_in_cache_if_required( + state, + user_role.role_id.as_str(), + user_role.merchant_id.as_str(), + user_role.org_id.as_str(), + ) + .await + .map_err(|e| logger::error!("Error setting permissions in cache {:?}", e)) + .is_ok() +} + +pub async fn set_role_permissions_in_cache_if_required( + state: &AppState, + role_id: &str, + merchant_id: &str, + org_id: &str, +) -> UserResult<()> { + if roles::predefined_roles::PREDEFINED_ROLES.contains_key(role_id) { + return Ok(()); + } + + let role_info = roles::RoleInfo::from_role_id(state, role_id, merchant_id, org_id) + .await + .change_context(UserErrors::InternalServerError) + .attach_printable("Error getting role_info from role_id")?; + + authz::set_permissions_in_cache( + state, + role_id, + &role_info.get_permissions_set().into_iter().collect(), + consts::JWT_TOKEN_TIME_IN_SECS + .try_into() + .into_report() + .change_context(UserErrors::InternalServerError)?, + ) + .await + .change_context(UserErrors::InternalServerError) + .attach_printable("Error setting permissions in redis") +}
feat
Add caching for custom roles (#3946)
862a1b5303ff304cca41d3553f652fd1091aab9b
2024-01-18 18:44:20
Mani Chandra
feat(users): Add `preferred_merchant_id` column and update user details API (#3373)
false
diff --git a/crates/api_models/src/events/user.rs b/crates/api_models/src/events/user.rs index c0743c8b8fc..40d082d1cad 100644 --- a/crates/api_models/src/events/user.rs +++ b/crates/api_models/src/events/user.rs @@ -13,7 +13,8 @@ use crate::user::{ AuthorizeResponse, ChangePasswordRequest, ConnectAccountRequest, CreateInternalUserRequest, DashboardEntryResponse, ForgotPasswordRequest, GetUsersResponse, InviteUserRequest, InviteUserResponse, ResetPasswordRequest, SendVerifyEmailRequest, SignUpRequest, - SignUpWithMerchantIdRequest, SwitchMerchantIdRequest, UserMerchantCreate, VerifyEmailRequest, + SignUpWithMerchantIdRequest, SwitchMerchantIdRequest, UpdateUserAccountDetailsRequest, + UserMerchantCreate, VerifyEmailRequest, }; impl ApiEventMetric for DashboardEntryResponse { @@ -54,7 +55,8 @@ common_utils::impl_misc_api_event_type!( InviteUserRequest, InviteUserResponse, VerifyEmailRequest, - SendVerifyEmailRequest + SendVerifyEmailRequest, + UpdateUserAccountDetailsRequest ); #[cfg(feature = "dummy_connector")] diff --git a/crates/api_models/src/user.rs b/crates/api_models/src/user.rs index a04c4fef660..8de6a3c0b4f 100644 --- a/crates/api_models/src/user.rs +++ b/crates/api_models/src/user.rs @@ -147,3 +147,9 @@ pub struct VerifyTokenResponse { pub merchant_id: String, pub user_email: pii::Email, } + +#[derive(Debug, serde::Deserialize, serde::Serialize)] +pub struct UpdateUserAccountDetailsRequest { + pub name: Option<Secret<String>>, + pub preferred_merchant_id: Option<String>, +} diff --git a/crates/diesel_models/src/query/user_role.rs b/crates/diesel_models/src/query/user_role.rs index d2f9564a530..6b408038ef5 100644 --- a/crates/diesel_models/src/query/user_role.rs +++ b/crates/diesel_models/src/query/user_role.rs @@ -19,6 +19,20 @@ impl UserRole { .await } + pub async fn find_by_user_id_merchant_id( + conn: &PgPooledConn, + user_id: String, + merchant_id: String, + ) -> StorageResult<Self> { + generics::generic_find_one::<<Self as HasTable>::Table, _, _>( + conn, + dsl::user_id + .eq(user_id) + .and(dsl::merchant_id.eq(merchant_id)), + ) + .await + } + pub async fn update_by_user_id_merchant_id( conn: &PgPooledConn, user_id: String, diff --git a/crates/diesel_models/src/schema.rs b/crates/diesel_models/src/schema.rs index 131d2b18266..c9887e1770f 100644 --- a/crates/diesel_models/src/schema.rs +++ b/crates/diesel_models/src/schema.rs @@ -1056,6 +1056,8 @@ diesel::table! { is_verified -> Bool, created_at -> Timestamp, last_modified_at -> Timestamp, + #[max_length = 64] + preferred_merchant_id -> Nullable<Varchar>, } } diff --git a/crates/diesel_models/src/user.rs b/crates/diesel_models/src/user.rs index c608f2654c6..84fe8710060 100644 --- a/crates/diesel_models/src/user.rs +++ b/crates/diesel_models/src/user.rs @@ -19,6 +19,7 @@ pub struct User { pub is_verified: bool, pub created_at: PrimitiveDateTime, pub last_modified_at: PrimitiveDateTime, + pub preferred_merchant_id: Option<String>, } #[derive( @@ -33,6 +34,7 @@ pub struct UserNew { pub is_verified: bool, pub created_at: Option<PrimitiveDateTime>, pub last_modified_at: Option<PrimitiveDateTime>, + pub preferred_merchant_id: Option<String>, } #[derive(Clone, Debug, AsChangeset, router_derive::DebugAsDisplay)] @@ -42,6 +44,7 @@ pub struct UserUpdateInternal { password: Option<Secret<String>>, is_verified: Option<bool>, last_modified_at: PrimitiveDateTime, + preferred_merchant_id: Option<String>, } #[derive(Debug)] @@ -51,6 +54,7 @@ pub enum UserUpdate { name: Option<String>, password: Option<Secret<String>>, is_verified: Option<bool>, + preferred_merchant_id: Option<String>, }, } @@ -63,16 +67,19 @@ impl From<UserUpdate> for UserUpdateInternal { password: None, is_verified: Some(true), last_modified_at, + preferred_merchant_id: None, }, UserUpdate::AccountUpdate { name, password, is_verified, + preferred_merchant_id, } => Self { name, password, is_verified, last_modified_at, + preferred_merchant_id, }, } } diff --git a/crates/router/src/core/user.rs b/crates/router/src/core/user.rs index 27a4f67618e..729cef65c20 100644 --- a/crates/router/src/core/user.rs +++ b/crates/router/src/core/user.rs @@ -253,6 +253,7 @@ pub async fn change_password( name: None, password: Some(new_password_hash), is_verified: None, + preferred_merchant_id: None, }, ) .await @@ -330,6 +331,7 @@ pub async fn reset_password( name: None, password: Some(hash_password), is_verified: Some(true), + preferred_merchant_id: None, }, ) .await @@ -786,3 +788,47 @@ pub async fn verify_token( user_email: user.email, })) } + +pub async fn update_user_details( + state: AppState, + user_token: auth::UserFromToken, + req: user_api::UpdateUserAccountDetailsRequest, +) -> UserResponse<()> { + let user: domain::UserFromStorage = state + .store + .find_user_by_id(&user_token.user_id) + .await + .change_context(UserErrors::InternalServerError)? + .into(); + + let name = req.name.map(domain::UserName::new).transpose()?; + + if let Some(ref preferred_merchant_id) = req.preferred_merchant_id { + let _ = state + .store + .find_user_role_by_user_id_merchant_id(user.get_user_id(), preferred_merchant_id) + .await + .map_err(|e| { + if e.current_context().is_db_not_found() { + e.change_context(UserErrors::MerchantIdNotFound) + } else { + e.change_context(UserErrors::InternalServerError) + } + })?; + } + + let user_update = storage_user::UserUpdate::AccountUpdate { + name: name.map(|x| x.get_secret().expose()), + password: None, + is_verified: None, + preferred_merchant_id: req.preferred_merchant_id, + }; + + state + .store + .update_user_by_user_id(user.get_user_id(), user_update) + .await + .change_context(UserErrors::InternalServerError)?; + + Ok(ApplicationResponse::StatusOk) +} diff --git a/crates/router/src/db/kafka_store.rs b/crates/router/src/db/kafka_store.rs index 19a83088a06..8398c153156 100644 --- a/crates/router/src/db/kafka_store.rs +++ b/crates/router/src/db/kafka_store.rs @@ -1927,12 +1927,24 @@ impl UserRoleInterface for KafkaStore { ) -> CustomResult<user_storage::UserRole, errors::StorageError> { self.diesel_store.insert_user_role(user_role).await } + async fn find_user_role_by_user_id( &self, user_id: &str, ) -> CustomResult<user_storage::UserRole, errors::StorageError> { self.diesel_store.find_user_role_by_user_id(user_id).await } + + async fn find_user_role_by_user_id_merchant_id( + &self, + user_id: &str, + merchant_id: &str, + ) -> CustomResult<user_storage::UserRole, errors::StorageError> { + self.diesel_store + .find_user_role_by_user_id_merchant_id(user_id, merchant_id) + .await + } + async fn update_user_role_by_user_id_merchant_id( &self, user_id: &str, @@ -1943,9 +1955,11 @@ impl UserRoleInterface for KafkaStore { .update_user_role_by_user_id_merchant_id(user_id, merchant_id, update) .await } + async fn delete_user_role(&self, user_id: &str) -> CustomResult<bool, errors::StorageError> { self.diesel_store.delete_user_role(user_id).await } + async fn list_user_roles_by_user_id( &self, user_id: &str, diff --git a/crates/router/src/db/user.rs b/crates/router/src/db/user.rs index e3dda965f9c..ecd71f7e2c9 100644 --- a/crates/router/src/db/user.rs +++ b/crates/router/src/db/user.rs @@ -145,6 +145,7 @@ impl UserInterface for MockDb { is_verified: user_data.is_verified, created_at: user_data.created_at.unwrap_or(time_now), last_modified_at: user_data.created_at.unwrap_or(time_now), + preferred_merchant_id: user_data.preferred_merchant_id, }; users.push(user.clone()); Ok(user) @@ -207,10 +208,14 @@ impl UserInterface for MockDb { name, password, is_verified, + preferred_merchant_id, } => storage::User { name: name.clone().map(Secret::new).unwrap_or(user.name.clone()), password: password.clone().unwrap_or(user.password.clone()), is_verified: is_verified.unwrap_or(user.is_verified), + preferred_merchant_id: preferred_merchant_id + .clone() + .or(user.preferred_merchant_id.clone()), ..user.to_owned() }, }; diff --git a/crates/router/src/db/user_role.rs b/crates/router/src/db/user_role.rs index bf84ae134ea..d8938f9683d 100644 --- a/crates/router/src/db/user_role.rs +++ b/crates/router/src/db/user_role.rs @@ -14,16 +14,25 @@ pub trait UserRoleInterface { &self, user_role: storage::UserRoleNew, ) -> CustomResult<storage::UserRole, errors::StorageError>; + async fn find_user_role_by_user_id( &self, user_id: &str, ) -> CustomResult<storage::UserRole, errors::StorageError>; + + async fn find_user_role_by_user_id_merchant_id( + &self, + user_id: &str, + merchant_id: &str, + ) -> CustomResult<storage::UserRole, errors::StorageError>; + async fn update_user_role_by_user_id_merchant_id( &self, user_id: &str, merchant_id: &str, update: storage::UserRoleUpdate, ) -> CustomResult<storage::UserRole, errors::StorageError>; + async fn delete_user_role(&self, user_id: &str) -> CustomResult<bool, errors::StorageError>; async fn list_user_roles_by_user_id( @@ -57,6 +66,22 @@ impl UserRoleInterface for Store { .into_report() } + async fn find_user_role_by_user_id_merchant_id( + &self, + user_id: &str, + merchant_id: &str, + ) -> CustomResult<storage::UserRole, errors::StorageError> { + let conn = connection::pg_connection_write(self).await?; + storage::UserRole::find_by_user_id_merchant_id( + &conn, + user_id.to_owned(), + merchant_id.to_owned(), + ) + .await + .map_err(Into::into) + .into_report() + } + async fn update_user_role_by_user_id_merchant_id( &self, user_id: &str, @@ -148,6 +173,24 @@ impl UserRoleInterface for MockDb { ) } + async fn find_user_role_by_user_id_merchant_id( + &self, + user_id: &str, + merchant_id: &str, + ) -> CustomResult<storage::UserRole, errors::StorageError> { + let user_roles = self.user_roles.lock().await; + user_roles + .iter() + .find(|user_role| user_role.user_id == user_id && user_role.merchant_id == merchant_id) + .cloned() + .ok_or( + errors::StorageError::ValueNotFound(format!( + "No user role available for user_id = {user_id} and merchant_id = {merchant_id}" + )) + .into(), + ) + } + async fn update_user_role_by_user_id_merchant_id( &self, user_id: &str, diff --git a/crates/router/src/routes/app.rs b/crates/router/src/routes/app.rs index 0c489dbe63a..0807fb0800e 100644 --- a/crates/router/src/routes/app.rs +++ b/crates/router/src/routes/app.rs @@ -921,6 +921,7 @@ impl User { .service(web::resource("/role/list").route(web::get().to(list_roles))) .service(web::resource("/role/{role_id}").route(web::get().to(get_role))) .service(web::resource("/user/invite").route(web::post().to(invite_user))) + .service(web::resource("/update").route(web::post().to(update_user_account_details))) .service( web::resource("/data") .route(web::get().to(get_multiple_dashboard_metadata)) diff --git a/crates/router/src/routes/lock_utils.rs b/crates/router/src/routes/lock_utils.rs index 12cf76be475..805fb115264 100644 --- a/crates/router/src/routes/lock_utils.rs +++ b/crates/router/src/routes/lock_utils.rs @@ -178,7 +178,8 @@ impl From<Flow> for ApiIdentifier { | Flow::InviteUser | Flow::UserSignUpWithMerchantId | Flow::VerifyEmail - | Flow::VerifyEmailRequest => Self::User, + | Flow::VerifyEmailRequest + | Flow::UpdateUserAccountDetails => Self::User, Flow::ListRoles | Flow::GetRole | Flow::UpdateUserRole | Flow::GetAuthorizationInfo => { Self::UserRole diff --git a/crates/router/src/routes/user.rs b/crates/router/src/routes/user.rs index 976fd5c9f56..eca32318adf 100644 --- a/crates/router/src/routes/user.rs +++ b/crates/router/src/routes/user.rs @@ -403,3 +403,21 @@ pub async fn verify_recon_token(state: web::Data<AppState>, http_req: HttpReques )) .await } + +pub async fn update_user_account_details( + state: web::Data<AppState>, + req: HttpRequest, + json_payload: web::Json<user_api::UpdateUserAccountDetailsRequest>, +) -> HttpResponse { + let flow = Flow::UpdateUserAccountDetails; + Box::pin(api::server_wrap( + flow, + state.clone(), + &req, + json_payload.into_inner(), + user_core::update_user_details, + &auth::DashboardNoPermissionAuth, + api_locking::LockAction::NotApplicable, + )) + .await +} diff --git a/crates/router_env/src/logger/types.rs b/crates/router_env/src/logger/types.rs index 0d6636e567d..c4e0aa3f3ea 100644 --- a/crates/router_env/src/logger/types.rs +++ b/crates/router_env/src/logger/types.rs @@ -331,6 +331,8 @@ pub enum Flow { VerifyEmail, /// Send verify email VerifyEmailRequest, + /// Update user account details + UpdateUserAccountDetails, } /// diff --git a/migrations/2024-01-02-111223_users_preferred_merchant_column/down.sql b/migrations/2024-01-02-111223_users_preferred_merchant_column/down.sql new file mode 100644 index 00000000000..b9160b6f105 --- /dev/null +++ b/migrations/2024-01-02-111223_users_preferred_merchant_column/down.sql @@ -0,0 +1,2 @@ +-- This file should undo anything in `up.sql` +ALTER TABLE users DROP COLUMN preferred_merchant_id; diff --git a/migrations/2024-01-02-111223_users_preferred_merchant_column/up.sql b/migrations/2024-01-02-111223_users_preferred_merchant_column/up.sql new file mode 100644 index 00000000000..77567ce93fa --- /dev/null +++ b/migrations/2024-01-02-111223_users_preferred_merchant_column/up.sql @@ -0,0 +1,2 @@ +-- Your SQL goes here +ALTER TABLE users ADD COLUMN preferred_merchant_id VARCHAR(64);
feat
Add `preferred_merchant_id` column and update user details API (#3373)
5cde7ee0344d4068a232c96f60b53629b8c17f7f
2024-06-21 14:21:14
Sarthak Soni
feat(payment_methods): Implement Process tracker workflow for Payment method Status update (#4668)
false
diff --git a/crates/diesel_models/src/process_tracker.rs b/crates/diesel_models/src/process_tracker.rs index 135c8e2b055..342ad8453af 100644 --- a/crates/diesel_models/src/process_tracker.rs +++ b/crates/diesel_models/src/process_tracker.rs @@ -208,6 +208,7 @@ pub enum ProcessTrackerRunner { ApiKeyExpiryWorkflow, OutgoingWebhookRetryWorkflow, AttachPayoutAccountWorkflow, + PaymentMethodStatusUpdateWorkflow, } #[cfg(test)] diff --git a/crates/router/src/bin/scheduler.rs b/crates/router/src/bin/scheduler.rs index 167e7a6b6ed..1afc09e5a6a 100644 --- a/crates/router/src/bin/scheduler.rs +++ b/crates/router/src/bin/scheduler.rs @@ -310,6 +310,9 @@ impl ProcessTrackerWorkflows<routes::SessionState> for WorkflowRunner { ) } } + storage::ProcessTrackerRunner::PaymentMethodStatusUpdateWorkflow => Ok(Box::new( + workflows::payment_method_status_update::PaymentMethodStatusUpdateWorkflow, + )), } }; diff --git a/crates/router/src/core/payment_methods.rs b/crates/router/src/core/payment_methods.rs index f0aa0480d09..a4d4f38bfaf 100644 --- a/crates/router/src/core/payment_methods.rs +++ b/crates/router/src/core/payment_methods.rs @@ -8,11 +8,18 @@ use api_models::payments::CardToken; #[cfg(feature = "payouts")] pub use api_models::{enums::PayoutConnectors, payouts as payout_types}; use diesel_models::enums; +use error_stack::ResultExt; use hyperswitch_domain_models::payments::{payment_attempt::PaymentAttempt, PaymentIntent}; use router_env::{instrument, tracing}; use crate::{ - core::{errors::RouterResult, payments::helpers, pm_auth as core_pm_auth}, + consts, + core::{ + errors::{self, RouterResult}, + payments::helpers, + pm_auth as core_pm_auth, + }, + db, routes::SessionState, types::{ api::{self, payments}, @@ -20,6 +27,9 @@ use crate::{ }, }; +const PAYMENT_METHOD_STATUS_UPDATE_TASK: &str = "PAYMENT_METHOD_STATUS_UPDATE"; +const PAYMENT_METHOD_STATUS_TAG: &str = "PAYMENT_METHOD_STATUS"; + #[instrument(skip_all)] pub async fn retrieve_payment_method( pm_data: &Option<payments::PaymentMethodData>, @@ -94,6 +104,66 @@ pub async fn retrieve_payment_method( } } +fn generate_task_id_for_payment_method_status_update_workflow( + key_id: &str, + runner: &storage::ProcessTrackerRunner, + task: &str, +) -> String { + format!("{runner}_{task}_{key_id}") +} + +pub async fn add_payment_method_status_update_task( + db: &dyn db::StorageInterface, + payment_method: &diesel_models::PaymentMethod, + prev_status: enums::PaymentMethodStatus, + curr_status: enums::PaymentMethodStatus, + merchant_id: &str, +) -> Result<(), errors::ProcessTrackerError> { + let created_at = payment_method.created_at; + let schedule_time = + created_at.saturating_add(time::Duration::seconds(consts::DEFAULT_SESSION_EXPIRY)); + + let tracking_data = storage::PaymentMethodStatusTrackingData { + payment_method_id: payment_method.payment_method_id.clone(), + prev_status, + curr_status, + merchant_id: merchant_id.to_string(), + }; + + let runner = storage::ProcessTrackerRunner::PaymentMethodStatusUpdateWorkflow; + let task = PAYMENT_METHOD_STATUS_UPDATE_TASK; + let tag = [PAYMENT_METHOD_STATUS_TAG]; + + let process_tracker_id = generate_task_id_for_payment_method_status_update_workflow( + payment_method.payment_method_id.as_str(), + &runner, + task, + ); + let process_tracker_entry = storage::ProcessTrackerNew::new( + process_tracker_id, + task, + runner, + tag, + tracking_data, + schedule_time, + ) + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("Failed to construct PAYMENT_METHOD_STATUS_UPDATE process tracker task")?; + + db + .insert_process(process_tracker_entry) + .await + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable_lazy(|| { + format!( + "Failed while inserting PAYMENT_METHOD_STATUS_UPDATE reminder to process_tracker for payment_method_id: {}", + payment_method.payment_method_id.clone() + ) + })?; + + Ok(()) +} + #[instrument(skip_all)] pub async fn retrieve_payment_method_with_token( state: &SessionState, diff --git a/crates/router/src/core/payment_methods/cards.rs b/crates/router/src/core/payment_methods/cards.rs index 046393b2f6b..204d7eb2439 100644 --- a/crates/router/src/core/payment_methods/cards.rs +++ b/crates/router/src/core/payment_methods/cards.rs @@ -45,7 +45,9 @@ use crate::{ configs::settings, core::{ errors::{self, StorageErrorExt}, - payment_methods::{transformers as payment_methods, vault}, + payment_methods::{ + add_payment_method_status_update_task, transformers as payment_methods, vault, + }, payments::{ helpers, routing::{self, SessionFlowRoutingInput}, @@ -297,6 +299,21 @@ pub async fn get_client_secret_or_add_payment_method( ) .await?; + if res.status == enums::PaymentMethodStatus::AwaitingData { + add_payment_method_status_update_task( + db, + &res, + enums::PaymentMethodStatus::AwaitingData, + enums::PaymentMethodStatus::Inactive, + merchant_id, + ) + .await + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable( + "Failed to add payment method status update task in process tracker", + )?; + } + Ok(services::api::ApplicationResponse::Json( api::PaymentMethodResponse::foreign_from(res), )) @@ -357,7 +374,7 @@ pub async fn add_payment_method_data( .attach_printable("Unable to find payment method")?; if payment_method.status != enums::PaymentMethodStatus::AwaitingData { - return Err((errors::ApiErrorResponse::DuplicatePaymentMethod).into()); + return Err((errors::ApiErrorResponse::ClientSecretExpired).into()); } let customer_id = payment_method.customer_id.clone(); diff --git a/crates/router/src/types/storage/payment_method.rs b/crates/router/src/types/storage/payment_method.rs index d9f96ef482c..308aa362562 100644 --- a/crates/router/src/types/storage/payment_method.rs +++ b/crates/router/src/types/storage/payment_method.rs @@ -110,3 +110,11 @@ impl DerefMut for PaymentsMandateReference { &mut self.0 } } + +#[derive(Debug, serde::Deserialize, serde::Serialize, Clone)] +pub struct PaymentMethodStatusTrackingData { + pub payment_method_id: String, + pub prev_status: enums::PaymentMethodStatus, + pub curr_status: enums::PaymentMethodStatus, + pub merchant_id: String, +} diff --git a/crates/router/src/workflows.rs b/crates/router/src/workflows.rs index 7b29ded5185..2f858c59809 100644 --- a/crates/router/src/workflows.rs +++ b/crates/router/src/workflows.rs @@ -3,6 +3,7 @@ pub mod api_key_expiry; #[cfg(feature = "payouts")] pub mod attach_payout_account_workflow; pub mod outgoing_webhook_retry; +pub mod payment_method_status_update; pub mod payment_sync; pub mod refund_router; pub mod tokenized_data; diff --git a/crates/router/src/workflows/payment_method_status_update.rs b/crates/router/src/workflows/payment_method_status_update.rs new file mode 100644 index 00000000000..b8e57360d90 --- /dev/null +++ b/crates/router/src/workflows/payment_method_status_update.rs @@ -0,0 +1,107 @@ +use common_utils::ext_traits::ValueExt; +use scheduler::{ + consumer::types::process_data, utils as pt_utils, workflows::ProcessTrackerWorkflow, +}; + +use crate::{ + errors, + logger::error, + routes::SessionState, + types::storage::{self, PaymentMethodStatusTrackingData}, +}; + +pub struct PaymentMethodStatusUpdateWorkflow; + +#[async_trait::async_trait] +impl ProcessTrackerWorkflow<SessionState> for PaymentMethodStatusUpdateWorkflow { + async fn execute_workflow<'a>( + &'a self, + state: &'a SessionState, + process: storage::ProcessTracker, + ) -> Result<(), errors::ProcessTrackerError> { + let db = &*state.store; + let tracking_data: PaymentMethodStatusTrackingData = process + .tracking_data + .clone() + .parse_value("PaymentMethodStatusTrackingData")?; + + let retry_count = process.retry_count; + let pm_id = tracking_data.payment_method_id; + let prev_pm_status = tracking_data.prev_status; + let curr_pm_status = tracking_data.curr_status; + let merchant_id = tracking_data.merchant_id; + + let key_store = state + .store + .get_merchant_key_store_by_merchant_id( + merchant_id.as_str(), + &state.store.get_master_key().to_vec().into(), + ) + .await?; + + let merchant_account = db + .find_merchant_account_by_merchant_id(&merchant_id, &key_store) + .await?; + + let payment_method = db + .find_payment_method(&pm_id, merchant_account.storage_scheme) + .await?; + + if payment_method.status != prev_pm_status { + return db + .as_scheduler() + .finish_process_with_business_status(process, "PROCESS_ALREADY_COMPLETED") + .await + .map_err(Into::<errors::ProcessTrackerError>::into); + } + + let pm_update = storage::PaymentMethodUpdate::StatusUpdate { + status: Some(curr_pm_status), + }; + + let res = db + .update_payment_method(payment_method, pm_update, merchant_account.storage_scheme) + .await + .map_err(errors::ProcessTrackerError::EStorageError); + + if let Ok(_pm) = res { + db.as_scheduler() + .finish_process_with_business_status(process, "COMPLETED_BY_PT") + .await?; + } else { + let mapping = process_data::PaymentMethodsPTMapping::default(); + let time_delta = if retry_count == 0 { + Some(mapping.default_mapping.start_after) + } else { + pt_utils::get_delay(retry_count + 1, &mapping.default_mapping.frequencies) + }; + + let schedule_time = pt_utils::get_time_from_delta(time_delta); + + match schedule_time { + Some(s_time) => db + .as_scheduler() + .retry_process(process, s_time) + .await + .map_err(Into::<errors::ProcessTrackerError>::into)?, + None => db + .as_scheduler() + .finish_process_with_business_status(process, "RETRIES_EXCEEDED") + .await + .map_err(Into::<errors::ProcessTrackerError>::into)?, + }; + }; + + Ok(()) + } + + async fn error_handler<'a>( + &'a self, + _state: &'a SessionState, + process: storage::ProcessTracker, + _error: errors::ProcessTrackerError, + ) -> errors::CustomResult<(), errors::ProcessTrackerError> { + error!(%process.id, "Failed while executing workflow"); + Ok(()) + } +} diff --git a/crates/scheduler/src/utils.rs b/crates/scheduler/src/utils.rs index 7f073a8e10b..f3253e0ad34 100644 --- a/crates/scheduler/src/utils.rs +++ b/crates/scheduler/src/utils.rs @@ -342,7 +342,7 @@ pub fn get_outgoing_webhook_retry_schedule_time( } /// Get the delay based on the retry count -fn get_delay<'a>( +pub fn get_delay<'a>( retry_count: i32, frequencies: impl IntoIterator<Item = &'a (i32, i32)>, ) -> Option<i32> {
feat
Implement Process tracker workflow for Payment method Status update (#4668)
69821948c0a31b224e1b519388071b66c0d67eb1
2023-08-08 17:03:23
Sai Harsha Vardhan
fix(router): send error_reason as error_message in payments and refund flows (#1878)
false
diff --git a/crates/router/src/core/payments/transformers.rs b/crates/router/src/core/payments/transformers.rs index 1565f69bfed..04a0848aba4 100644 --- a/crates/router/src/core/payments/transformers.rs +++ b/crates/router/src/core/payments/transformers.rs @@ -491,7 +491,11 @@ where auth_flow == services::AuthFlow::Merchant, ) .set_payment_token(payment_attempt.payment_token) - .set_error_message(payment_attempt.error_reason) + .set_error_message( + payment_attempt + .error_reason + .or(payment_attempt.error_message), + ) .set_error_code(payment_attempt.error_code) .set_shipping(address.shipping) .set_billing(address.billing) @@ -547,7 +551,9 @@ where attempts: attempts_response, payment_method: payment_attempt.payment_method, capture_method: payment_attempt.capture_method, - error_message: payment_attempt.error_message, + error_message: payment_attempt + .error_reason + .or(payment_attempt.error_message), error_code: payment_attempt.error_code, payment_method_data: payment_method_data_response, email: customer diff --git a/crates/router/src/core/refunds.rs b/crates/router/src/core/refunds.rs index b0dc979b7cb..a61b662f46d 100644 --- a/crates/router/src/core/refunds.rs +++ b/crates/router/src/core/refunds.rs @@ -203,7 +203,7 @@ pub async fn trigger_refund_to_gateway( let refund_update = match router_data_res.response { Err(err) => storage::RefundUpdate::ErrorUpdate { refund_status: Some(enums::RefundStatus::Failure), - refund_error_message: Some(err.message), + refund_error_message: err.reason.or(Some(err.message)), refund_error_code: Some(err.code), }, Ok(response) => { @@ -430,7 +430,7 @@ pub async fn sync_refund_with_gateway( let refund_update = match router_data_res.response { Err(error_message) => storage::RefundUpdate::ErrorUpdate { refund_status: None, - refund_error_message: Some(error_message.message), + refund_error_message: error_message.reason.or(Some(error_message.message)), refund_error_code: Some(error_message.code), }, Ok(response) => storage::RefundUpdate::Update {
fix
send error_reason as error_message in payments and refund flows (#1878)
086115f47379b06185a1753979fc6dd9dc945afd
2024-12-04 21:33:12
likhinbopanna
ci(cypress): Add Dynamic fields Test Cases (#6703)
false
diff --git a/cypress-tests/cypress/e2e/PaymentMethodListTest/00000-PaymentMethodListTests.cy.js b/cypress-tests/cypress/e2e/PaymentMethodListTest/00000-PaymentMethodListTests.cy.js index 7005a308cb4..89b27a6b271 100644 --- a/cypress-tests/cypress/e2e/PaymentMethodListTest/00000-PaymentMethodListTests.cy.js +++ b/cypress-tests/cypress/e2e/PaymentMethodListTest/00000-PaymentMethodListTests.cy.js @@ -1,15 +1,13 @@ -import apiKeyCreateBody from "../../fixtures/create-api-key-body.json"; -import createConnectorBody from "../../fixtures/create-connector-body.json"; -import merchantCreateBody from "../../fixtures/merchant-create-body.json"; +import * as fixtures from "../../fixtures/imports"; import State from "../../utils/State"; import { - bank_redirect_ideal_and_credit_enabled, - bank_redirect_ideal_enabled, - card_credit_enabled, - card_credit_enabled_in_US, - card_credit_enabled_in_USD, - create_payment_body_with_currency, - create_payment_body_with_currency_country, + bankRedirectIdealAndCreditEnabled, + bankRedirectIdealEnabled, + cardCreditEnabled, + cardCreditEnabledInUs, + cardCreditEnabledInUsd, + createPaymentBodyWithCurrency, + createPaymentBodyWithCurrencyCountry, } from "../PaymentMethodListUtils/Commons"; import getConnectorDetails from "../PaymentMethodListUtils/Utils"; @@ -34,19 +32,22 @@ describe("Payment Method list using Constraint Graph flow tests", () => { }); it("merchant-create-call-test", () => { - cy.merchantCreateCallTest(merchantCreateBody, globalState); + cy.merchantCreateCallTest(fixtures.merchantCreateBody, globalState); }); it("api-key-create-call-test", () => { - cy.apiKeyCreateTest(apiKeyCreateBody, globalState); + cy.apiKeyCreateTest(fixtures.apiKeyCreateBody, globalState); + }); + it("customer-create-call-test", () => { + cy.createCustomerCallTest(fixtures.customerCreateBody, globalState); }); // stripe connector create with ideal enabled it("connector-create-call-test", () => { cy.createNamedConnectorCallTest( "payment_processor", - createConnectorBody, - bank_redirect_ideal_enabled, + fixtures.createConnectorBody, + bankRedirectIdealEnabled, globalState, "stripe", "stripe_US_default" @@ -57,8 +58,8 @@ describe("Payment Method list using Constraint Graph flow tests", () => { it("connector-create-call-test", () => { cy.createNamedConnectorCallTest( "payment_processor", - createConnectorBody, - card_credit_enabled, + fixtures.createConnectorBody, + cardCreditEnabled, globalState, "cybersource", "cybersource_US_default" @@ -76,7 +77,7 @@ describe("Payment Method list using Constraint Graph flow tests", () => { }; cy.createPaymentIntentTest( - create_payment_body_with_currency("EUR"), + createPaymentBodyWithCurrency("EUR"), newData, "no_three_ds", "automatic", @@ -117,19 +118,19 @@ describe("Payment Method list using Constraint Graph flow tests", () => { }); it("merchant-create-call-test", () => { - cy.merchantCreateCallTest(merchantCreateBody, globalState); + cy.merchantCreateCallTest(fixtures.merchantCreateBody, globalState); }); it("api-key-create-call-test", () => { - cy.apiKeyCreateTest(apiKeyCreateBody, globalState); + cy.apiKeyCreateTest(fixtures.apiKeyCreateBody, globalState); }); // stripe connector create with ideal enabled it("connector-create-call-test", () => { cy.createNamedConnectorCallTest( "payment_processor", - createConnectorBody, - bank_redirect_ideal_enabled, + fixtures.createConnectorBody, + bankRedirectIdealEnabled, globalState, "stripe", "stripe_US_default" @@ -140,8 +141,8 @@ describe("Payment Method list using Constraint Graph flow tests", () => { it("connector-create-call-test", () => { cy.createNamedConnectorCallTest( "payment_processor", - createConnectorBody, - card_credit_enabled_in_USD, + fixtures.createConnectorBody, + cardCreditEnabledInUsd, globalState, "cybersource", "cybersource_US_default" @@ -159,7 +160,7 @@ describe("Payment Method list using Constraint Graph flow tests", () => { }; cy.createPaymentIntentTest( - create_payment_body_with_currency("INR"), + createPaymentBodyWithCurrency("INR"), newData, "no_three_ds", "automatic", @@ -200,19 +201,19 @@ describe("Payment Method list using Constraint Graph flow tests", () => { }); it("merchant-create-call-test", () => { - cy.merchantCreateCallTest(merchantCreateBody, globalState); + cy.merchantCreateCallTest(fixtures.merchantCreateBody, globalState); }); it("api-key-create-call-test", () => { - cy.apiKeyCreateTest(apiKeyCreateBody, globalState); + cy.apiKeyCreateTest(fixtures.apiKeyCreateBody, globalState); }); // stripe connector create with credit enabled for US it("connector-create-call-test", () => { cy.createNamedConnectorCallTest( "payment_processor", - createConnectorBody, - card_credit_enabled_in_US, + fixtures.createConnectorBody, + cardCreditEnabledInUs, globalState, "stripe", "stripe_US_default" @@ -223,8 +224,8 @@ describe("Payment Method list using Constraint Graph flow tests", () => { it("connector-create-call-test", () => { cy.createNamedConnectorCallTest( "payment_processor", - createConnectorBody, - card_credit_enabled_in_US, + fixtures.createConnectorBody, + cardCreditEnabledInUs, globalState, "cybersource", "cybersource_US_default" @@ -242,7 +243,7 @@ describe("Payment Method list using Constraint Graph flow tests", () => { }; cy.createPaymentIntentTest( - create_payment_body_with_currency("USD"), + createPaymentBodyWithCurrency("USD"), newData, "no_three_ds", "automatic", @@ -283,19 +284,19 @@ describe("Payment Method list using Constraint Graph flow tests", () => { }); it("merchant-create-call-test", () => { - cy.merchantCreateCallTest(merchantCreateBody, globalState); + cy.merchantCreateCallTest(fixtures.merchantCreateBody, globalState); }); it("api-key-create-call-test", () => { - cy.apiKeyCreateTest(apiKeyCreateBody, globalState); + cy.apiKeyCreateTest(fixtures.apiKeyCreateBody, globalState); }); // stripe connector create with ideal enabled it("connector-create-call-test", () => { cy.createNamedConnectorCallTest( "payment_processor", - createConnectorBody, - bank_redirect_ideal_enabled, + fixtures.createConnectorBody, + bankRedirectIdealEnabled, globalState, "stripe", "stripe_US_default" @@ -306,8 +307,8 @@ describe("Payment Method list using Constraint Graph flow tests", () => { it("connector-create-call-test", () => { cy.createNamedConnectorCallTest( "payment_processor", - createConnectorBody, - bank_redirect_ideal_enabled, + fixtures.createConnectorBody, + bankRedirectIdealEnabled, globalState, "cybersource", "cybersource_US_default" @@ -325,7 +326,7 @@ describe("Payment Method list using Constraint Graph flow tests", () => { }; cy.createPaymentIntentTest( - create_payment_body_with_currency_country("EUR", "US", "US"), + createPaymentBodyWithCurrencyCountry("EUR", "US", "US"), newData, "no_three_ds", "automatic", @@ -368,19 +369,19 @@ describe("Payment Method list using Constraint Graph flow tests", () => { }); it("merchant-create-call-test", () => { - cy.merchantCreateCallTest(merchantCreateBody, globalState); + cy.merchantCreateCallTest(fixtures.merchantCreateBody, globalState); }); it("api-key-create-call-test", () => { - cy.apiKeyCreateTest(apiKeyCreateBody, globalState); + cy.apiKeyCreateTest(fixtures.apiKeyCreateBody, globalState); }); // stripe connector create with card credit enabled it("connector-create-call-test", () => { cy.createNamedConnectorCallTest( "payment_processor", - createConnectorBody, - card_credit_enabled, + fixtures.createConnectorBody, + cardCreditEnabled, globalState, "stripe", "stripe_US_default" @@ -391,8 +392,8 @@ describe("Payment Method list using Constraint Graph flow tests", () => { it("connector-create-call-test", () => { cy.createNamedConnectorCallTest( "payment_processor", - createConnectorBody, - bank_redirect_ideal_and_credit_enabled, + fixtures.createConnectorBody, + bankRedirectIdealAndCreditEnabled, globalState, "cybersource", "cybersource_US_default" @@ -410,7 +411,7 @@ describe("Payment Method list using Constraint Graph flow tests", () => { }; cy.createPaymentIntentTest( - create_payment_body_with_currency_country("USD", "IN", "IN"), + createPaymentBodyWithCurrencyCountry("USD", "IN", "IN"), newData, "no_three_ds", "automatic", @@ -452,19 +453,19 @@ describe("Payment Method list using Constraint Graph flow tests", () => { }); it("merchant-create-call-test", () => { - cy.merchantCreateCallTest(merchantCreateBody, globalState); + cy.merchantCreateCallTest(fixtures.merchantCreateBody, globalState); }); it("api-key-create-call-test", () => { - cy.apiKeyCreateTest(apiKeyCreateBody, globalState); + cy.apiKeyCreateTest(fixtures.apiKeyCreateBody, globalState); }); // stripe connector create with card credit enabled it("connector-create-call-test", () => { cy.createNamedConnectorCallTest( "payment_processor", - createConnectorBody, - card_credit_enabled, + fixtures.createConnectorBody, + cardCreditEnabled, globalState, "stripe", "stripe_US_default" @@ -475,8 +476,8 @@ describe("Payment Method list using Constraint Graph flow tests", () => { it("connector-create-call-test", () => { cy.createNamedConnectorCallTest( "payment_processor", - createConnectorBody, - card_credit_enabled, + fixtures.createConnectorBody, + cardCreditEnabled, globalState, "cybersource", "cybersource_US_default" @@ -494,7 +495,7 @@ describe("Payment Method list using Constraint Graph flow tests", () => { }; cy.createPaymentIntentTest( - create_payment_body_with_currency("USD"), + createPaymentBodyWithCurrency("USD"), newData, "no_three_ds", "automatic", @@ -535,19 +536,19 @@ describe("Payment Method list using Constraint Graph flow tests", () => { }); it("merchant-create-call-test", () => { - cy.merchantCreateCallTest(merchantCreateBody, globalState); + cy.merchantCreateCallTest(fixtures.merchantCreateBody, globalState); }); it("api-key-create-call-test", () => { - cy.apiKeyCreateTest(apiKeyCreateBody, globalState); + cy.apiKeyCreateTest(fixtures.apiKeyCreateBody, globalState); }); // stripe connector create with ideal enabled it("connector-create-call-test", () => { cy.createNamedConnectorCallTest( "payment_processor", - createConnectorBody, - bank_redirect_ideal_enabled, + fixtures.createConnectorBody, + bankRedirectIdealEnabled, globalState, "stripe", "stripe_US_default" @@ -558,8 +559,8 @@ describe("Payment Method list using Constraint Graph flow tests", () => { it("connector-create-call-test", () => { cy.createNamedConnectorCallTest( "payment_processor", - createConnectorBody, - card_credit_enabled, + fixtures.createConnectorBody, + cardCreditEnabled, globalState, "cybersource", "cybersource_US_default" @@ -577,7 +578,7 @@ describe("Payment Method list using Constraint Graph flow tests", () => { }; cy.createPaymentIntentTest( - create_payment_body_with_currency_country("EUR", "NL", "US"), + createPaymentBodyWithCurrencyCountry("EUR", "NL", "US"), newData, "no_three_ds", "automatic", diff --git a/cypress-tests/cypress/e2e/PaymentMethodListUtils/Commons.js b/cypress-tests/cypress/e2e/PaymentMethodListUtils/Commons.js index 7119a9aabc9..ae72465b606 100644 --- a/cypress-tests/cypress/e2e/PaymentMethodListUtils/Commons.js +++ b/cypress-tests/cypress/e2e/PaymentMethodListUtils/Commons.js @@ -1,4 +1,4 @@ -export const card_credit_enabled = [ +export const cardCreditEnabled = [ { payment_method: "card", payment_method_types: [ @@ -6,6 +6,10 @@ export const card_credit_enabled = [ payment_method_type: "credit", card_networks: ["Visa"], minimum_amount: 0, + accepted_currencies: { + type: "enable_only", + list: ["USD"], + }, maximum_amount: 68607706, recurring_enabled: false, installment_payment_enabled: true, @@ -14,7 +18,7 @@ export const card_credit_enabled = [ }, ]; -export const card_credit_enabled_in_USD = [ +export const cardCreditEnabledInUsd = [ { payment_method: "card", payment_method_types: [ @@ -34,7 +38,7 @@ export const card_credit_enabled_in_USD = [ }, ]; -export const card_credit_enabled_in_US = [ +export const cardCreditEnabledInUs = [ { payment_method: "card", payment_method_types: [ @@ -54,7 +58,7 @@ export const card_credit_enabled_in_US = [ }, ]; -export const bank_redirect_ideal_enabled = [ +export const bankRedirectIdealEnabled = [ { payment_method: "bank_redirect", payment_method_types: [ @@ -72,7 +76,7 @@ export const bank_redirect_ideal_enabled = [ }, ]; -export const bank_redirect_ideal_and_credit_enabled = [ +export const bankRedirectIdealAndCreditEnabled = [ { payment_method: "card", payment_method_types: [ @@ -103,7 +107,7 @@ export const bank_redirect_ideal_and_credit_enabled = [ }, ]; -export const create_payment_body_with_currency_country = ( +export const createPaymentBodyWithCurrencyCountry = ( currency, billingCountry, shippingCountry @@ -158,7 +162,7 @@ export const create_payment_body_with_currency_country = ( }, }); -export const create_payment_body_with_currency = (currency) => ({ +export const createPaymentBodyWithCurrency = (currency) => ({ currency: currency, amount: 6500, authentication_type: "three_ds", diff --git a/cypress-tests/cypress/e2e/PaymentTest/00026-DynamicFields.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00026-DynamicFields.cy.js new file mode 100644 index 00000000000..a325ac5f2f0 --- /dev/null +++ b/cypress-tests/cypress/e2e/PaymentTest/00026-DynamicFields.cy.js @@ -0,0 +1,175 @@ +import * as fixtures from "../../fixtures/imports"; +import State from "../../utils/State"; +import { cardCreditEnabled } from "../PaymentMethodListUtils/Commons"; +import getConnectorDetails, * as utils from "../PaymentUtils/Utils"; + +let globalState; + +describe("Dynamic Fields Verification", () => { + context("Verify the Dynamic fields for card", () => { + before("seed global state", () => { + cy.task("getGlobalState").then((state) => { + globalState = new State(state); + }); + }); + + after("flush global state", () => { + cy.task("setGlobalState", globalState.data); + }); + + context( + "Verify the Dynamic fields - Payment without billing address", + () => { + let shouldContinue = true; + + beforeEach(function () { + if (!shouldContinue) { + this.skip(); + } + }); + + it("Create Business Profile", () => { + cy.createBusinessProfileTest( + fixtures.businessProfile.bpCreate, + globalState + ); + }); + + it("connector-create-call-test", () => { + cy.createConnectorCallTest( + "payment_processor", + fixtures.createConnectorBody, + cardCreditEnabled, + globalState + ); + }); + + it("Create Payment Intent", () => { + const data = getConnectorDetails(globalState.get("connectorId"))[ + "card_pm" + ]["PaymentWithoutBilling"]; + + cy.createPaymentIntentTest( + fixtures.createPaymentBody, + data, + "no_three_ds", + "automatic", + globalState + ); + if (shouldContinue) + shouldContinue = utils.should_continue_further(data); + }); + + it("Payment Method List", () => { + const data = getConnectorDetails(globalState.get("connectorId"))[ + "pm_list" + ]["PmListResponse"]["pmListDynamicFieldWithoutBilling"]; + cy.paymentMethodListTestWithRequiredFields(data, globalState); + }); + } + ); + + context("Verify the Dynamic fields - Payment with billing address", () => { + let shouldContinue = true; + + beforeEach(function () { + if (!shouldContinue) { + this.skip(); + } + }); + + it("Create Payment Intent", () => { + const data = getConnectorDetails(globalState.get("connectorId"))[ + "card_pm" + ]["PaymentWithBilling"]; + + cy.createPaymentIntentTest( + fixtures.createPaymentBody, + data, + "no_three_ds", + "automatic", + globalState + ); + if (shouldContinue) + shouldContinue = utils.should_continue_further(data); + }); + + it("Payment Method List", () => { + const data = getConnectorDetails(globalState.get("connectorId"))[ + "pm_list" + ]["PmListResponse"]["pmListDynamicFieldWithBilling"]; + cy.paymentMethodListTestWithRequiredFields(data, globalState); + }); + }); + + context( + "Verify the Dynamic fields - Payment with billing First and Last name", + () => { + let shouldContinue = true; + + beforeEach(function () { + if (!shouldContinue) { + this.skip(); + } + }); + + it("Create Payment Intent", () => { + const data = getConnectorDetails(globalState.get("connectorId"))[ + "card_pm" + ]["PaymentWithFullName"]; + + cy.createPaymentIntentTest( + fixtures.createPaymentBody, + data, + "no_three_ds", + "automatic", + globalState + ); + if (shouldContinue) + shouldContinue = utils.should_continue_further(data); + }); + + it("Payment Method List", () => { + const data = getConnectorDetails(globalState.get("connectorId"))[ + "pm_list" + ]["PmListResponse"]["pmListDynamicFieldWithNames"]; + cy.paymentMethodListTestWithRequiredFields(data, globalState); + }); + } + ); + + context("Verify the Dynamic fields - Payment with billing Email", () => { + let shouldContinue = true; + + beforeEach(function () { + if (!shouldContinue) { + this.skip(); + } + }); + + it("Create Payment Intent", () => { + const data = getConnectorDetails(globalState.get("connectorId"))[ + "card_pm" + ]["PaymentWithBillingEmail"]; + + cy.createPaymentIntentTest( + fixtures.createPaymentBody, + data, + "no_three_ds", + "automatic", + globalState + ); + if (shouldContinue) + shouldContinue = utils.should_continue_further(data); + }); + + it("Payment Method List", () => { + const data = getConnectorDetails(globalState.get("connectorId"))[ + "pm_list" + ]["PmListResponse"]["pmListDynamicFieldWithEmail"]; + cy.paymentMethodListTestWithRequiredFields(data, globalState); + }); + }); + }); +}); +1; diff --git a/cypress-tests/cypress/e2e/PaymentTest/00026-IncrementalAuth.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00027-IncrementalAuth.cy.js similarity index 100% rename from cypress-tests/cypress/e2e/PaymentTest/00026-IncrementalAuth.cy.js rename to cypress-tests/cypress/e2e/PaymentTest/00027-IncrementalAuth.cy.js diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Adyen.js b/cypress-tests/cypress/e2e/PaymentUtils/Adyen.js index 81525041147..db3206e5dde 100644 --- a/cypress-tests/cypress/e2e/PaymentUtils/Adyen.js +++ b/cypress-tests/cypress/e2e/PaymentUtils/Adyen.js @@ -982,4 +982,215 @@ export const connectorDetails = { }, }, }, + pm_list: { + PmListResponse: { + PmListNull: { + payment_methods: [], + }, + pmListDynamicFieldWithoutBilling: { + payment_methods: [ + { + payment_method: "card", + payment_method_types: [ + { + payment_method_type: "credit", + card_networks: [ + { + eligible_connectors: ["adyen"], + }, + ], + required_fields: { + "payment_method_data.card.card_number": { + required_field: "payment_method_data.card.card_number", + display_name: "card_number", + field_type: "user_card_number", + value: null, + }, + "payment_method_data.card.card_exp_month": { + required_field: "payment_method_data.card.card_exp_month", + display_name: "card_exp_month", + field_type: "user_card_expiry_month", + value: null, + }, + "payment_method_data.card.card_exp_year": { + required_field: "payment_method_data.card.card_exp_year", + display_name: "card_exp_year", + field_type: "user_card_expiry_year", + value: null, + }, + "payment_method_data.card.card_cvc": { + required_field: "payment_method_data.card.card_cvc", + display_name: "card_cvc", + field_type: "user_card_cvc", + value: null, + }, + "billing.address.first_name": { + required_field: + "payment_method_data.billing.address.first_name", + display_name: "card_holder_name", + field_type: "user_full_name", + value: null, + }, + "billing.address.last_name": { + required_field: + "payment_method_data.billing.address.last_name", + display_name: "card_holder_name", + field_type: "user_full_name", + value: null, + }, + }, + }, + ], + }, + ], + }, + pmListDynamicFieldWithBilling: { + payment_methods: [ + { + payment_method: "card", + payment_method_types: [ + { + payment_method_type: "credit", + card_networks: [ + { + eligible_connectors: ["adyen"], + }, + ], + required_fields: { + "payment_method_data.card.card_exp_month": { + required_field: "payment_method_data.card.card_exp_month", + display_name: "card_exp_month", + field_type: "user_card_expiry_month", + value: null, + }, + "payment_method_data.card.card_number": { + required_field: "payment_method_data.card.card_number", + display_name: "card_number", + field_type: "user_card_number", + value: null, + }, + "payment_method_data.card.card_cvc": { + required_field: "payment_method_data.card.card_cvc", + display_name: "card_cvc", + field_type: "user_card_cvc", + value: null, + }, + "payment_method_data.card.card_exp_year": { + required_field: "payment_method_data.card.card_exp_year", + display_name: "card_exp_year", + field_type: "user_card_expiry_year", + value: null, + }, + "billing.address.first_name": { + required_field: + "payment_method_data.billing.address.first_name", + display_name: "card_holder_name", + field_type: "user_full_name", + value: "joseph", + }, + "billing.address.last_name": { + required_field: + "payment_method_data.billing.address.last_name", + display_name: "card_holder_name", + field_type: "user_full_name", + value: "Doe", + }, + }, + }, + ], + }, + ], + }, + pmListDynamicFieldWithNames: { + payment_methods: [ + { + payment_method: "card", + payment_method_types: [ + { + payment_method_type: "credit", + card_networks: [ + { + eligible_connectors: ["adyen"], + }, + ], + required_fields: { + "billing.address.last_name": { + required_field: + "payment_method_data.billing.address.last_name", + display_name: "card_holder_name", + field_type: "user_full_name", + value: "Doe", + }, + "billing.address.first_name": { + required_field: + "payment_method_data.billing.address.first_name", + display_name: "card_holder_name", + field_type: "user_full_name", + value: "joseph", + }, + }, + }, + ], + }, + ], + }, + pmListDynamicFieldWithEmail: { + payment_methods: [ + { + payment_method: "card", + payment_method_types: [ + { + payment_method_type: "credit", + card_networks: [ + { + eligible_connectors: ["adyen"], + }, + ], + required_fields: { + "payment_method_data.card.card_exp_month": { + required_field: "payment_method_data.card.card_exp_month", + display_name: "card_exp_month", + field_type: "user_card_expiry_month", + value: null, + }, + "payment_method_data.card.card_number": { + required_field: "payment_method_data.card.card_number", + display_name: "card_number", + field_type: "user_card_number", + value: null, + }, + "payment_method_data.card.card_cvc": { + required_field: "payment_method_data.card.card_cvc", + display_name: "card_cvc", + field_type: "user_card_cvc", + value: null, + }, + "payment_method_data.card.card_exp_year": { + required_field: "payment_method_data.card.card_exp_year", + display_name: "card_exp_year", + field_type: "user_card_expiry_year", + value: null, + }, + "billing.address.first_name": { + required_field: + "payment_method_data.billing.address.first_name", + display_name: "card_holder_name", + field_type: "user_full_name", + value: "joseph", + }, + "billing.address.last_name": { + required_field: + "payment_method_data.billing.address.last_name", + display_name: "card_holder_name", + field_type: "user_full_name", + value: "Doe", + }, + }, + }, + ], + }, + ], + }, + }, + }, }; diff --git a/cypress-tests/cypress/e2e/PaymentUtils/BankOfAmerica.js b/cypress-tests/cypress/e2e/PaymentUtils/BankOfAmerica.js index 6f383367e05..a5af06b908a 100644 --- a/cypress-tests/cypress/e2e/PaymentUtils/BankOfAmerica.js +++ b/cypress-tests/cypress/e2e/PaymentUtils/BankOfAmerica.js @@ -675,4 +675,265 @@ export const connectorDetails = { }, }, }, + pm_list: { + PmListResponse: { + PmListNull: { + payment_methods: [], + }, + pmListDynamicFieldWithoutBilling: { + payment_methods: [ + { + payment_method: "card", + payment_method_types: [ + { + payment_method_type: "credit", + card_networks: [ + { + eligible_connectors: ["bankofamerica"], + }, + ], + required_fields: { + "billing.address.first_name": { + required_field: + "payment_method_data.billing.address.first_name", + display_name: "card_holder_name", + field_type: "user_full_name", + value: null, + }, + "billing.address.state": { + required_field: "payment_method_data.billing.address.state", + display_name: "state", + field_type: "user_address_state", + value: null, + }, + "billing.address.country": { + required_field: + "payment_method_data.billing.address.country", + display_name: "country", + field_type: { + user_address_country: { + options: ["ALL"], + }, + }, + value: null, + }, + "payment_method_data.card.card_exp_year": { + required_field: "payment_method_data.card.card_exp_year", + display_name: "card_exp_year", + field_type: "user_card_expiry_year", + value: null, + }, + "billing.address.zip": { + required_field: "payment_method_data.billing.address.zip", + display_name: "zip", + field_type: "user_address_pincode", + value: null, + }, + "billing.address.last_name": { + required_field: + "payment_method_data.billing.address.last_name", + display_name: "card_holder_name", + field_type: "user_full_name", + value: null, + }, + "payment_method_data.card.card_number": { + required_field: "payment_method_data.card.card_number", + display_name: "card_number", + field_type: "user_card_number", + value: null, + }, + "billing.address.line1": { + required_field: "payment_method_data.billing.address.line1", + display_name: "line1", + field_type: "user_address_line1", + value: null, + }, + "payment_method_data.card.card_exp_month": { + required_field: "payment_method_data.card.card_exp_month", + display_name: "card_exp_month", + field_type: "user_card_expiry_month", + value: null, + }, + email: { + required_field: "email", + display_name: "email", + field_type: "user_email_address", + value: "[email protected]", + }, + "billing.address.city": { + required_field: "payment_method_data.billing.address.city", + display_name: "city", + field_type: "user_address_city", + value: null, + }, + "payment_method_data.card.card_cvc": { + required_field: "payment_method_data.card.card_cvc", + display_name: "card_cvc", + field_type: "user_card_cvc", + value: null, + }, + }, + }, + ], + }, + ], + }, + pmListDynamicFieldWithBilling: { + payment_methods: [ + { + payment_method: "card", + payment_method_types: [ + { + payment_method_type: "credit", + card_networks: [ + { + eligible_connectors: ["bankofamerica"], + }, + ], + required_fields: { + "billing.address.first_name": { + required_field: + "payment_method_data.billing.address.first_name", + display_name: "card_holder_name", + field_type: "user_full_name", + value: "joseph", + }, + "billing.address.state": { + required_field: "payment_method_data.billing.address.state", + display_name: "state", + field_type: "user_address_state", + value: "CA", + }, + "billing.address.country": { + required_field: + "payment_method_data.billing.address.country", + display_name: "country", + field_type: { + user_address_country: { + options: ["ALL"], + }, + }, + value: "PL", + }, + "payment_method_data.card.card_exp_year": { + required_field: "payment_method_data.card.card_exp_year", + display_name: "card_exp_year", + field_type: "user_card_expiry_year", + value: null, + }, + "billing.address.zip": { + required_field: "payment_method_data.billing.address.zip", + display_name: "zip", + field_type: "user_address_pincode", + value: "94122", + }, + "billing.address.last_name": { + required_field: + "payment_method_data.billing.address.last_name", + display_name: "card_holder_name", + field_type: "user_full_name", + value: "Doe", + }, + "payment_method_data.card.card_number": { + required_field: "payment_method_data.card.card_number", + display_name: "card_number", + field_type: "user_card_number", + value: null, + }, + "billing.address.line1": { + required_field: "payment_method_data.billing.address.line1", + display_name: "line1", + field_type: "user_address_line1", + value: "1467", + }, + "payment_method_data.card.card_exp_month": { + required_field: "payment_method_data.card.card_exp_month", + display_name: "card_exp_month", + field_type: "user_card_expiry_month", + value: null, + }, + email: { + required_field: "email", + display_name: "email", + field_type: "user_email_address", + value: "[email protected]", + }, + "billing.address.city": { + required_field: "payment_method_data.billing.address.city", + display_name: "city", + field_type: "user_address_city", + value: "San Fransico", + }, + "payment_method_data.card.card_cvc": { + required_field: "payment_method_data.card.card_cvc", + display_name: "card_cvc", + field_type: "user_card_cvc", + value: null, + }, + }, + }, + ], + }, + ], + }, + pmListDynamicFieldWithNames: { + payment_methods: [ + { + payment_method: "card", + payment_method_types: [ + { + payment_method_type: "credit", + card_networks: [ + { + eligible_connectors: ["bankofamerica"], + }, + ], + required_fields: { + "billing.address.last_name": { + required_field: + "payment_method_data.billing.address.last_name", + display_name: "card_holder_name", + field_type: "user_full_name", + value: "Doe", + }, + "billing.address.first_name": { + required_field: + "payment_method_data.billing.address.first_name", + display_name: "card_holder_name", + field_type: "user_full_name", + value: "joseph", + }, + }, + }, + ], + }, + ], + }, + pmListDynamicFieldWithEmail: { + payment_methods: [ + { + payment_method: "card", + payment_method_types: [ + { + payment_method_type: "credit", + card_networks: [ + { + eligible_connectors: ["bankofamerica"], + }, + ], + required_fields: { + email: { + required_field: "email", + display_name: "email", + field_type: "user_email_address", + value: "[email protected]", + }, + }, + }, + ], + }, + ], + }, + }, + }, }; diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Commons.js b/cypress-tests/cypress/e2e/PaymentUtils/Commons.js index 144b43fee7c..28b85c85446 100644 --- a/cypress-tests/cypress/e2e/PaymentUtils/Commons.js +++ b/cypress-tests/cypress/e2e/PaymentUtils/Commons.js @@ -98,6 +98,49 @@ const multiUseMandateData = { }, }; +export const cardRequiredField = { + "payment_method_data.card.card_number": { + required_field: "payment_method_data.card.card_number", + display_name: "card_number", + field_type: "user_card_number", + value: null, + }, + "payment_method_data.card.card_exp_year": { + required_field: "payment_method_data.card.card_exp_year", + display_name: "card_exp_year", + field_type: "user_card_expiry_year", + value: null, + }, + "payment_method_data.card.card_cvc": { + required_field: "payment_method_data.card.card_cvc", + display_name: "card_cvc", + field_type: "user_card_cvc", + value: null, + }, + "payment_method_data.card.card_exp_month": { + required_field: "payment_method_data.card.card_exp_month", + display_name: "card_exp_month", + field_type: "user_card_expiry_month", + value: null, + }, +}; + +export const fullNameRequiredField = { + "billing.address.last_name": { + required_field: "payment_method_data.billing.address.last_name", + display_name: "card_holder_name", + field_type: "user_full_name", + value: "Doe", + }, + "billing.address.first_name": { + required_field: "payment_method_data.billing.address.first_name", + display_name: "card_holder_name", + field_type: "user_full_name", + value: "joseph", + }, +}; + +export const billingRequiredField = {}; /* `getDefaultExchange` contains the default Request and Response to be considered if none provided. `getCustomExchange` takes in 2 optional fields named as Request and Response. @@ -1383,6 +1426,96 @@ export const connectorDetails = { }, }, }), + PaymentWithoutBilling: { + Request: { + currency: "USD", + customer_acceptance: null, + setup_future_usage: "off_session", + authentication_type: "no_three_ds", + }, + Response: { + status: 200, + body: { + status: "requires_payment_method", + }, + }, + }, + PaymentWithBilling: { + Request: { + currency: "USD", + setup_future_usage: "off_session", + billing: { + address: { + line1: "1467", + line2: "CA", + line3: "Harrison Street", + city: "San Fransico", + state: "CA", + zip: "94122", + country: "PL", + first_name: "joseph", + last_name: "Doe", + }, + phone: { + number: "9111222333", + country_code: "+91", + }, + }, + email: "[email protected]", + }, + Response: { + status: 200, + body: { + status: "requires_payment_method", + }, + }, + }, + PaymentWithFullName: { + Request: { + currency: "USD", + setup_future_usage: "off_session", + billing: { + address: { + first_name: "joseph", + last_name: "Doe", + }, + phone: { + number: "9111222333", + country_code: "+91", + }, + }, + }, + Response: { + status: 200, + body: { + status: "requires_payment_method", + }, + }, + }, + PaymentWithBillingEmail: { + Request: { + currency: "USD", + setup_future_usage: "off_session", + email: "[email protected]", + billing: { + address: { + first_name: "joseph", + last_name: "Doe", + }, + phone: { + number: "9111222333", + country_code: "+91", + }, + email: "[email protected]", + }, + }, + Response: { + status: 200, + body: { + status: "requires_payment_method", + }, + }, + }, }, upi_pm: { PaymentIntent: getCustomExchange({ @@ -1421,4 +1554,67 @@ export const connectorDetails = { }, }), }, + pm_list: { + PmListResponse: { + PmListNull: { + payment_methods: [], + }, + pmListDynamicFieldWithoutBilling: { + payment_methods: [ + { + payment_method: "card", + payment_method_types: [ + { + payment_method_type: "credit", + card_networks: [], + required_fields: {}, + }, + ], + }, + ], + }, + pmListDynamicFieldWithBilling: { + payment_methods: [ + { + payment_method: "card", + payment_method_types: [ + { + payment_method_type: "credit", + card_networks: [], + required_fields: {}, + }, + ], + }, + ], + }, + pmListDynamicFieldWithNames: { + payment_methods: [ + { + payment_method: "card", + payment_method_types: [ + { + payment_method_type: "credit", + card_networks: [], + required_fields: {}, + }, + ], + }, + ], + }, + pmListDynamicFieldWithEmail: { + payment_methods: [ + { + payment_method: "card", + payment_method_types: [ + { + payment_method_type: "credit", + card_networks: [], + required_fields: {}, + }, + ], + }, + ], + }, + }, + }, }; diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Cybersource.js b/cypress-tests/cypress/e2e/PaymentUtils/Cybersource.js index d2782d450cd..97a5bd0971c 100644 --- a/cypress-tests/cypress/e2e/PaymentUtils/Cybersource.js +++ b/cypress-tests/cypress/e2e/PaymentUtils/Cybersource.js @@ -931,4 +931,255 @@ export const connectorDetails = { }, }, }, + pm_list: { + PmListResponse: { + PmListNull: { + payment_methods: [], + }, + pmListDynamicFieldWithoutBilling: { + payment_methods: [ + { + payment_method: "card", + payment_method_types: [ + { + payment_method_type: "credit", + card_networks: [ + { + eligible_connectors: ["cybersource"], + }, + ], + required_fields: { + "billing.address.first_name": { + required_field: + "payment_method_data.billing.address.first_name", + display_name: "card_holder_name", + field_type: "user_full_name", + value: null, + }, + "payment_method_data.card.card_number": { + required_field: "payment_method_data.card.card_number", + display_name: "card_number", + field_type: "user_card_number", + value: null, + }, + "payment_method_data.card.card_cvc": { + required_field: "payment_method_data.card.card_cvc", + display_name: "card_cvc", + field_type: "user_card_cvc", + value: null, + }, + + "payment_method_data.card.card_exp_year": { + required_field: "payment_method_data.card.card_exp_year", + display_name: "card_exp_year", + field_type: "user_card_expiry_year", + value: null, + }, + "billing.address.last_name": { + required_field: + "payment_method_data.billing.address.last_name", + display_name: "card_holder_name", + field_type: "user_full_name", + value: null, + }, + "billing.address.state": { + required_field: "payment_method_data.billing.address.state", + display_name: "state", + field_type: "user_address_state", + value: null, + }, + "billing.email": { + required_field: "payment_method_data.billing.email", + display_name: "email", + field_type: "user_email_address", + value: "[email protected]", + }, + "billing.address.zip": { + required_field: "payment_method_data.billing.address.zip", + display_name: "zip", + field_type: "user_address_pincode", + value: null, + }, + "payment_method_data.card.card_exp_month": { + required_field: "payment_method_data.card.card_exp_month", + display_name: "card_exp_month", + field_type: "user_card_expiry_month", + value: null, + }, + "billing.address.line1": { + required_field: "payment_method_data.billing.address.line1", + display_name: "line1", + field_type: "user_address_line1", + value: null, + }, + "billing.address.city": { + required_field: "payment_method_data.billing.address.city", + display_name: "city", + field_type: "user_address_city", + value: null, + }, + }, + }, + ], + }, + ], + }, + pmListDynamicFieldWithBilling: { + payment_methods: [ + { + payment_method: "card", + payment_method_types: [ + { + payment_method_type: "credit", + card_networks: [ + { + eligible_connectors: ["cybersource"], + }, + ], + required_fields: { + "billing.address.city": { + required_field: "payment_method_data.billing.address.city", + display_name: "city", + field_type: "user_address_city", + value: "San Fransico", + }, + "billing.address.state": { + required_field: "payment_method_data.billing.address.state", + display_name: "state", + field_type: "user_address_state", + value: "CA", + }, + "billing.address.zip": { + required_field: "payment_method_data.billing.address.zip", + display_name: "zip", + field_type: "user_address_pincode", + value: "94122", + }, + "billing.address.country": { + required_field: + "payment_method_data.billing.address.country", + display_name: "country", + field_type: { + user_address_country: { + options: ["ALL"], + }, + }, + value: "PL", + }, + "billing.address.first_name": { + required_field: + "payment_method_data.billing.address.first_name", + display_name: "card_holder_name", + field_type: "user_full_name", + value: "joseph", + }, + "billing.address.last_name": { + required_field: + "payment_method_data.billing.address.last_name", + display_name: "card_holder_name", + field_type: "user_full_name", + value: "Doe", + }, + "billing.email": { + required_field: "payment_method_data.billing.email", + display_name: "email", + field_type: "user_email_address", + value: "[email protected]", + }, + "payment_method_data.card.card_cvc": { + required_field: "payment_method_data.card.card_cvc", + display_name: "card_cvc", + field_type: "user_card_cvc", + value: null, + }, + "billing.address.line1": { + required_field: "payment_method_data.billing.address.line1", + display_name: "line1", + field_type: "user_address_line1", + value: "1467", + }, + "payment_method_data.card.card_exp_month": { + required_field: "payment_method_data.card.card_exp_month", + display_name: "card_exp_month", + field_type: "user_card_expiry_month", + value: null, + }, + "payment_method_data.card.card_number": { + required_field: "payment_method_data.card.card_number", + display_name: "card_number", + field_type: "user_card_number", + value: null, + }, + "payment_method_data.card.card_exp_year": { + required_field: "payment_method_data.card.card_exp_year", + display_name: "card_exp_year", + field_type: "user_card_expiry_year", + value: null, + }, + }, + }, + ], + }, + ], + }, + pmListDynamicFieldWithNames: { + payment_methods: [ + { + payment_method: "card", + payment_method_types: [ + { + payment_method_type: "credit", + card_networks: [ + { + eligible_connectors: ["cybersource"], + }, + ], + required_fields: { + "billing.address.last_name": { + required_field: + "payment_method_data.billing.address.last_name", + display_name: "card_holder_name", + field_type: "user_full_name", + value: "Doe", + }, + "billing.address.first_name": { + required_field: + "payment_method_data.billing.address.first_name", + display_name: "card_holder_name", + field_type: "user_full_name", + value: "joseph", + }, + }, + }, + ], + }, + ], + }, + pmListDynamicFieldWithEmail: { + payment_methods: [ + { + payment_method: "card", + payment_method_types: [ + { + payment_method_type: "credit", + card_networks: [ + { + eligible_connectors: ["cybersource"], + }, + ], + required_fields: { + "billing.email": { + required_field: "payment_method_data.billing.email", + display_name: "email", + field_type: "user_email_address", + value: "[email protected]", + }, + }, + }, + ], + }, + ], + }, + }, + }, }; diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Stripe.js b/cypress-tests/cypress/e2e/PaymentUtils/Stripe.js index 5c899e87d9c..d68978c4302 100644 --- a/cypress-tests/cypress/e2e/PaymentUtils/Stripe.js +++ b/cypress-tests/cypress/e2e/PaymentUtils/Stripe.js @@ -1,4 +1,4 @@ -import { getCustomExchange } from "./Commons"; +import { cardRequiredField, getCustomExchange } from "./Commons"; const successfulNo3DSCardDetails = { card_number: "4242424242424242", @@ -90,6 +90,25 @@ const payment_method_data_no3ds = { billing: null, }; +const requiredFields = { + payment_methods: [ + { + payment_method: "card", + payment_method_types: [ + { + payment_method_type: "credit", + card_networks: [ + { + eligible_connectors: ["stripe"], + }, + ], + required_fields: cardRequiredField, + }, + ], + }, + ], +}; + export const connectorDetails = { card_pm: { PaymentIntent: { @@ -944,4 +963,15 @@ export const connectorDetails = { }, }, }, + pm_list: { + PmListResponse: { + PmListNull: { + payment_methods: [], + }, + pmListDynamicFieldWithoutBilling: requiredFields, + pmListDynamicFieldWithBilling: requiredFields, + pmListDynamicFieldWithNames: requiredFields, + pmListDynamicFieldWithEmail: requiredFields, + }, + }, }; diff --git a/cypress-tests/cypress/support/commands.js b/cypress-tests/cypress/support/commands.js index 95b981bc600..f3ce856fe38 100644 --- a/cypress-tests/cypress/support/commands.js +++ b/cypress-tests/cypress/support/commands.js @@ -384,21 +384,21 @@ Cypress.Commands.add( ( connectorType, createConnectorBody, - payment_methods_enabled, + paymentMethodsEnabled, globalState, connectorName, connectorLabel, - profile_prefix = "profile", - mca_prefix = "merchantConnector" + profilePrefix = "profile", + mcaPrefix = "merchantConnector" ) => { const merchantId = globalState.get("merchantId"); - const profile_id = globalState.get(`${profile_prefix}Id`); + const profileId = globalState.get(`${profilePrefix}Id`); - createConnectorBody.profile_id = profile_id; + createConnectorBody.profile_id = profileId; createConnectorBody.connector_type = connectorType; createConnectorBody.connector_name = connectorName; createConnectorBody.connector_label = connectorLabel; - createConnectorBody.payment_methods_enabled = payment_methods_enabled; + createConnectorBody.payment_methods_enabled = paymentMethodsEnabled; // readFile is used to read the contents of the file and it always returns a promise ([Object Object]) due to its asynchronous nature // it is best to use then() to handle the response within the same block of code cy.readFile(globalState.get("connectorAuthFilePath")).then( @@ -425,7 +425,7 @@ Cypress.Commands.add( if (response.status === 200) { expect(connectorName).to.equal(response.body.connector_name); globalState.set( - `${mca_prefix}Id`, + `${mcaPrefix}Id`, response.body.merchant_connector_id ); } else { @@ -864,6 +864,64 @@ Cypress.Commands.add( } ); +Cypress.Commands.add( + "paymentMethodListTestWithRequiredFields", + (data, globalState) => { + const apiKey = globalState.get("publishableKey"); + const baseUrl = globalState.get("baseUrl"); + const clientSecret = globalState.get("clientSecret"); + const url = `${baseUrl}/account/payment_methods?client_secret=${clientSecret}`; + + cy.request({ + method: "GET", + url: url, + headers: { + "Content-Type": "application/json", + Accept: "application/json", + "api-key": apiKey, + }, + failOnStatusCode: false, + }).then((response) => { + logRequestId(response.headers["x-request-id"]); + expect(response.headers["content-type"]).to.include("application/json"); + + if (response.status === 200) { + const responsePaymentMethods = response.body["payment_methods"]; + const responseRequiredFields = + responsePaymentMethods[0]["payment_method_types"][0][ + "required_fields" + ]; + + const expectedRequiredFields = + data["payment_methods"][0]["payment_method_types"][0][ + "required_fields" + ]; + + Object.keys(expectedRequiredFields).forEach((key) => { + const expectedField = expectedRequiredFields[key]; + const responseField = responseRequiredFields[key]; + + expect(responseField).to.exist; + expect(responseField.required_field).to.equal( + expectedField.required_field + ); + expect(responseField.display_name).to.equal( + expectedField.display_name + ); + expect(responseField.field_type).to.deep.equal( + expectedField.field_type + ); + expect(responseField.value).to.equal(expectedField.value); + }); + } else { + throw new Error( + `List payment methods failed with status code "${response.status}" and error message "${response.body.error.message}"` + ); + } + }); + } +); + Cypress.Commands.add( "paymentMethodListTestTwoConnectorsForOnePaymentMethodCredit", (resData, globalState) => {
ci
Add Dynamic fields Test Cases (#6703)
67cf33d0894f337839bb35b2a87d3807085e6672
2023-10-10 13:15:44
Shankar Singh C
ci: add workflow to create hotfix branch (#2521)
false
diff --git a/.github/workflows/hotfix-branch-creation.yml b/.github/workflows/hotfix-branch-creation.yml new file mode 100644 index 00000000000..ced5880faf7 --- /dev/null +++ b/.github/workflows/hotfix-branch-creation.yml @@ -0,0 +1,38 @@ +name: Create a new hotfix branch + +on: + workflow_dispatch: + +jobs: + create_branch: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + token: ${{ secrets.AUTO_RELEASE_PAT }} + + - name: Check if the input is valid tag + shell: bash + run: | + if [[ ${{github.ref}} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "::notice::${{github.ref}} is a valid tag." + else + echo "::error::${{github.ref}} is not a valid tag." + exit 1 + fi + + - name: Create hotfix branch + shell: bash + run: | + HOTFIX_BRANCH="hotfix-${GITHUB_REF#refs/tags/v}" + + if git switch --create "$HOTFIX_BRANCH"; then + git push origin "$HOTFIX_BRANCH" + echo "::notice::Created hotfix branch: $HOTFIX_BRANCH" + else + echo "::error::Failed to create hotfix branch" + exit 1 + fi \ No newline at end of file
ci
add workflow to create hotfix branch (#2521)
1d24b04596e6d2f7c44b93501d56fc4fb950bd3b
2024-10-25 15:58:15
Debarati Ghatak
feat(connector): [Novalnet] Integrate Applepay wallet token flow (#6409)
false
diff --git a/crates/connector_configs/toml/development.toml b/crates/connector_configs/toml/development.toml index c903c189b5b..8cb42f33a26 100644 --- a/crates/connector_configs/toml/development.toml +++ b/crates/connector_configs/toml/development.toml @@ -2293,6 +2293,8 @@ type="Text" payment_method_type = "google_pay" [[novalnet.wallet]] payment_method_type = "paypal" +[[novalnet.wallet]] + payment_method_type = "apple_pay" [novalnet.connector_auth.SignatureKey] api_key="Product Activation Key" key1="Payment Access Key" @@ -2319,6 +2321,59 @@ placeholder="Enter Google Pay Merchant Key" required=true type="Text" +[[novalnet.metadata.apple_pay]] +name="certificate" +label="Merchant Certificate (Base64 Encoded)" +placeholder="Enter Merchant Certificate (Base64 Encoded)" +required=true +type="Text" +[[novalnet.metadata.apple_pay]] +name="certificate_keys" +label="Merchant PrivateKey (Base64 Encoded)" +placeholder="Enter Merchant PrivateKey (Base64 Encoded)" +required=true +type="Text" +[[novalnet.metadata.apple_pay]] +name="merchant_identifier" +label="Apple Merchant Identifier" +placeholder="Enter Apple Merchant Identifier" +required=true +type="Text" +[[novalnet.metadata.apple_pay]] +name="display_name" +label="Display Name" +placeholder="Enter Display Name" +required=true +type="Text" +[[novalnet.metadata.apple_pay]] +name="initiative" +label="Domain" +placeholder="Enter Domain" +required=true +type="Select" +options=["web","ios"] +[[novalnet.metadata.apple_pay]] +name="initiative_context" +label="Domain Name" +placeholder="Enter Domain Name" +required=true +type="Text" +[[novalnet.metadata.apple_pay]] +name="merchant_business_country" +label="Merchant Business Country" +placeholder="Enter Merchant Business Country" +required=true +type="Select" +options=[] +[[novalnet.metadata.apple_pay]] +name="payment_processing_details_at" +label="Payment Processing Details At" +placeholder="Enter Payment Processing Details At" +required=true +type="Radio" +options=["Connector"] + + [nuvei] [[nuvei.credit]] payment_method_type = "Mastercard" diff --git a/crates/connector_configs/toml/production.toml b/crates/connector_configs/toml/production.toml index 0e7ffe782f1..b4b12318a6f 100644 --- a/crates/connector_configs/toml/production.toml +++ b/crates/connector_configs/toml/production.toml @@ -1786,6 +1786,8 @@ merchant_secret="Source verification key" payment_method_type = "google_pay" [[novalnet.wallet]] payment_method_type = "paypal" +[[novalnet.wallet]] + payment_method_type = "apple_pay" [novalnet.connector_auth.SignatureKey] api_key="Product Activation Key" key1="Payment Access Key" @@ -1812,6 +1814,58 @@ placeholder="Enter Google Pay Merchant Key" required=true type="Text" +[[novalnet.metadata.apple_pay]] +name="certificate" +label="Merchant Certificate (Base64 Encoded)" +placeholder="Enter Merchant Certificate (Base64 Encoded)" +required=true +type="Text" +[[novalnet.metadata.apple_pay]] +name="certificate_keys" +label="Merchant PrivateKey (Base64 Encoded)" +placeholder="Enter Merchant PrivateKey (Base64 Encoded)" +required=true +type="Text" +[[novalnet.metadata.apple_pay]] +name="merchant_identifier" +label="Apple Merchant Identifier" +placeholder="Enter Apple Merchant Identifier" +required=true +type="Text" +[[novalnet.metadata.apple_pay]] +name="display_name" +label="Display Name" +placeholder="Enter Display Name" +required=true +type="Text" +[[novalnet.metadata.apple_pay]] +name="initiative" +label="Domain" +placeholder="Enter Domain" +required=true +type="Select" +options=["web","ios"] +[[novalnet.metadata.apple_pay]] +name="initiative_context" +label="Domain Name" +placeholder="Enter Domain Name" +required=true +type="Text" +[[novalnet.metadata.apple_pay]] +name="merchant_business_country" +label="Merchant Business Country" +placeholder="Enter Merchant Business Country" +required=true +type="Select" +options=[] +[[novalnet.metadata.apple_pay]] +name="payment_processing_details_at" +label="Payment Processing Details At" +placeholder="Enter Payment Processing Details At" +required=true +type="Radio" +options=["Connector"] + [nuvei] [[nuvei.credit]] payment_method_type = "Mastercard" diff --git a/crates/connector_configs/toml/sandbox.toml b/crates/connector_configs/toml/sandbox.toml index 8f8ec9bc1c1..7e83effb7a8 100644 --- a/crates/connector_configs/toml/sandbox.toml +++ b/crates/connector_configs/toml/sandbox.toml @@ -2260,6 +2260,8 @@ type="Text" payment_method_type = "google_pay" [[novalnet.wallet]] payment_method_type = "paypal" +[[novalnet.wallet]] + payment_method_type = "apple_pay" [novalnet.connector_auth.SignatureKey] api_key="Product Activation Key" key1="Payment Access Key" @@ -2286,6 +2288,58 @@ placeholder="Enter Google Pay Merchant Key" required=true type="Text" +[[novalnet.metadata.apple_pay]] +name="certificate" +label="Merchant Certificate (Base64 Encoded)" +placeholder="Enter Merchant Certificate (Base64 Encoded)" +required=true +type="Text" +[[novalnet.metadata.apple_pay]] +name="certificate_keys" +label="Merchant PrivateKey (Base64 Encoded)" +placeholder="Enter Merchant PrivateKey (Base64 Encoded)" +required=true +type="Text" +[[novalnet.metadata.apple_pay]] +name="merchant_identifier" +label="Apple Merchant Identifier" +placeholder="Enter Apple Merchant Identifier" +required=true +type="Text" +[[novalnet.metadata.apple_pay]] +name="display_name" +label="Display Name" +placeholder="Enter Display Name" +required=true +type="Text" +[[novalnet.metadata.apple_pay]] +name="initiative" +label="Domain" +placeholder="Enter Domain" +required=true +type="Select" +options=["web","ios"] +[[novalnet.metadata.apple_pay]] +name="initiative_context" +label="Domain Name" +placeholder="Enter Domain Name" +required=true +type="Text" +[[novalnet.metadata.apple_pay]] +name="merchant_business_country" +label="Merchant Business Country" +placeholder="Enter Merchant Business Country" +required=true +type="Select" +options=[] +[[novalnet.metadata.apple_pay]] +name="payment_processing_details_at" +label="Payment Processing Details At" +placeholder="Enter Payment Processing Details At" +required=true +type="Radio" +options=["Connector"] + [nuvei] [[nuvei.credit]] payment_method_type = "Mastercard" diff --git a/crates/hyperswitch_connectors/src/connectors/novalnet.rs b/crates/hyperswitch_connectors/src/connectors/novalnet.rs index acb3013dbaa..7450a48884a 100644 --- a/crates/hyperswitch_connectors/src/connectors/novalnet.rs +++ b/crates/hyperswitch_connectors/src/connectors/novalnet.rs @@ -199,6 +199,7 @@ impl ConnectorValidation for Novalnet { PaymentMethodDataType::Card, PaymentMethodDataType::GooglePay, PaymentMethodDataType::PaypalRedirect, + PaymentMethodDataType::ApplePay, ]); utils::is_mandate_supported(pm_data, pm_type, mandate_supported_pmd, self.id()) } diff --git a/crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs b/crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs index 1f16a14fde3..577a587cf1a 100644 --- a/crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs +++ b/crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs @@ -33,8 +33,7 @@ use crate::{ types::{RefundsResponseRouterData, ResponseRouterData}, utils::{ self, BrowserInformationData, PaymentsAuthorizeRequestData, PaymentsCancelRequestData, - PaymentsCaptureRequestData, PaymentsSyncRequestData, RefundsRequestData, - RouterData as OtherRouterData, + PaymentsCaptureRequestData, PaymentsSyncRequestData, RefundsRequestData, RouterData as _, }, }; @@ -57,6 +56,7 @@ pub enum NovalNetPaymentTypes { CREDITCARD, PAYPAL, GOOGLEPAY, + APPLEPAY, } #[derive(Default, Debug, Serialize, Clone)] @@ -103,11 +103,17 @@ pub struct NovalnetGooglePay { wallet_data: Secret<String>, } +#[derive(Default, Debug, Clone, Serialize, Deserialize)] +pub struct NovalnetApplePay { + wallet_data: Secret<String>, +} + #[derive(Debug, Serialize, Deserialize, Clone)] #[serde(untagged)] pub enum NovalNetPaymentData { Card(NovalnetCard), GooglePay(NovalnetGooglePay), + ApplePay(NovalnetApplePay), MandatePayment(NovalnetMandate), } @@ -143,38 +149,9 @@ impl TryFrom<&api_enums::PaymentMethodType> for NovalNetPaymentTypes { type Error = error_stack::Report<errors::ConnectorError>; fn try_from(item: &api_enums::PaymentMethodType) -> Result<Self, Self::Error> { match item { + api_enums::PaymentMethodType::ApplePay => Ok(Self::APPLEPAY), api_enums::PaymentMethodType::Credit => Ok(Self::CREDITCARD), - api_enums::PaymentMethodType::Debit - | api_enums::PaymentMethodType::Klarna - | api_enums::PaymentMethodType::BancontactCard - | api_enums::PaymentMethodType::Blik - | api_enums::PaymentMethodType::Eps - | api_enums::PaymentMethodType::Giropay - | api_enums::PaymentMethodType::Ideal - | api_enums::PaymentMethodType::OnlineBankingCzechRepublic - | api_enums::PaymentMethodType::OnlineBankingFinland - | api_enums::PaymentMethodType::OnlineBankingPoland - | api_enums::PaymentMethodType::OnlineBankingSlovakia - | api_enums::PaymentMethodType::Sofort - | api_enums::PaymentMethodType::Trustly => { - Err(errors::ConnectorError::NotImplemented( - utils::get_unimplemented_payment_method_error_message("Novalnet"), - ))? - } api_enums::PaymentMethodType::GooglePay => Ok(Self::GOOGLEPAY), - api_enums::PaymentMethodType::AliPay - | api_enums::PaymentMethodType::ApplePay - | api_enums::PaymentMethodType::AliPayHk - | api_enums::PaymentMethodType::MbWay - | api_enums::PaymentMethodType::MobilePay - | api_enums::PaymentMethodType::WeChatPay - | api_enums::PaymentMethodType::SamsungPay - | api_enums::PaymentMethodType::Affirm - | api_enums::PaymentMethodType::AfterpayClearpay - | api_enums::PaymentMethodType::PayBright - | api_enums::PaymentMethodType::Walley => Err(errors::ConnectorError::NotImplemented( - utils::get_unimplemented_payment_method_error_message("Novalnet"), - ))?, api_enums::PaymentMethodType::Paypal => Ok(Self::PAYPAL), _ => Err(errors::ConnectorError::NotImplemented( utils::get_unimplemented_payment_method_error_message("Novalnet"), @@ -299,6 +276,30 @@ impl TryFrom<&NovalnetRouterData<&PaymentsAuthorizeRouterData>> for NovalnetPaym return_url: None, error_return_url: None, payment_data: Some(novalnet_google_pay), + enforce_3d, + create_token, + }; + + Ok(Self { + merchant, + transaction, + customer, + custom, + }) + } + WalletDataPaymentMethod::ApplePay(payment_method_data) => { + let transaction = NovalnetPaymentsRequestTransaction { + test_mode, + payment_type: NovalNetPaymentTypes::APPLEPAY, + amount: item.amount.clone(), + currency: item.router_data.request.currency, + order_no: item.router_data.connector_request_reference_id.clone(), + hook_url: Some(hook_url), + return_url: None, + error_return_url: None, + payment_data: Some(NovalNetPaymentData::ApplePay(NovalnetApplePay { + wallet_data: Secret::new(payment_method_data.payment_data.clone()), + })), enforce_3d: None, create_token, }; @@ -310,8 +311,7 @@ impl TryFrom<&NovalnetRouterData<&PaymentsAuthorizeRouterData>> for NovalnetPaym custom, }) } - WalletDataPaymentMethod::ApplePay(_) - | WalletDataPaymentMethod::AliPayQr(_) + WalletDataPaymentMethod::AliPayQr(_) | WalletDataPaymentMethod::AliPayRedirect(_) | WalletDataPaymentMethod::AliPayHkRedirect(_) | WalletDataPaymentMethod::MomoRedirect(_) @@ -578,14 +578,11 @@ impl<F, T> TryFrom<ResponseRouterData<F, NovalnetPaymentsResponse, T, PaymentsRe .and_then(|transaction_data| transaction_data.status) .unwrap_or(if redirection_data.is_some() { NovalnetTransactionStatus::Progress - } else if mandate_reference_id.is_some() { - NovalnetTransactionStatus::OnHold + // NOTE: Novalnet does not send us the transaction.status for redirection flow + // so status is mapped to Progress if flow has redirection data } else { NovalnetTransactionStatus::Pending }); - // NOTE: if result.status is success, we should always get a redirection url for 3DS flow - // since Novalnet does not always send the transaction.status - // so default value is kept as Progress if flow is 3ds, otherwise default value is kept as Pending Ok(Self { status: common_enums::AttemptStatus::from(transaction_status),
feat
[Novalnet] Integrate Applepay wallet token flow (#6409)
2e97869fa0e284e1ab3bcaf940b627acf47d98e3
2023-09-26 12:02:25
chikke srujan
refactor(connector): [Paypal]Enhance currency Mapping with ConnectorCurrencyCommon Trait (#2191)
false
diff --git a/crates/router/src/connector/paypal.rs b/crates/router/src/connector/paypal.rs index f6b29aa675d..4aa50bb2d67 100644 --- a/crates/router/src/connector/paypal.rs +++ b/crates/router/src/connector/paypal.rs @@ -134,6 +134,10 @@ impl ConnectorCommon for Paypal { "paypal" } + fn get_currency_unit(&self) -> api::CurrencyUnit { + api::CurrencyUnit::Base + } + fn common_get_content_type(&self) -> &'static str { "application/json" } @@ -344,7 +348,13 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P &self, req: &types::PaymentsAuthorizeRouterData, ) -> CustomResult<Option<types::RequestBody>, errors::ConnectorError> { - let req_obj = paypal::PaypalPaymentsRequest::try_from(req)?; + let connector_router_data = paypal::PaypalRouterData::try_from(( + &self.get_currency_unit(), + req.request.currency, + req.request.amount, + req, + ))?; + let req_obj = paypal::PaypalPaymentsRequest::try_from(&connector_router_data)?; let paypal_req = types::RequestBody::log_and_get_request_body( &req_obj, utils::Encode::<paypal::PaypalPaymentsRequest>::encode_to_string_of_json, @@ -626,7 +636,13 @@ impl ConnectorIntegration<api::Capture, types::PaymentsCaptureData, types::Payme &self, req: &types::PaymentsCaptureRouterData, ) -> CustomResult<Option<types::RequestBody>, errors::ConnectorError> { - let connector_req = paypal::PaypalPaymentsCaptureRequest::try_from(req)?; + let connector_router_data = paypal::PaypalRouterData::try_from(( + &self.get_currency_unit(), + req.request.currency, + req.request.amount_to_capture, + req, + ))?; + let connector_req = paypal::PaypalPaymentsCaptureRequest::try_from(&connector_router_data)?; let paypal_req = types::RequestBody::log_and_get_request_body( &connector_req, utils::Encode::<paypal::PaypalPaymentsCaptureRequest>::encode_to_string_of_json, @@ -781,7 +797,13 @@ impl ConnectorIntegration<api::Execute, types::RefundsData, types::RefundsRespon &self, req: &types::RefundsRouterData<api::Execute>, ) -> CustomResult<Option<types::RequestBody>, errors::ConnectorError> { - let req_obj = paypal::PaypalRefundRequest::try_from(req)?; + let connector_router_data = paypal::PaypalRouterData::try_from(( + &self.get_currency_unit(), + req.request.currency, + req.request.refund_amount, + req, + ))?; + let req_obj = paypal::PaypalRefundRequest::try_from(&connector_router_data)?; let paypal_req = types::RequestBody::log_and_get_request_body( &req_obj, utils::Encode::<paypal::PaypalRefundRequest>::encode_to_string_of_json, diff --git a/crates/router/src/connector/paypal/transformers.rs b/crates/router/src/connector/paypal/transformers.rs index 377895fa63f..bf40cf0a935 100644 --- a/crates/router/src/connector/paypal/transformers.rs +++ b/crates/router/src/connector/paypal/transformers.rs @@ -18,6 +18,37 @@ use crate::{ }, }; +#[derive(Debug, Serialize)] +pub struct PaypalRouterData<T> { + pub amount: String, + pub router_data: T, +} + +impl<T> + TryFrom<( + &types::api::CurrencyUnit, + types::storage::enums::Currency, + i64, + T, + )> for PaypalRouterData<T> +{ + type Error = error_stack::Report<errors::ConnectorError>; + fn try_from( + (currency_unit, currency, amount, item): ( + &types::api::CurrencyUnit, + types::storage::enums::Currency, + i64, + T, + ), + ) -> Result<Self, Self::Error> { + let amount = utils::get_amount_as_string(currency_unit, amount, currency)?; + Ok(Self { + amount, + router_data: item, + }) + } +} + mod webhook_headers { pub const PAYPAL_TRANSMISSION_ID: &str = "paypal-transmission-id"; pub const PAYPAL_TRANSMISSION_TIME: &str = "paypal-transmission-time"; @@ -195,34 +226,33 @@ fn get_payment_source( } } -impl TryFrom<&types::PaymentsAuthorizeRouterData> for PaypalPaymentsRequest { +impl TryFrom<&PaypalRouterData<&types::PaymentsAuthorizeRouterData>> for PaypalPaymentsRequest { type Error = error_stack::Report<errors::ConnectorError>; - fn try_from(item: &types::PaymentsAuthorizeRouterData) -> Result<Self, Self::Error> { - match item.request.payment_method_data { + fn try_from( + item: &PaypalRouterData<&types::PaymentsAuthorizeRouterData>, + ) -> Result<Self, Self::Error> { + match item.router_data.request.payment_method_data { api_models::payments::PaymentMethodData::Card(ref ccard) => { - let intent = if item.request.is_auto_capture()? { + let intent = if item.router_data.request.is_auto_capture()? { PaypalPaymentIntent::Capture } else { PaypalPaymentIntent::Authorize }; let amount = OrderAmount { - currency_code: item.request.currency, - value: utils::to_currency_base_unit_with_zero_decimal_check( - item.request.amount, - item.request.currency, - )?, + currency_code: item.router_data.request.currency, + value: item.amount.to_owned(), }; - let reference_id = item.attempt_id.clone(); + let reference_id = item.router_data.attempt_id.clone(); let purchase_units = vec![PurchaseUnitRequest { reference_id, amount, }]; - let card = item.request.get_card()?; + let card = item.router_data.request.get_card()?; let expiry = Some(card.get_expiry_date_as_yyyymm("-")); let payment_source = Some(PaymentSourceItem::Card(CardRequest { - billing_address: get_address_info(item.address.billing.as_ref())?, + billing_address: get_address_info(item.router_data.address.billing.as_ref())?, expiry, name: ccard.card_holder_name.clone(), number: Some(ccard.card_number.clone()), @@ -237,19 +267,16 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for PaypalPaymentsRequest { } api::PaymentMethodData::Wallet(ref wallet_data) => match wallet_data { api_models::payments::WalletData::PaypalRedirect(_) => { - let intent = if item.request.is_auto_capture()? { + let intent = if item.router_data.request.is_auto_capture()? { PaypalPaymentIntent::Capture } else { PaypalPaymentIntent::Authorize }; let amount = OrderAmount { - currency_code: item.request.currency, - value: utils::to_currency_base_unit_with_zero_decimal_check( - item.request.amount, - item.request.currency, - )?, + currency_code: item.router_data.request.currency, + value: item.amount.to_owned(), }; - let reference_id = item.attempt_id.clone(); + let reference_id = item.router_data.attempt_id.clone(); let purchase_units = vec![PurchaseUnitRequest { reference_id, amount, @@ -257,8 +284,8 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for PaypalPaymentsRequest { let payment_source = Some(PaymentSourceItem::Paypal(PaypalRedirectionRequest { experience_context: ContextStruct { - return_url: item.request.complete_authorize_url.clone(), - cancel_url: item.request.complete_authorize_url.clone(), + return_url: item.router_data.request.complete_authorize_url.clone(), + cancel_url: item.router_data.request.complete_authorize_url.clone(), }, })); @@ -300,7 +327,7 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for PaypalPaymentsRequest { } }, api::PaymentMethodData::BankRedirect(ref bank_redirection_data) => { - let intent = if item.request.is_auto_capture()? { + let intent = if item.router_data.request.is_auto_capture()? { PaypalPaymentIntent::Capture } else { Err(errors::ConnectorError::FlowNotSupported { @@ -309,18 +336,16 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for PaypalPaymentsRequest { })? }; let amount = OrderAmount { - currency_code: item.request.currency, - value: utils::to_currency_base_unit_with_zero_decimal_check( - item.request.amount, - item.request.currency, - )?, + currency_code: item.router_data.request.currency, + value: item.amount.to_owned(), }; - let reference_id = item.attempt_id.clone(); + let reference_id = item.router_data.attempt_id.clone(); let purchase_units = vec![PurchaseUnitRequest { reference_id, amount, }]; - let payment_source = Some(get_payment_source(item, bank_redirection_data)?); + let payment_source = + Some(get_payment_source(item.router_data, bank_redirection_data)?); Ok(Self { intent, @@ -869,15 +894,16 @@ pub struct PaypalPaymentsCaptureRequest { final_capture: bool, } -impl TryFrom<&types::PaymentsCaptureRouterData> for PaypalPaymentsCaptureRequest { +impl TryFrom<&PaypalRouterData<&types::PaymentsCaptureRouterData>> + for PaypalPaymentsCaptureRequest +{ type Error = error_stack::Report<errors::ConnectorError>; - fn try_from(item: &types::PaymentsCaptureRouterData) -> Result<Self, Self::Error> { + fn try_from( + item: &PaypalRouterData<&types::PaymentsCaptureRouterData>, + ) -> Result<Self, Self::Error> { let amount = OrderAmount { - currency_code: item.request.currency, - value: utils::to_currency_base_unit_with_zero_decimal_check( - item.request.amount_to_capture, - item.request.currency, - )?, + currency_code: item.router_data.request.currency, + value: item.amount.to_owned(), }; Ok(Self { amount, @@ -1011,16 +1037,15 @@ pub struct PaypalRefundRequest { pub amount: OrderAmount, } -impl<F> TryFrom<&types::RefundsRouterData<F>> for PaypalRefundRequest { +impl<F> TryFrom<&PaypalRouterData<&types::RefundsRouterData<F>>> for PaypalRefundRequest { type Error = error_stack::Report<errors::ConnectorError>; - fn try_from(item: &types::RefundsRouterData<F>) -> Result<Self, Self::Error> { + fn try_from( + item: &PaypalRouterData<&types::RefundsRouterData<F>>, + ) -> Result<Self, Self::Error> { Ok(Self { amount: OrderAmount { - currency_code: item.request.currency, - value: utils::to_currency_base_unit_with_zero_decimal_check( - item.request.refund_amount, - item.request.currency, - )?, + currency_code: item.router_data.request.currency, + value: item.amount.to_owned(), }, }) }
refactor
[Paypal]Enhance currency Mapping with ConnectorCurrencyCommon Trait (#2191)
d152c3a1ca70c39f5c64edf63b5995f6cf02c88a
2024-01-05 18:58:55
Sagar naik
fix(analytics): added response to the connector outgoing event (#3129)
false
diff --git a/crates/analytics/docs/clickhouse/scripts/api_events_v2.sql b/crates/analytics/docs/clickhouse/scripts/api_events.sql similarity index 83% rename from crates/analytics/docs/clickhouse/scripts/api_events_v2.sql rename to crates/analytics/docs/clickhouse/scripts/api_events.sql index 33f158ce48b..c3fc3d7b06d 100644 --- a/crates/analytics/docs/clickhouse/scripts/api_events_v2.sql +++ b/crates/analytics/docs/clickhouse/scripts/api_events.sql @@ -1,4 +1,4 @@ -CREATE TABLE api_events_v2_queue ( +CREATE TABLE api_events_queue ( `merchant_id` String, `payment_id` Nullable(String), `refund_id` Nullable(String), @@ -14,12 +14,15 @@ CREATE TABLE api_events_v2_queue ( `api_auth_type` LowCardinality(String), `request` String, `response` Nullable(String), + `error` Nullable(String), `authentication_data` Nullable(String), `status_code` UInt32, - `created_at` DateTime CODEC(T64, LZ4), + `created_at_timestamp` DateTime64(3), `latency` UInt128, `user_agent` String, `ip_addr` String, + `hs_latency` Nullable(UInt128), + `http_method` LowCardinality(String), `url_path` String ) ENGINE = Kafka SETTINGS kafka_broker_list = 'kafka0:29092', kafka_topic_list = 'hyperswitch-api-log-events', @@ -28,7 +31,7 @@ kafka_format = 'JSONEachRow', kafka_handle_error_mode = 'stream'; -CREATE TABLE api_events_v2_dist ( +CREATE TABLE api_events_dist ( `merchant_id` String, `payment_id` Nullable(String), `refund_id` Nullable(String), @@ -44,13 +47,15 @@ CREATE TABLE api_events_v2_dist ( `api_auth_type` LowCardinality(String), `request` String, `response` Nullable(String), + `error` Nullable(String), `authentication_data` Nullable(String), `status_code` UInt32, - `created_at` DateTime CODEC(T64, LZ4), - `inserted_at` DateTime CODEC(T64, LZ4), + `created_at_timestamp` DateTime64(3), `latency` UInt128, `user_agent` String, `ip_addr` String, + `hs_latency` Nullable(UInt128), + `http_method` LowCardinality(String), `url_path` String, INDEX flowIndex flow_type TYPE bloom_filter GRANULARITY 1, INDEX apiIndex api_flow TYPE bloom_filter GRANULARITY 1, @@ -62,7 +67,7 @@ ORDER BY TTL created_at + toIntervalMonth(6) ; -CREATE MATERIALIZED VIEW api_events_v2_mv TO api_events_v2_dist ( +CREATE MATERIALIZED VIEW api_events_mv TO api_events_dist ( `merchant_id` String, `payment_id` Nullable(String), `refund_id` Nullable(String), @@ -78,13 +83,15 @@ CREATE MATERIALIZED VIEW api_events_v2_mv TO api_events_v2_dist ( `api_auth_type` LowCardinality(String), `request` String, `response` Nullable(String), + `error` Nullable(String), `authentication_data` Nullable(String), `status_code` UInt32, - `created_at` DateTime CODEC(T64, LZ4), - `inserted_at` DateTime CODEC(T64, LZ4), + `created_at_timestamp` DateTime64(3), `latency` UInt128, `user_agent` String, `ip_addr` String, + `hs_latency` Nullable(UInt128), + `http_method` LowCardinality(String), `url_path` String ) AS SELECT @@ -103,16 +110,19 @@ SELECT api_auth_type, request, response, + error, authentication_data, status_code, - created_at, + created_at_timestamp, now() as inserted_at, latency, user_agent, ip_addr, + hs_latency, + http_method, url_path FROM - api_events_v2_queue + api_events_queue where length(_error) = 0; @@ -133,6 +143,6 @@ SELECT _offset AS offset, _raw_message AS raw, _error AS error -FROM api_events_v2_queue +FROM api_events_queue WHERE length(_error) > 0 ; diff --git a/crates/analytics/docs/clickhouse/scripts/connector_events.sql b/crates/analytics/docs/clickhouse/scripts/connector_events.sql new file mode 100644 index 00000000000..5821cd03556 --- /dev/null +++ b/crates/analytics/docs/clickhouse/scripts/connector_events.sql @@ -0,0 +1,97 @@ +CREATE TABLE connector_events_queue ( + `merchant_id` String, + `payment_id` Nullable(String), + `connector_name` LowCardinality(String), + `request_id` String, + `flow` LowCardinality(String), + `request` String, + `response` Nullable(String), + `error` Nullable(String), + `status_code` UInt32, + `created_at` DateTime64(3), + `latency` UInt128, + `method` LowCardinality(String) +) ENGINE = Kafka SETTINGS kafka_broker_list = 'kafka0:29092', +kafka_topic_list = 'hyperswitch-connector-api-events', +kafka_group_name = 'hyper-c1', +kafka_format = 'JSONEachRow', +kafka_handle_error_mode = 'stream'; + + +CREATE TABLE connector_events_dist ( + `merchant_id` String, + `payment_id` Nullable(String), + `connector_name` LowCardinality(String), + `request_id` String, + `flow` LowCardinality(String), + `request` String, + `response` Nullable(String), + `error` Nullable(String), + `status_code` UInt32, + `created_at` DateTime64(3), + `inserted_at` DateTime64(3), + `latency` UInt128, + `method` LowCardinality(String), + INDEX flowIndex flowTYPE bloom_filter GRANULARITY 1, + INDEX connectorIndex connector_name TYPE bloom_filter GRANULARITY 1, + INDEX statusIndex status_code TYPE bloom_filter GRANULARITY 1 +) ENGINE = MergeTree +PARTITION BY toStartOfDay(created_at) +ORDER BY + (created_at, merchant_id, flow_type, status_code, api_flow) +TTL created_at + toIntervalMonth(6) +; + +CREATE MATERIALIZED VIEW connector_events_mv TO connector_events_dist ( + `merchant_id` String, + `payment_id` Nullable(String), + `connector_name` LowCardinality(String), + `request_id` String, + `flow` LowCardinality(String), + `request` String, + `response` Nullable(String), + `error` Nullable(String), + `status_code` UInt32, + `created_at` DateTime64(3), + `latency` UInt128, + `method` LowCardinality(String) +) AS +SELECT + merchant_id, + payment_id, + connector_name, + request_id, + flow, + request, + response, + error, + status_code, + created_at, + now() as inserted_at, + latency, + method, +FROM + connector_events_queue +where length(_error) = 0; + + +CREATE MATERIALIZED VIEW connector_events_parse_errors +( + `topic` String, + `partition` Int64, + `offset` Int64, + `raw` String, + `error` String +) +ENGINE = MergeTree +ORDER BY (topic, partition, offset) +SETTINGS index_granularity = 8192 AS +SELECT + _topic AS topic, + _partition AS partition, + _offset AS offset, + _raw_message AS raw, + _error AS error +FROM connector_events_queue +WHERE length(_error) > 0 +; diff --git a/crates/common_utils/src/events.rs b/crates/common_utils/src/events.rs index c9efbb73c20..6bbf78afe42 100644 --- a/crates/common_utils/src/events.rs +++ b/crates/common_utils/src/events.rs @@ -40,7 +40,10 @@ pub enum ApiEventsType { }, Routing, ResourceListAPI, - PaymentRedirectionResponse, + PaymentRedirectionResponse { + connector: Option<String>, + payment_id: Option<String>, + }, Gsm, // TODO: This has to be removed once the corresponding apiEventTypes are created Miscellaneous, diff --git a/crates/router/src/events/api_logs.rs b/crates/router/src/events/api_logs.rs index 42017f4500e..78a66d2f04e 100644 --- a/crates/router/src/events/api_logs.rs +++ b/crates/router/src/events/api_logs.rs @@ -116,7 +116,6 @@ impl_misc_api_event_type!( AttachEvidenceRequest, DisputeId, PaymentLinkFormData, - PaymentsRedirectResponseData, ConfigUpdate ); @@ -131,3 +130,15 @@ impl_misc_api_event_type!( DummyConnectorRefundResponse, DummyConnectorRefundRequest ); + +impl ApiEventMetric for PaymentsRedirectResponseData { + fn get_api_event_type(&self) -> Option<ApiEventsType> { + Some(ApiEventsType::PaymentRedirectionResponse { + connector: self.connector.clone(), + payment_id: match &self.resource_id { + api_models::payments::PaymentIdType::PaymentIntentId(id) => Some(id.clone()), + _ => None, + }, + }) + } +} diff --git a/crates/router/src/services/api.rs b/crates/router/src/services/api.rs index 8298d9a105b..ba3607fb7dc 100644 --- a/crates/router/src/services/api.rs +++ b/crates/router/src/services/api.rs @@ -377,7 +377,17 @@ where req.connector.clone(), std::any::type_name::<T>(), masked_request_body, - None, + response + .as_ref() + .map(|response| { + response + .as_ref() + .map_or_else(|value| value, |value| value) + .response + .escape_ascii() + .to_string() + }) + .ok(), request_url, request_method, req.payment_id.clone(), diff --git a/crates/router/src/services/kafka.rs b/crates/router/src/services/kafka.rs index 5a6d7043e6d..2b29a61b4a4 100644 --- a/crates/router/src/services/kafka.rs +++ b/crates/router/src/services/kafka.rs @@ -8,12 +8,9 @@ use rdkafka::{ }; use crate::events::EventType; -mod api_event; -pub mod outgoing_request; mod payment_attempt; mod payment_intent; mod refund; -pub use api_event::{ApiCallEventType, ApiEvents, ApiEventsType}; use data_models::payments::{payment_attempt::PaymentAttempt, PaymentIntent}; use diesel_models::refund::Refund; use serde::Serialize; @@ -300,11 +297,6 @@ impl KafkaProducer { }) } - pub async fn log_api_event(&self, event: &ApiEvents) -> MQResult<()> { - self.log_kafka_event(&self.api_logs_topic, event) - .attach_printable_lazy(|| format!("Failed to add api log event {event:?}")) - } - pub fn get_topic(&self, event: EventType) -> &str { match event { EventType::ApiLogs => &self.api_logs_topic, diff --git a/crates/router/src/services/kafka/api_event.rs b/crates/router/src/services/kafka/api_event.rs deleted file mode 100644 index 7de27191592..00000000000 --- a/crates/router/src/services/kafka/api_event.rs +++ /dev/null @@ -1,108 +0,0 @@ -use api_models::enums as api_enums; -use serde::{Deserialize, Serialize}; -use time::OffsetDateTime; - -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] -#[serde(tag = "flow_type")] -pub enum ApiEventsType { - Payment { - payment_id: String, - }, - Refund { - payment_id: String, - refund_id: String, - }, - Default, - PaymentMethod { - payment_method_id: String, - payment_method: Option<api_enums::PaymentMethod>, - payment_method_type: Option<api_enums::PaymentMethodType>, - }, - Customer { - customer_id: String, - }, - User { - //specified merchant_id will overridden on global defined - merchant_id: String, - user_id: String, - }, - Webhooks { - connector: String, - payment_id: Option<String>, - }, - OutgoingEvent, -} - -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] -pub struct ApiEvents { - pub api_name: String, - pub request_id: Option<String>, - //It is require to solve ambiquity in case of event_type is User - #[serde(skip_serializing_if = "Option::is_none")] - pub merchant_id: Option<String>, - pub request: String, - pub response: String, - pub status_code: u16, - #[serde(with = "time::serde::timestamp")] - pub created_at: OffsetDateTime, - pub latency: u128, - //conflicting fields underlying enums will be used - #[serde(flatten)] - pub event_type: ApiEventsType, - pub user_agent: Option<String>, - pub ip_addr: Option<String>, - pub url_path: Option<String>, - pub api_event_type: Option<ApiCallEventType>, -} - -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] -pub enum ApiCallEventType { - IncomingApiEvent, - OutgoingApiEvent, -} - -impl super::KafkaMessage for ApiEvents { - fn key(&self) -> String { - match &self.event_type { - ApiEventsType::Payment { payment_id } => format!( - "{}_{}", - self.merchant_id - .as_ref() - .unwrap_or(&"default_merchant_id".to_string()), - payment_id - ), - ApiEventsType::Refund { - payment_id, - refund_id, - } => format!("{payment_id}_{refund_id}"), - ApiEventsType::Default => "key".to_string(), - ApiEventsType::PaymentMethod { - payment_method_id, - payment_method, - payment_method_type, - } => format!( - "{:?}_{:?}_{:?}", - payment_method_id.clone(), - payment_method.clone(), - payment_method_type.clone(), - ), - ApiEventsType::Customer { customer_id } => customer_id.to_string(), - ApiEventsType::User { - merchant_id, - user_id, - } => format!("{}_{}", merchant_id, user_id), - ApiEventsType::Webhooks { - connector, - payment_id, - } => format!( - "webhook_{}_{connector}", - payment_id.clone().unwrap_or_default() - ), - ApiEventsType::OutgoingEvent => "outgoing_event".to_string(), - } - } - - fn creation_timestamp(&self) -> Option<i64> { - Some(self.created_at.unix_timestamp()) - } -} diff --git a/crates/router/src/services/kafka/outgoing_request.rs b/crates/router/src/services/kafka/outgoing_request.rs deleted file mode 100644 index bb09fe91fe6..00000000000 --- a/crates/router/src/services/kafka/outgoing_request.rs +++ /dev/null @@ -1,19 +0,0 @@ -use reqwest::Url; - -pub struct OutgoingRequest { - pub url: Url, - pub latency: u128, -} - -// impl super::KafkaMessage for OutgoingRequest { -// fn key(&self) -> String { -// format!( -// "{}_{}", - -// ) -// } - -// fn creation_timestamp(&self) -> Option<i64> { -// Some(self.created_at.unix_timestamp()) -// } -// }
fix
added response to the connector outgoing event (#3129)
029e3894fec3b998af7c280ed85caaf3862689f9
2023-03-24 14:31:59
Sanchith Hegde
refactor: extract kms module to `external_services` crate (#793)
false
diff --git a/Cargo.lock b/Cargo.lock index c2227a49876..3d84539f0de 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1618,6 +1618,22 @@ version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +[[package]] +name = "external_services" +version = "0.1.0" +dependencies = [ + "aws-config", + "aws-sdk-kms", + "base64 0.21.0", + "common_utils", + "error-stack", + "once_cell", + "router_env", + "serde", + "thiserror", + "tokio", +] + [[package]] name = "fake" version = "2.5.0" @@ -3433,8 +3449,6 @@ dependencies = [ "async-bb8-diesel", "async-trait", "awc", - "aws-config", - "aws-sdk-kms", "base64 0.21.0", "bb8", "blake3", @@ -3448,6 +3462,7 @@ dependencies = [ "dyn-clone", "encoding_rs", "error-stack", + "external_services", "frunk", "frunk_core", "futures", diff --git a/crates/drainer/src/env.rs b/crates/drainer/src/env.rs index a961a2dddd2..33ba2a5983e 100644 --- a/crates/drainer/src/env.rs +++ b/crates/drainer/src/env.rs @@ -18,6 +18,7 @@ pub mod logger { vec![ "drainer", "common_utils", + "external_services", "redis_interface", "router_env", "storage_models", diff --git a/crates/external_services/Cargo.toml b/crates/external_services/Cargo.toml new file mode 100644 index 00000000000..9d863529457 --- /dev/null +++ b/crates/external_services/Cargo.toml @@ -0,0 +1,25 @@ +[package] +name = "external_services" +description = "Interactions of the router with external systems" +version = "0.1.0" +edition = "2021" +rust-version = "1.65" +readme = "README.md" +license = "Apache-2.0" + +[features] +kms = ["dep:aws-config", "dep:aws-sdk-kms"] + +[dependencies] +aws-config = { version = "0.54.1", optional = true } +aws-sdk-kms = { version = "0.24.0", optional = true } +base64 = "0.21.0" +error-stack = "0.3.1" +once_cell = "1.17.1" +serde = { version = "1.0.155", features = ["derive"] } +thiserror = "1.0.39" +tokio = "1.26.0" + +# First party crates +common_utils = { version = "0.1.0", path = "../common_utils" } +router_env = { version = "0.1.0", path = "../router_env", features = ["log_extra_implicit_fields", "log_custom_entries_to_extra"] } diff --git a/crates/external_services/README.md b/crates/external_services/README.md new file mode 100644 index 00000000000..9d1d4116cfa --- /dev/null +++ b/crates/external_services/README.md @@ -0,0 +1,4 @@ +# External Services + +This crate includes interactions with external systems, which may be shared +across crates within this workspace. diff --git a/crates/router/src/services/kms.rs b/crates/external_services/src/kms.rs similarity index 50% rename from crates/router/src/services/kms.rs rename to crates/external_services/src/kms.rs index 30965aa7ed0..cb4203d8f9a 100644 --- a/crates/router/src/services/kms.rs +++ b/crates/external_services/src/kms.rs @@ -1,23 +1,35 @@ +//! Interactions with the AWS KMS SDK + use aws_config::meta::region::RegionProviderChain; use aws_sdk_kms::{types::Blob, Client, Region}; use base64::Engine; +use common_utils::errors::CustomResult; use error_stack::{IntoReport, ResultExt}; +use router_env::logger; -use crate::{ - configs::settings, - consts, - core::errors::{self, CustomResult}, - logger, - routes::metrics, -}; +use crate::{consts, metrics}; static KMS_CLIENT: tokio::sync::OnceCell<KmsClient> = tokio::sync::OnceCell::const_new(); +/// Returns a shared KMS client, or initializes a new one if not previously initialized. #[inline] -pub async fn get_kms_client(config: &settings::Kms) -> &KmsClient { +pub async fn get_kms_client(config: &KmsConfig) -> &KmsClient { KMS_CLIENT.get_or_init(|| KmsClient::new(config)).await } +/// Configuration parameters required for constructing a [`KmsClient`]. +#[derive(Clone, Debug, Default, serde::Deserialize)] +#[serde(default)] +pub struct KmsConfig { + /// The AWS key identifier of the KMS key used to encrypt or decrypt data. + pub key_id: String, + + /// The AWS region to send KMS requests to. + pub region: String, +} + +/// Client for KMS operations. +#[derive(Debug)] pub struct KmsClient { inner_client: Client, key_id: String, @@ -25,7 +37,7 @@ pub struct KmsClient { impl KmsClient { /// Constructs a new KMS client. - pub async fn new(config: &settings::Kms) -> Self { + pub async fn new(config: &KmsConfig) -> Self { let region_provider = RegionProviderChain::first_try(Region::new(config.region.clone())); let sdk_config = aws_config::from_env().region(region_provider).load().await; @@ -39,11 +51,11 @@ impl KmsClient { /// the SDK has the values required to interact with the AWS KMS APIs (`AWS_ACCESS_KEY_ID` and /// `AWS_SECRET_ACCESS_KEY`) either set in environment variables, or that the SDK is running in /// a machine that is able to assume an IAM role. - pub async fn decrypt(&self, data: impl AsRef<[u8]>) -> CustomResult<String, errors::KmsError> { + pub async fn decrypt(&self, data: impl AsRef<[u8]>) -> CustomResult<String, KmsError> { let data = consts::BASE64_ENGINE .decode(data) .into_report() - .change_context(errors::KmsError::Base64DecodingFailed)?; + .change_context(KmsError::Base64DecodingFailed)?; let ciphertext_blob = Blob::new(data); let decrypt_output = self @@ -61,16 +73,51 @@ impl KmsClient { error }) .into_report() - .change_context(errors::KmsError::DecryptionFailed)?; + .change_context(KmsError::DecryptionFailed)?; decrypt_output .plaintext - .ok_or(errors::KmsError::MissingPlaintextDecryptionOutput) + .ok_or(KmsError::MissingPlaintextDecryptionOutput) .into_report() .and_then(|blob| { String::from_utf8(blob.into_inner()) .into_report() - .change_context(errors::KmsError::Utf8DecodingFailed) + .change_context(KmsError::Utf8DecodingFailed) }) } } + +/// Errors that could occur during KMS operations. +#[derive(Debug, thiserror::Error)] +pub enum KmsError { + /// An error occurred when base64 decoding input data. + #[error("Failed to base64 decode input data")] + Base64DecodingFailed, + + /// An error occurred when KMS decrypting input data. + #[error("Failed to KMS decrypt input data")] + DecryptionFailed, + + /// The KMS decrypted output does not include a plaintext output. + #[error("Missing plaintext KMS decryption output")] + MissingPlaintextDecryptionOutput, + + /// An error occurred UTF-8 decoding KMS decrypted output. + #[error("Failed to UTF-8 decode decryption output")] + Utf8DecodingFailed, +} + +impl KmsConfig { + /// Verifies that the [`KmsClient`] configuration is usable. + pub fn validate(&self) -> Result<(), &'static str> { + use common_utils::{ext_traits::ConfigExt, fp_utils::when}; + + when(self.key_id.is_default_or_empty(), || { + Err("KMS AWS key ID must not be empty") + })?; + + when(self.region.is_default_or_empty(), || { + Err("KMS AWS region must not be empty") + }) + } +} diff --git a/crates/external_services/src/lib.rs b/crates/external_services/src/lib.rs new file mode 100644 index 00000000000..0a3b1333384 --- /dev/null +++ b/crates/external_services/src/lib.rs @@ -0,0 +1,27 @@ +//! Interactions with external systems. + +#![forbid(unsafe_code)] +#![warn(missing_docs, missing_debug_implementations)] + +#[cfg(feature = "kms")] +pub mod kms; + +/// Crate specific constants +#[cfg(feature = "kms")] +pub mod consts { + /// General purpose base64 engine + pub(crate) const BASE64_ENGINE: base64::engine::GeneralPurpose = + base64::engine::general_purpose::STANDARD; +} + +/// Metrics for interactions with external systems. +#[cfg(feature = "kms")] +pub mod metrics { + use router_env::{counter_metric, global_meter, metrics_context}; + + metrics_context!(CONTEXT); + global_meter!(GLOBAL_METER, "EXTERNAL_SERVICES"); + + #[cfg(feature = "kms")] + counter_metric!(AWS_KMS_FAILURES, GLOBAL_METER); // No. of AWS KMS API failures +} diff --git a/crates/router/Cargo.toml b/crates/router/Cargo.toml index 49e9fc85344..19a149a06d3 100644 --- a/crates/router/Cargo.toml +++ b/crates/router/Cargo.toml @@ -11,7 +11,7 @@ build = "src/build.rs" [features] default = ["kv_store", "stripe", "oltp", "olap", "accounts_cache"] -kms = ["aws-config", "aws-sdk-kms"] +kms = ["external_services/kms"] basilisk = ["kms"] stripe = ["dep:serde_qs"] sandbox = ["kms", "stripe", "basilisk"] @@ -31,8 +31,6 @@ actix-rt = "2.8.0" actix-web = "4.3.1" async-bb8-diesel = { git = "https://github.com/juspay/async-bb8-diesel", rev = "9a71d142726dbc33f41c1fd935ddaa79841c7be5" } async-trait = "0.1.66" -aws-config = { version = "0.54.1", optional = true } -aws-sdk-kms = { version = "0.24.0", optional = true } base64 = "0.21.0" bb8 = "0.8" blake3 = "1.3.3" @@ -83,6 +81,7 @@ uuid = { version = "1.3.0", features = ["serde", "v4"] } # First party crates api_models = { version = "0.1.0", path = "../api_models" } common_utils = { version = "0.1.0", path = "../common_utils" } +external_services = { version = "0.1.0", path = "../external_services" } masking = { version = "0.1.0", path = "../masking" } redis_interface = { version = "0.1.0", path = "../redis_interface" } router_derive = { version = "0.1.0", path = "../router_derive" } diff --git a/crates/router/src/configs/settings.rs b/crates/router/src/configs/settings.rs index 6e1bf525aec..883583a08b0 100644 --- a/crates/router/src/configs/settings.rs +++ b/crates/router/src/configs/settings.rs @@ -6,6 +6,8 @@ use std::{ use common_utils::ext_traits::ConfigExt; use config::{Environment, File}; +#[cfg(feature = "kms")] +use external_services::kms; use redis_interface::RedisSettings; pub use router_env::config::{Log, LogConsole, LogFile, LogTelemetry}; use serde::{Deserialize, Deserializer}; @@ -59,7 +61,7 @@ pub struct Settings { pub bank_config: BankRedirectConfig, pub api_keys: ApiKeys, #[cfg(feature = "kms")] - pub kms: Kms, + pub kms: kms::KmsConfig, } #[derive(Debug, Deserialize, Clone, Default)] @@ -337,14 +339,6 @@ pub struct ApiKeys { pub hash_key: String, } -#[cfg(feature = "kms")] -#[derive(Debug, Deserialize, Clone, Default)] -#[serde(default)] -pub struct Kms { - pub key_id: String, - pub region: String, -} - impl Settings { pub fn new() -> ApplicationResult<Self> { Self::with_config_path(None) @@ -420,7 +414,9 @@ impl Settings { self.drainer.validate()?; self.api_keys.validate()?; #[cfg(feature = "kms")] - self.kms.validate()?; + self.kms + .validate() + .map_err(|error| ApplicationError::InvalidConfigurationValueError(error.into()))?; Ok(()) } diff --git a/crates/router/src/configs/validations.rs b/crates/router/src/configs/validations.rs index 74552c5ef28..4cf28b3dcef 100644 --- a/crates/router/src/configs/validations.rs +++ b/crates/router/src/configs/validations.rs @@ -184,22 +184,3 @@ impl super::settings::ApiKeys { }) } } - -#[cfg(feature = "kms")] -impl super::settings::Kms { - pub fn validate(&self) -> Result<(), ApplicationError> { - use common_utils::fp_utils::when; - - when(self.key_id.is_default_or_empty(), || { - Err(ApplicationError::InvalidConfigurationValueError( - "KMS AWS key ID must not be empty".into(), - )) - })?; - - when(self.region.is_default_or_empty(), || { - Err(ApplicationError::InvalidConfigurationValueError( - "KMS AWS region must not be empty".into(), - )) - }) - } -} diff --git a/crates/router/src/core/api_keys.rs b/crates/router/src/core/api_keys.rs index ba2832d7a47..144a1793dc1 100644 --- a/crates/router/src/core/api_keys.rs +++ b/crates/router/src/core/api_keys.rs @@ -1,10 +1,10 @@ use common_utils::date_time; use error_stack::{report, IntoReport, ResultExt}; +#[cfg(feature = "kms")] +use external_services::kms; use masking::{PeekInterface, StrongSecret}; use router_env::{instrument, tracing}; -#[cfg(feature = "kms")] -use crate::services::kms; use crate::{ configs::settings, consts, @@ -21,7 +21,7 @@ static HASH_KEY: tokio::sync::OnceCell<StrongSecret<[u8; PlaintextApiKey::HASH_K pub async fn get_hash_key( api_key_config: &settings::ApiKeys, - #[cfg(feature = "kms")] kms_config: &settings::Kms, + #[cfg(feature = "kms")] kms_config: &kms::KmsConfig, ) -> errors::RouterResult<&'static StrongSecret<[u8; PlaintextApiKey::HASH_KEY_LEN]>> { HASH_KEY .get_or_try_init(|| async { @@ -119,7 +119,7 @@ impl PlaintextApiKey { pub async fn create_api_key( store: &dyn StorageInterface, api_key_config: &settings::ApiKeys, - #[cfg(feature = "kms")] kms_config: &settings::Kms, + #[cfg(feature = "kms")] kms_config: &kms::KmsConfig, api_key: api::CreateApiKeyRequest, merchant_id: String, ) -> RouterResponse<api::CreateApiKeyResponse> { diff --git a/crates/router/src/core/payment_methods/transformers.rs b/crates/router/src/core/payment_methods/transformers.rs index a84e5c8b310..a9ba79819e7 100644 --- a/crates/router/src/core/payment_methods/transformers.rs +++ b/crates/router/src/core/payment_methods/transformers.rs @@ -1,10 +1,10 @@ use common_utils::ext_traits::StringExt; use error_stack::ResultExt; +#[cfg(feature = "kms")] +use external_services::kms; use josekit::jwe; use serde::{Deserialize, Serialize}; -#[cfg(feature = "kms")] -use crate::services::kms; use crate::{ configs::settings, core::errors::{self, CustomResult}, @@ -149,7 +149,7 @@ pub fn get_dotted_jws(jws: encryption::JwsBody) -> String { pub async fn get_decrypted_response_payload( jwekey: &settings::Jwekey, jwe_body: encryption::JweBody, - #[cfg(feature = "kms")] kms_config: &settings::Kms, + #[cfg(feature = "kms")] kms_config: &kms::KmsConfig, ) -> CustomResult<String, errors::VaultError> { #[cfg(feature = "kms")] let public_key = kms::get_kms_client(kms_config) @@ -192,7 +192,7 @@ pub async fn get_decrypted_response_payload( pub async fn mk_basilisk_req( jwekey: &settings::Jwekey, jws: &str, - #[cfg(feature = "kms")] kms_config: &settings::Kms, + #[cfg(feature = "kms")] kms_config: &kms::KmsConfig, ) -> CustomResult<encryption::JweBody, errors::VaultError> { let jws_payload: Vec<&str> = jws.split('.').collect(); @@ -247,7 +247,7 @@ pub async fn mk_add_card_request_hs( card: &api::CardDetail, customer_id: &str, merchant_id: &str, - #[cfg(feature = "kms")] kms_config: &settings::Kms, + #[cfg(feature = "kms")] kms_config: &kms::KmsConfig, ) -> CustomResult<services::Request, errors::VaultError> { let merchant_customer_id = if cfg!(feature = "sandbox") { format!("{customer_id}::{merchant_id}") @@ -409,7 +409,7 @@ pub async fn mk_get_card_request_hs( customer_id: &str, merchant_id: &str, card_reference: &str, - #[cfg(feature = "kms")] kms_config: &settings::Kms, + #[cfg(feature = "kms")] kms_config: &kms::KmsConfig, ) -> CustomResult<services::Request, errors::VaultError> { let merchant_customer_id = if cfg!(feature = "sandbox") { format!("{customer_id}::{merchant_id}") @@ -501,7 +501,7 @@ pub async fn mk_delete_card_request_hs( customer_id: &str, merchant_id: &str, card_reference: &str, - #[cfg(feature = "kms")] kms_config: &settings::Kms, + #[cfg(feature = "kms")] kms_config: &kms::KmsConfig, ) -> CustomResult<services::Request, errors::VaultError> { let merchant_customer_id = if cfg!(feature = "sandbox") { format!("{customer_id}::{merchant_id}") diff --git a/crates/router/src/core/payment_methods/vault.rs b/crates/router/src/core/payment_methods/vault.rs index 608ef2afc53..3f7aeb4e6bd 100644 --- a/crates/router/src/core/payment_methods/vault.rs +++ b/crates/router/src/core/payment_methods/vault.rs @@ -1,6 +1,8 @@ use common_utils::generate_id_with_default_len; use error_stack::{IntoReport, ResultExt}; #[cfg(feature = "basilisk")] +use external_services::kms; +#[cfg(feature = "basilisk")] use josekit::jwe; use masking::PeekInterface; use router_env::{instrument, tracing}; @@ -18,11 +20,7 @@ use crate::{ utils::{self, StringExt}, }; #[cfg(feature = "basilisk")] -use crate::{ - core::payment_methods::transformers as payment_methods, - services::{self, kms}, - utils::BytesExt, -}; +use crate::{core::payment_methods::transformers as payment_methods, services, utils::BytesExt}; #[cfg(feature = "basilisk")] use crate::{ db, @@ -407,7 +405,7 @@ pub fn get_key_id(keys: &settings::Jwekey) -> &str { #[cfg(feature = "basilisk")] async fn get_locker_jwe_keys( keys: &settings::Jwekey, - kms_config: &settings::Kms, + kms_config: &kms::KmsConfig, ) -> CustomResult<(String, String), errors::EncryptionError> { let key_id = get_key_id(keys); let (encryption_key, decryption_key) = if key_id == keys.locker_key_identifier1 { diff --git a/crates/router/src/env.rs b/crates/router/src/env.rs index eadb5fbd6ff..6cff38e9e23 100644 --- a/crates/router/src/env.rs +++ b/crates/router/src/env.rs @@ -20,6 +20,7 @@ pub mod logger { "actix_server", "api_models", "common_utils", + "external_services", "masking", "redis_interface", "router_derive", diff --git a/crates/router/src/services.rs b/crates/router/src/services.rs index 38217db629c..a9021a34372 100644 --- a/crates/router/src/services.rs +++ b/crates/router/src/services.rs @@ -1,8 +1,6 @@ pub mod api; pub mod authentication; pub mod encryption; -#[cfg(feature = "kms")] -pub mod kms; pub mod logger; use std::sync::{atomic, Arc}; diff --git a/crates/router_env/tests/env.rs b/crates/router_env/tests/env.rs index 16a26b3ac70..5251d2ab8ef 100644 --- a/crates/router_env/tests/env.rs +++ b/crates/router_env/tests/env.rs @@ -1,5 +1,7 @@ +#[cfg(feature = "vergen")] use router_env as env; +#[cfg(feature = "vergen")] #[tokio::test] async fn basic() -> Result<(), Box<dyn std::error::Error + Send + Sync>> { println!("CARGO_PKG_VERSION : {:?}", env!("CARGO_PKG_VERSION")); @@ -19,6 +21,7 @@ async fn basic() -> Result<(), Box<dyn std::error::Error + Send + Sync>> { Ok(()) } +#[cfg(feature = "vergen")] #[tokio::test] async fn env_macro() -> Result<(), Box<dyn std::error::Error + Send + Sync>> { println!("version : {:?}", env::version!());
refactor
extract kms module to `external_services` crate (#793)
8cc5d3db9afb120b00115c6714be2e362951cc94
2024-11-14 16:49:10
Pa1NarK
ci: introduce `cybersource` cypress test to run in parallel (#6541)
false
diff --git a/.github/workflows/cypress-tests-runner.yml b/.github/workflows/cypress-tests-runner.yml index 055aacdcf4f..84680c945e1 100644 --- a/.github/workflows/cypress-tests-runner.yml +++ b/.github/workflows/cypress-tests-runner.yml @@ -13,7 +13,7 @@ concurrency: env: CARGO_INCREMENTAL: 0 CARGO_NET_RETRY: 10 - PAYMENTS_CONNECTORS: "stripe" + PAYMENTS_CONNECTORS: "cybersource stripe" PAYOUTS_CONNECTORS: "wise" RUST_BACKTRACE: short RUSTUP_MAX_RETRIES: 10
ci
introduce `cybersource` cypress test to run in parallel (#6541)
881f5fd0149cb5573eb31451fceb596092eab79a
2024-10-17 05:55:06
github-actions
chore(version): 2024.10.17.0
false
diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ccf8f34999..781e38dff83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,27 @@ All notable changes to HyperSwitch will be documented here. - - - +## 2024.10.17.0 + +### Features + +- **connector:** [fiuu] Add support for payment and refund webhooks ([#6315](https://github.com/juspay/hyperswitch/pull/6315)) ([`d04a87b`](https://github.com/juspay/hyperswitch/commit/d04a87be9e763034c070686cf1c2c73045650d4a)) +- **sample_data:** Extend the batch sample data interface trait for disputes ([#6293](https://github.com/juspay/hyperswitch/pull/6293)) ([`1b31c57`](https://github.com/juspay/hyperswitch/commit/1b31c57fd961d6cec5d8ef1403bf501d1dd74b52)) +- **user_role:** Add limit to `generic_user_roles_list_for_org_and_extra` ([#6191](https://github.com/juspay/hyperswitch/pull/6191)) ([`6aa6b7b`](https://github.com/juspay/hyperswitch/commit/6aa6b7bdc64a367ffaec97fa3826da6e2431ff9d)) + +### Refactors + +- **cypress:** Reuse config update command ([#6197](https://github.com/juspay/hyperswitch/pull/6197)) ([`da194f3`](https://github.com/juspay/hyperswitch/commit/da194f34c6860af04d83ef69041f9e79249454ae)) +- **users:** Move hardcoded email subjects to constants ([#6110](https://github.com/juspay/hyperswitch/pull/6110)) ([`899ec23`](https://github.com/juspay/hyperswitch/commit/899ec23565f99daaad821c1ec1482b4c0cc408c5)) + +### Documentation + +- Simplify README ([#6306](https://github.com/juspay/hyperswitch/pull/6306)) ([`b377227`](https://github.com/juspay/hyperswitch/commit/b3772272678dd9e93b7afc7958b3344cbfe64708)) + +**Full Changelog:** [`2024.10.16.0...2024.10.17.0`](https://github.com/juspay/hyperswitch/compare/2024.10.16.0...2024.10.17.0) + +- - - + ## 2024.10.16.0 ### Features
chore
2024.10.17.0
7f947169feac9d15616cc2b1a2aacdfa80f219bf
2023-07-26 19:18:04
Sai Harsha Vardhan
feat(errors): add `GenericDuplicateError` in`ApiErrorResponse` (#1792)
false
diff --git a/crates/router/src/compatibility/stripe/errors.rs b/crates/router/src/compatibility/stripe/errors.rs index feec71a37ac..fae1e033cc1 100644 --- a/crates/router/src/compatibility/stripe/errors.rs +++ b/crates/router/src/compatibility/stripe/errors.rs @@ -91,6 +91,9 @@ pub enum StripeErrorCode { #[error(error_type = StripeErrorType::InvalidRequestError, code = "resource_missing", message = "{message}")] GenericNotFoundError { message: String }, + #[error(error_type = StripeErrorType::InvalidRequestError, code = "duplicate_resource", message = "{message}")] + GenericDuplicateError { message: String }, + #[error(error_type = StripeErrorType::InvalidRequestError, code = "resource_missing", message = "No such merchant account")] MerchantAccountNotFound, @@ -411,6 +414,9 @@ impl From<errors::ApiErrorResponse> for StripeErrorCode { errors::ApiErrorResponse::GenericNotFoundError { message } => { Self::GenericNotFoundError { message } } + errors::ApiErrorResponse::GenericDuplicateError { message } => { + Self::GenericDuplicateError { message } + } // parameter unknown, invalid request error // actually if we type wrong values in address we get this error. Stripe throws parameter unknown. I don't know if stripe is validating email and stuff errors::ApiErrorResponse::InvalidDataFormat { field_name, @@ -607,6 +613,7 @@ impl actix_web::ResponseError for StripeErrorCode { | Self::PaymentIntentMandateInvalid { .. } | Self::PaymentIntentUnexpectedState { .. } | Self::DuplicatePayment { .. } + | Self::GenericDuplicateError { .. } | Self::IncorrectConnectorNameGiven | Self::ResourceMissing { .. } | Self::FileValidationFailed diff --git a/crates/router/src/core/errors/api_error_response.rs b/crates/router/src/core/errors/api_error_response.rs index 450eb52a94f..e659d5b2153 100644 --- a/crates/router/src/core/errors/api_error_response.rs +++ b/crates/router/src/core/errors/api_error_response.rs @@ -207,6 +207,8 @@ pub enum ApiErrorResponse { MissingFileContentType, #[error(error_type = ErrorType::InvalidRequestError, code = "HE_05", message = "{message}")] GenericNotFoundError { message: String }, + #[error(error_type = ErrorType::InvalidRequestError, code = "HE_01", message = "{message}")] + GenericDuplicateError { message: String }, #[error(error_type = ErrorType::InvalidRequestError, code = "WE_01", message = "Failed to authenticate the webhook")] WebhookAuthenticationFailed, #[error(error_type = ErrorType::ObjectNotFound, code = "WE_04", message = "Webhook resource not found")] diff --git a/crates/router/src/core/errors/transformers.rs b/crates/router/src/core/errors/transformers.rs index a315240b0d9..2d6774a3d00 100644 --- a/crates/router/src/core/errors/transformers.rs +++ b/crates/router/src/core/errors/transformers.rs @@ -135,6 +135,9 @@ impl ErrorSwitch<api_models::errors::types::ApiErrorResponse> for ApiErrorRespon Self::DuplicatePayout { payout_id } => { AER::BadRequest(ApiError::new("HE", 1, format!("The payout with the specified payout_id '{payout_id}' already exists in our records"), None)) } + Self::GenericDuplicateError { message } => { + AER::BadRequest(ApiError::new("HE", 1, message, None)) + } Self::RefundNotFound => { AER::NotFound(ApiError::new("HE", 2, "Refund does not exist in our records.", None)) }
feat
add `GenericDuplicateError` in`ApiErrorResponse` (#1792)
a3bfa685cccf278c92d90d5f21052021fc1dec61
2023-10-25 22:32:52
Sanchith Hegde
chore(version): v1.66.0
false
diff --git a/CHANGELOG.md b/CHANGELOG.md index 61a6d0a15e0..86855b4fe77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,17 @@ All notable changes to HyperSwitch will be documented here. - - - +## 1.66.0 (2023-10-25) + +### Features + +- **core:** Add support for multiple `merchant_connector_account` ([#2655](https://github.com/juspay/hyperswitch/pull/2655)) ([`5988d8d`](https://github.com/juspay/hyperswitch/commit/5988d8d42605af006fdf7d7821bbdf66e4468669)) + +**Full Changelog:** [`v1.65.0...v1.66.0`](https://github.com/juspay/hyperswitch/compare/v1.65.0...v1.66.0) + +- - - + + ## 1.65.0 (2023-10-25) ### Features
chore
v1.66.0
11ff437456f9d97205ce07e4d4df63006f3ad0c6
2025-02-22 17:11:57
Shankar Singh C
fix(samsung_pay): add payment_method_type duplication check (#7337)
false
diff --git a/crates/common_enums/src/enums.rs b/crates/common_enums/src/enums.rs index 54514f6e05a..c286ae04d5f 100644 --- a/crates/common_enums/src/enums.rs +++ b/crates/common_enums/src/enums.rs @@ -1651,6 +1651,12 @@ pub enum PaymentMethodType { DirectCarrierBilling, } +impl PaymentMethodType { + pub fn should_check_for_customer_saved_payment_method_type(self) -> bool { + matches!(self, Self::ApplePay | Self::GooglePay | Self::SamsungPay) + } +} + impl masking::SerializableSecret for PaymentMethodType {} /// Indicates the type of payment method. Eg: 'card', 'wallet', etc. diff --git a/crates/router/src/core/payments/helpers.rs b/crates/router/src/core/payments/helpers.rs index c995b646ffc..032262b30aa 100644 --- a/crates/router/src/core/payments/helpers.rs +++ b/crates/router/src/core/payments/helpers.rs @@ -591,10 +591,13 @@ pub async fn get_token_pm_type_mandate_details( mandate_generic_data.mandate_connector, mandate_generic_data.payment_method_info, ) - } else if request.payment_method_type - == Some(api_models::enums::PaymentMethodType::ApplePay) - || request.payment_method_type - == Some(api_models::enums::PaymentMethodType::GooglePay) + } else if request + .payment_method_type + .map(|payment_method_type_value| { + payment_method_type_value + .should_check_for_customer_saved_payment_method_type() + }) + .unwrap_or(false) { let payment_request_customer_id = request.get_customer_id(); if let Some(customer_id) = diff --git a/crates/router/src/core/payments/tokenization.rs b/crates/router/src/core/payments/tokenization.rs index d46977d8c99..b4e4db3d161 100644 --- a/crates/router/src/core/payments/tokenization.rs +++ b/crates/router/src/core/payments/tokenization.rs @@ -655,9 +655,11 @@ where }, None => { let customer_saved_pm_option = if payment_method_type - == Some(api_models::enums::PaymentMethodType::ApplePay) - || payment_method_type - == Some(api_models::enums::PaymentMethodType::GooglePay) + .map(|payment_method_type_value| { + payment_method_type_value + .should_check_for_customer_saved_payment_method_type() + }) + .unwrap_or(false) { match state .store
fix
add payment_method_type duplication check (#7337)
166688a5906a2fcbb034c40a113452f6dc2e7160
2023-06-02 16:37:20
Abhishek Marrivagu
refactor(compatibility): map connector to routing in payments request for backward compatibility (#1339)
false
diff --git a/crates/router/src/compatibility/stripe/payment_intents/types.rs b/crates/router/src/compatibility/stripe/payment_intents/types.rs index e9aae53c9c5..b9496a8cb79 100644 --- a/crates/router/src/compatibility/stripe/payment_intents/types.rs +++ b/crates/router/src/compatibility/stripe/payment_intents/types.rs @@ -125,7 +125,7 @@ impl From<Shipping> for payments::Address { pub struct StripePaymentIntentRequest { pub id: Option<String>, pub amount: Option<i64>, //amount in cents, hence passed as integer - pub connector: Option<Vec<api_enums::Connector>>, + pub connector: Option<Vec<api_enums::RoutableConnectors>>, pub currency: Option<String>, #[serde(rename = "amount_to_capture")] pub amount_capturable: Option<i64>, @@ -169,10 +169,22 @@ impl TryFrom<StripePaymentIntentRequest> for payments::PaymentsRequest { } None => (None, None), }; + + let routable_connector: Option<api_enums::RoutableConnectors> = + item.connector.and_then(|v| v.into_iter().next()); + + let routing = routable_connector + .map(crate::types::api::RoutingAlgorithm::Single) + .map(|r| { + serde_json::to_value(r) + .into_report() + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("converting to routing failed") + }) + .transpose()?; let request = Ok(Self { payment_id: item.id.map(payments::PaymentIdType::PaymentIntentId), amount: item.amount.map(|amount| amount.into()), - connector: item.connector, currency: item .currency .as_ref() @@ -215,6 +227,7 @@ impl TryFrom<StripePaymentIntentRequest> for payments::PaymentsRequest { setup_future_usage: item.setup_future_usage, mandate_id: item.mandate_id, off_session: item.off_session, + routing, ..Self::default() }); request
refactor
map connector to routing in payments request for backward compatibility (#1339)
effa7a00e91457722eb06bed1a640b30b06ddb5c
2023-02-17 15:03:54
Rachit Naithani
bugfix(router): api keys path params (#609)
false
diff --git a/crates/router/src/routes/api_keys.rs b/crates/router/src/routes/api_keys.rs index 47dd2273ab9..6c7147da7e3 100644 --- a/crates/router/src/routes/api_keys.rs +++ b/crates/router/src/routes/api_keys.rs @@ -65,7 +65,7 @@ pub async fn api_key_retrieve( req: HttpRequest, path: web::Path<(String, String)>, ) -> impl Responder { - let (key_id, _merchant_id) = path.into_inner(); + let (_merchant_id, key_id) = path.into_inner(); api::server_wrap( state.get_ref(), @@ -99,7 +99,7 @@ pub async fn api_key_update( path: web::Path<(String, String)>, json_payload: web::Json<api_types::UpdateApiKeyRequest>, ) -> impl Responder { - let (key_id, _merchant_id) = path.into_inner(); + let (_merchant_id, key_id) = path.into_inner(); let payload = json_payload.into_inner(); api::server_wrap( @@ -133,7 +133,7 @@ pub async fn api_key_revoke( req: HttpRequest, path: web::Path<(String, String)>, ) -> impl Responder { - let (key_id, _merchant_id) = path.into_inner(); + let (_merchant_id, key_id) = path.into_inner(); api::server_wrap( state.get_ref(),
bugfix
api keys path params (#609)
5b5557b71d84de67fbda2d0eb09a947eee2823d0
2023-03-21 15:12:44
Nishant Joshi
feat: compile time optimization (#775)
false
diff --git a/crates/drainer/Cargo.toml b/crates/drainer/Cargo.toml index a98be82e9f0..387c0b796ae 100644 --- a/crates/drainer/Cargo.toml +++ b/crates/drainer/Cargo.toml @@ -7,12 +7,15 @@ rust-version = "1.65" readme = "README.md" license = "Apache-2.0" +[features] +vergen = [ "router_env/vergen" ] + [dependencies] async-bb8-diesel = { git = "https://github.com/juspay/async-bb8-diesel", rev = "9a71d142726dbc33f41c1fd935ddaa79841c7be5" } bb8 = "0.8" clap = { version = "4.1.8", default-features = false, features = ["std", "derive", "help", "usage"] } config = { version = "0.13.3", features = ["toml"] } -diesel = { version = "2.0.3", features = ["postgres", "serde_json", "time", "64-column-tables"] } +diesel = { version = "2.0.3", features = ["postgres"] } error-stack = "0.3.1" once_cell = "1.17.1" serde = "1.0.155" @@ -28,4 +31,4 @@ router_env = { version = "0.1.0", path = "../router_env", features = ["log_extra storage_models = { version = "0.1.0", path = "../storage_models", features = ["kv_store"] } [build-dependencies] -router_env = { version = "0.1.0", path = "../router_env", default-features = false, features = ["vergen"] } +router_env = { version = "0.1.0", path = "../router_env", default-features = false } \ No newline at end of file diff --git a/crates/drainer/build.rs b/crates/drainer/build.rs index 4b07385af68..a35e30be384 100644 --- a/crates/drainer/build.rs +++ b/crates/drainer/build.rs @@ -1,3 +1,4 @@ fn main() { + #[cfg(feature = "vergen")] router_env::vergen::generate_cargo_instructions(); } diff --git a/crates/drainer/src/settings.rs b/crates/drainer/src/settings.rs index f77853f1b80..5367d0dd596 100644 --- a/crates/drainer/src/settings.rs +++ b/crates/drainer/src/settings.rs @@ -10,7 +10,7 @@ use serde::Deserialize; use crate::errors; #[derive(clap::Parser, Default)] -#[command(version = router_env::version!())] +#[cfg_attr(feature = "vergen", command(version = router_env::version!()))] pub struct CmdLineConf { /// Config file. /// Application will look for "config/config.toml" if this option isn't specified. diff --git a/crates/router/Cargo.toml b/crates/router/Cargo.toml index b2b1ac0da6e..2270892c0fe 100644 --- a/crates/router/Cargo.toml +++ b/crates/router/Cargo.toml @@ -21,6 +21,7 @@ production = [] kv_store = [] accounts_cache = [] openapi = ["olap", "oltp"] +vergen = [ "router_env/vergen" ] [dependencies] @@ -39,7 +40,7 @@ bytes = "1.4.0" clap = { version = "4.1.8", default-features = false, features = ["std", "derive", "help", "usage"] } config = { version = "0.13.3", features = ["toml"] } crc32fast = "1.3.2" -diesel = { version = "2.0.3", features = ["postgres", "serde_json", "time", "64-column-tables"] } +diesel = { version = "2.0.3", features = ["postgres"] } dyn-clone = "1.0.11" encoding_rs = "0.8.32" error-stack = "0.3.1" @@ -89,7 +90,7 @@ router_env = { version = "0.1.0", path = "../router_env", features = ["log_extra storage_models = { version = "0.1.0", path = "../storage_models", features = ["kv_store"] } [build-dependencies] -router_env = { version = "0.1.0", path = "../router_env", default-features = false, features = ["vergen"] } +router_env = { version = "0.1.0", path = "../router_env", default-features = false } [dev-dependencies] actix-http = "3.3.1" diff --git a/crates/router/src/build.rs b/crates/router/src/build.rs index 1016b99d924..db161588939 100644 --- a/crates/router/src/build.rs +++ b/crates/router/src/build.rs @@ -4,5 +4,6 @@ fn main() { #[cfg(debug_assertions)] println!("cargo:rustc-env=RUST_MIN_STACK=4194304"); // 4 * 1024 * 1024 = 4 MiB + #[cfg(feature = "vergen")] router_env::vergen::generate_cargo_instructions(); } diff --git a/crates/router/src/configs/settings.rs b/crates/router/src/configs/settings.rs index 92891dc1c73..6e1bf525aec 100644 --- a/crates/router/src/configs/settings.rs +++ b/crates/router/src/configs/settings.rs @@ -16,7 +16,7 @@ use crate::{ }; #[derive(clap::Parser, Default)] -#[command(version = router_env::version!())] +#[cfg_attr(feature = "vergen", command(version = router_env::version!()))] pub struct CmdLineConf { /// Config file. /// Application will look for "config/config.toml" if this option isn't specified. diff --git a/crates/router_env/Cargo.toml b/crates/router_env/Cargo.toml index 8c090874d5c..753170c3e62 100644 --- a/crates/router_env/Cargo.toml +++ b/crates/router_env/Cargo.toml @@ -33,7 +33,7 @@ vergen = { version = "8.0.0-beta.9", optional = true, features = ["cargo", "git" tokio = { version = "1.26.0", features = ["macros", "rt-multi-thread"] } [build-dependencies] -vergen = { version = "8.0.0-beta.9", features = ["cargo", "git", "git2", "rustc"] } +vergen = { version = "8.0.0-beta.9", features = ["cargo", "git", "git2", "rustc"], optional = true } [features] default = ["actix_web"] diff --git a/crates/router_env/src/env.rs b/crates/router_env/src/env.rs index 60302da4554..cba7714cdff 100644 --- a/crates/router_env/src/env.rs +++ b/crates/router_env/src/env.rs @@ -91,6 +91,7 @@ pub fn workspace_path() -> PathBuf { /// - Timestamp of the latest git commit. /// /// Example: `0.1.0-abcd012-2038-01-19T03:14:08Z`. +#[cfg(feature = "vergen")] #[macro_export] macro_rules! version { () => { @@ -117,6 +118,7 @@ macro_rules! version { /// Example: `0.1.0-f5f383e-2022-09-04T11:39:37Z-1.63.0-x86_64-unknown-linux-gnu` /// +#[cfg(feature = "vergen")] #[macro_export] macro_rules! build { () => { @@ -141,7 +143,7 @@ macro_rules! build { /// /// Example: `f5f383ee7e36214d60ce3c6353b57db03ff0ceb1`. /// - +#[cfg(feature = "vergen")] #[macro_export] macro_rules! commit { () => { diff --git a/crates/router_env/src/logger/formatter.rs b/crates/router_env/src/logger/formatter.rs index 2c5ec771cab..97351c8a89c 100644 --- a/crates/router_env/src/logger/formatter.rs +++ b/crates/router_env/src/logger/formatter.rs @@ -126,7 +126,9 @@ where hostname: String, env: String, service: String, + #[cfg(feature = "vergen")] version: String, + #[cfg(feature = "vergen")] build: String, default_fields: HashMap<String, Value>, } @@ -159,7 +161,9 @@ where let pid = std::process::id(); let hostname = gethostname::gethostname().to_string_lossy().into_owned(); let service = service.to_string(); + #[cfg(feature = "vergen")] let version = crate::version!().to_string(); + #[cfg(feature = "vergen")] let build = crate::build!().to_string(); let env = crate::env::which().to_string(); @@ -169,7 +173,9 @@ where hostname, env, service, + #[cfg(feature = "vergen")] version, + #[cfg(feature = "vergen")] build, default_fields, } @@ -195,7 +201,9 @@ where map_serializer.serialize_entry(HOSTNAME, &self.hostname)?; map_serializer.serialize_entry(PID, &self.pid)?; map_serializer.serialize_entry(ENV, &self.env)?; + #[cfg(feature = "vergen")] map_serializer.serialize_entry(VERSION, &self.version)?; + #[cfg(feature = "vergen")] map_serializer.serialize_entry(BUILD, &self.build)?; map_serializer.serialize_entry(LEVEL, &format!("{}", metadata.level()))?; map_serializer.serialize_entry(TARGET, metadata.target())?; diff --git a/crates/router_env/src/vergen.rs b/crates/router_env/src/vergen.rs index 93fd4f4f3d3..41fb83d30df 100644 --- a/crates/router_env/src/vergen.rs +++ b/crates/router_env/src/vergen.rs @@ -6,6 +6,7 @@ /// # Panics /// /// Panics if `vergen` fails to generate `cargo` build instructions. +#[cfg(feature = "vergen")] #[allow(clippy::expect_used)] pub fn generate_cargo_instructions() { use std::io::Write; @@ -31,3 +32,6 @@ pub fn generate_cargo_instructions() { ) .expect("Failed to set `CARGO_PROFILE` environment variable"); } + +#[cfg(not(feature = "vergen"))] +pub fn generate_cargo_instructions() {}
feat
compile time optimization (#775)
9668a74a79daf7b15069d5c21ebc43749e705558
2023-09-15 12:58:45
Hrithikesh
feat(connector): (adyen) add support for multiple partial capture adyen (#2102)
false
diff --git a/Cargo.lock b/Cargo.lock index 082bb476dec..fff48158ded 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -422,45 +422,6 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8868f09ff8cea88b079da74ae569d9b8c62a23c68c746240b704ee6f7525c89c" -[[package]] -name = "asn1-rs" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" -dependencies = [ - "asn1-rs-derive", - "asn1-rs-impl", - "displaydoc", - "nom", - "num-traits", - "rusticata-macros", - "thiserror", - "time 0.3.22", -] - -[[package]] -name = "asn1-rs-derive" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "synstructure", -] - -[[package]] -name = "asn1-rs-impl" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "assert-json-diff" version = "2.0.2" @@ -533,7 +494,7 @@ dependencies = [ "log", "parking", "polling", - "rustix 0.37.20", + "rustix", "slab", "socket2", "waker-fn", @@ -567,7 +528,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.29", ] [[package]] @@ -578,7 +539,7 @@ checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.29", ] [[package]] @@ -1189,9 +1150,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.0" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +checksum = "6dbe3c979c178231552ecba20214a8272df4e09f232a87aef4320cf06539aded" [[package]] name = "blake3" @@ -1251,9 +1212,9 @@ checksum = "2c676a478f63e9fa2dd5368a42f28bba0d6c560b775f38583c8bbaa7fcd67c9c" [[package]] name = "bytemuck" -version = "1.14.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" +checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" [[package]] name = "byteorder" @@ -1424,7 +1385,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.29", ] [[package]] @@ -1464,7 +1425,6 @@ dependencies = [ "fake", "futures", "hex", - "http", "masking", "md5", "nanoid", @@ -1474,7 +1434,6 @@ dependencies = [ "quick-xml", "rand 0.8.5", "regex", - "reqwest", "ring", "router_env", "serde", @@ -1482,7 +1441,6 @@ dependencies = [ "serde_urlencoded", "signal-hook", "signal-hook-tokio", - "strum 0.24.1", "test-case", "thiserror", "time 0.3.22", @@ -1693,7 +1651,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.32", + "syn 2.0.29", ] [[package]] @@ -1715,7 +1673,7 @@ checksum = "29a358ff9f12ec09c3e61fef9b5a9902623a695a46a917b07f269bff1445611a" dependencies = [ "darling_core 0.20.1", "quote", - "syn 2.0.32", + "syn 2.0.29", ] [[package]] @@ -1731,12 +1689,6 @@ dependencies = [ "parking_lot_core", ] -[[package]] -name = "data-encoding" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" - [[package]] name = "data_models" version = "0.1.0" @@ -1746,7 +1698,6 @@ dependencies = [ "common_enums", "common_utils", "error-stack", - "masking", "serde", "serde_json", "strum 0.25.0", @@ -1783,20 +1734,6 @@ dependencies = [ "byteorder", ] -[[package]] -name = "der-parser" -version = "8.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" -dependencies = [ - "asn1-rs", - "displaydoc", - "nom", - "num-bigint", - "num-traits", - "rusticata-macros", -] - [[package]] name = "derive_deref" version = "1.1.1" @@ -1827,7 +1764,7 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7a532c1f99a0f596f6960a60d1e119e91582b24b39e2d83a190e61262c3ef0c" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.3.2", "byteorder", "diesel_derives", "itoa", @@ -1846,7 +1783,7 @@ dependencies = [ "diesel_table_macro_syntax", "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.29", ] [[package]] @@ -1879,7 +1816,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5" dependencies = [ - "syn 2.0.32", + "syn 2.0.29", ] [[package]] @@ -1919,17 +1856,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "displaydoc" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.32", -] - [[package]] name = "dlv-list" version = "0.3.0" @@ -2336,7 +2262,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.29", ] [[package]] @@ -2781,12 +2707,13 @@ checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" [[package]] name = "is-terminal" -version = "0.4.9" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" dependencies = [ "hermit-abi 0.3.1", - "rustix 0.38.3", + "io-lifetimes", + "rustix", "windows-sys 0.48.0", ] @@ -2945,12 +2872,6 @@ version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" -[[package]] -name = "linux-raw-sys" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" - [[package]] name = "literally" version = "0.1.3" @@ -3305,15 +3226,6 @@ dependencies = [ "libc", ] -[[package]] -name = "oid-registry" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" -dependencies = [ - "asn1-rs", -] - [[package]] name = "once_cell" version = "1.18.0" @@ -3349,7 +3261,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.29", ] [[package]] @@ -3563,7 +3475,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.29", ] [[package]] @@ -3614,7 +3526,7 @@ checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.29", ] [[package]] @@ -4175,7 +4087,6 @@ dependencies = [ "nanoid", "num_cpus", "once_cell", - "openssl", "qrcode", "rand 0.8.5", "redis_interface", @@ -4208,7 +4119,6 @@ dependencies = [ "utoipa-swagger-ui", "uuid", "wiremock", - "x509-parser", ] [[package]] @@ -4282,7 +4192,7 @@ dependencies = [ "quote", "rust-embed-utils", "shellexpand", - "syn 2.0.32", + "syn 2.0.29", "walkdir", ] @@ -4321,15 +4231,6 @@ dependencies = [ "semver", ] -[[package]] -name = "rusticata-macros" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" -dependencies = [ - "nom", -] - [[package]] name = "rustix" version = "0.37.20" @@ -4340,20 +4241,7 @@ dependencies = [ "errno", "io-lifetimes", "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", -] - -[[package]] -name = "rustix" -version = "0.38.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac5ffa1efe7548069688cd7028f32591853cd7b5b756d41bcffd2353e4fc75b4" -dependencies = [ - "bitflags 2.4.0", - "errno", - "libc", - "linux-raw-sys 0.4.7", + "linux-raw-sys", "windows-sys 0.48.0", ] @@ -4540,31 +4428,31 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.188" +version = "1.0.164" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.164" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.29", ] [[package]] name = "serde_json" -version = "1.0.106" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cc66a619ed80bf7a0f6b17dd063a84b88f6dea1813737cf469aef1d081142c2" +checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" dependencies = [ - "indexmap 2.0.0", + "indexmap 1.9.3", "itoa", "ryu", "serde", @@ -4618,7 +4506,7 @@ checksum = "bcec881020c684085e55a25f7fd888954d56609ef363479dc5a1305eb0d40cab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.29", ] [[package]] @@ -4667,7 +4555,7 @@ dependencies = [ "darling 0.20.1", "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.29", ] [[package]] @@ -4692,7 +4580,7 @@ checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.29", ] [[package]] @@ -4864,7 +4752,6 @@ dependencies = [ "ring", "router_env", "serde", - "serde_json", "thiserror", "tokio", ] @@ -4925,7 +4812,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.32", + "syn 2.0.29", ] [[package]] @@ -4947,9 +4834,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.32" +version = "2.0.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" +checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a" dependencies = [ "proc-macro2", "quote", @@ -4962,18 +4849,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" -[[package]] -name = "synstructure" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "unicode-xid", -] - [[package]] name = "tagptr" version = "0.2.0" @@ -4990,7 +4865,7 @@ dependencies = [ "cfg-if", "fastrand", "redox_syscall 0.3.5", - "rustix 0.37.20", + "rustix", "windows-sys 0.48.0", ] @@ -5120,7 +4995,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.29", ] [[package]] @@ -5234,7 +5109,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.29", ] [[package]] @@ -5581,12 +5456,6 @@ version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" -[[package]] -name = "unicode-xid" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" - [[package]] name = "unidecode" version = "0.3.0" @@ -5644,7 +5513,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.29", ] [[package]] @@ -5783,7 +5652,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.29", "wasm-bindgen-shared", ] @@ -5817,7 +5686,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.29", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -6085,23 +5954,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "x509-parser" -version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7069fba5b66b9193bd2c5d3d4ff12b839118f6bcbef5328efafafb5395cf63da" -dependencies = [ - "asn1-rs", - "data-encoding", - "der-parser", - "lazy_static", - "nom", - "oid-registry", - "rusticata-macros", - "thiserror", - "time 0.3.22", -] - [[package]] name = "xmlparser" version = "0.13.5" diff --git a/crates/router/src/connector/adyen.rs b/crates/router/src/connector/adyen.rs index 1801f108f2e..9da548baf24 100644 --- a/crates/router/src/connector/adyen.rs +++ b/crates/router/src/connector/adyen.rs @@ -80,8 +80,10 @@ impl ConnectorValidation for Adyen { ) -> CustomResult<(), errors::ConnectorError> { let capture_method = capture_method.unwrap_or_default(); match capture_method { - enums::CaptureMethod::Automatic | enums::CaptureMethod::Manual => Ok(()), - enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err( + enums::CaptureMethod::Automatic + | enums::CaptureMethod::Manual + | enums::CaptureMethod::ManualMultiple => Ok(()), + enums::CaptureMethod::Scheduled => Err( connector_utils::construct_not_implemented_error_report(capture_method, self.id()), ), } @@ -204,6 +206,7 @@ impl data: data.clone(), http_code: res.status_code, }, + None, false, )) .change_context(errors::ConnectorError::ResponseHandlingFailed) @@ -468,15 +471,18 @@ impl .response .parse_struct("AdyenPaymentResponse") .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; - let is_manual_capture = - data.request.capture_method == Some(storage_enums::CaptureMethod::Manual); + let is_multiple_capture_sync = match data.request.sync_type { + types::SyncRequestType::MultipleCaptureSync(_) => true, + types::SyncRequestType::SinglePaymentSync => false, + }; types::RouterData::try_from(( types::ResponseRouterData { response, data: data.clone(), http_code: res.status_code, }, - is_manual_capture, + data.request.capture_method, + is_multiple_capture_sync, )) .change_context(errors::ConnectorError::ResponseHandlingFailed) } @@ -496,6 +502,12 @@ impl reason: None, }) } + + fn get_multiple_capture_sync_method( + &self, + ) -> CustomResult<services::CaptureSyncMethod, errors::ConnectorError> { + Ok(services::CaptureSyncMethod::Individual) + } } #[async_trait::async_trait] @@ -624,15 +636,14 @@ impl .response .parse_struct("AdyenPaymentResponse") .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; - let is_manual_capture = - data.request.capture_method == Some(diesel_models::enums::CaptureMethod::Manual); types::RouterData::try_from(( types::ResponseRouterData { response, data: data.clone(), http_code: res.status_code, }, - is_manual_capture, + data.request.capture_method, + false, )) .change_context(errors::ConnectorError::ResponseHandlingFailed) } @@ -1437,6 +1448,16 @@ impl api::IncomingWebhook for Adyen { ) -> CustomResult<api_models::webhooks::ObjectReferenceId, errors::ConnectorError> { let notif = get_webhook_object_from_body(request.body) .change_context(errors::ConnectorError::WebhookReferenceIdNotFound)?; + // for capture_event, original_reference field will have the authorized payment's PSP reference + if adyen::is_capture_event(&notif.event_code) { + return Ok(api_models::webhooks::ObjectReferenceId::PaymentId( + api_models::payments::PaymentIdType::ConnectorTransactionId( + notif + .original_reference + .ok_or(errors::ConnectorError::WebhookReferenceIdNotFound)?, + ), + )); + } if adyen::is_transaction_event(&notif.event_code) { return Ok(api_models::webhooks::ObjectReferenceId::PaymentId( api_models::payments::PaymentIdType::PaymentAttemptId(notif.merchant_reference), diff --git a/crates/router/src/connector/adyen/transformers.rs b/crates/router/src/connector/adyen/transformers.rs index c4d0c4f2c50..7e85d8d42da 100644 --- a/crates/router/src/connector/adyen/transformers.rs +++ b/crates/router/src/connector/adyen/transformers.rs @@ -278,6 +278,7 @@ pub struct Response { refusal_reason: Option<String>, refusal_reason_code: Option<String>, additional_data: Option<AdditionalData>, + event_code: Option<WebhookEventCode>, } #[derive(Debug, Clone, Serialize, Deserialize)] @@ -1449,7 +1450,8 @@ fn get_browser_info( fn get_additional_data(item: &types::PaymentsAuthorizeRouterData) -> Option<AdditionalData> { match item.request.capture_method { - Some(diesel_models::enums::CaptureMethod::Manual) => Some(AdditionalData { + Some(diesel_models::enums::CaptureMethod::Manual) + | Some(diesel_models::enums::CaptureMethod::ManualMultiple) => Some(AdditionalData { authorisation_type: Some(AuthType::PreAuth), manual_capture: Some(true), network_tx_reference: None, @@ -2822,6 +2824,7 @@ pub fn get_adyen_response( > { let status = storage_enums::AttemptStatus::foreign_from((is_capture_manual, response.result_code)); + let status = update_attempt_status_based_on_event_type_if_needed(status, &response.event_code); let error = if response.refusal_reason.is_some() || response.refusal_reason_code.is_some() { Some(types::ErrorResponse { code: response @@ -2860,6 +2863,42 @@ pub fn get_adyen_response( Ok((status, error, payments_response_data)) } +pub fn get_adyen_response_for_multiple_partial_capture( + response: Response, + status_code: u16, +) -> errors::CustomResult< + ( + storage_enums::AttemptStatus, + Option<types::ErrorResponse>, + types::PaymentsResponseData, + ), + errors::ConnectorError, +> { + let (status, error, _) = get_adyen_response(response.clone(), true, status_code)?; + let status = update_attempt_status_based_on_event_type_if_needed(status, &response.event_code); + let capture_sync_response_list = utils::construct_captures_response_hashmap(vec![response]); + Ok(( + status, + error, + types::PaymentsResponseData::MultipleCaptureResponse { + capture_sync_response_list, + }, + )) +} + +fn update_attempt_status_based_on_event_type_if_needed( + status: storage_enums::AttemptStatus, + event: &Option<WebhookEventCode>, +) -> storage_enums::AttemptStatus { + if status == storage_enums::AttemptStatus::Authorized + && event == &Some(WebhookEventCode::Capture) + { + storage_enums::AttemptStatus::Charged + } else { + status + } +} + pub fn get_redirection_response( response: RedirectionResponse, is_manual_capture: bool, @@ -3269,21 +3308,26 @@ pub fn get_present_to_shopper_metadata( impl<F, Req> TryFrom<( types::ResponseRouterData<F, AdyenPaymentResponse, Req, types::PaymentsResponseData>, + Option<storage_enums::CaptureMethod>, bool, )> for types::RouterData<F, Req, types::PaymentsResponseData> { type Error = Error; fn try_from( - items: ( + (item, capture_method, is_multiple_capture_psync_flow): ( types::ResponseRouterData<F, AdyenPaymentResponse, Req, types::PaymentsResponseData>, + Option<storage_enums::CaptureMethod>, bool, ), ) -> Result<Self, Self::Error> { - let item = items.0; - let is_manual_capture = items.1; + let is_manual_capture = utils::is_manual_capture(capture_method); let (status, error, payment_response_data) = match item.response { AdyenPaymentResponse::Response(response) => { - get_adyen_response(*response, is_manual_capture, item.http_code)? + if is_multiple_capture_psync_flow { + get_adyen_response_for_multiple_partial_capture(*response, item.http_code)? + } else { + get_adyen_response(*response, is_manual_capture, item.http_code)? + } } AdyenPaymentResponse::PresentToShopper(response) => { get_present_to_shopper_response(*response, is_manual_capture, item.http_code)? @@ -3319,9 +3363,15 @@ impl TryFrom<&types::PaymentsCaptureRouterData> for AdyenCaptureRequest { type Error = Error; fn try_from(item: &types::PaymentsCaptureRouterData) -> Result<Self, Self::Error> { let auth_type = AdyenAuthType::try_from(&item.connector_auth_type)?; + let reference = match item.request.multiple_capture_data.clone() { + // if multiple capture request, send capture_id as our reference for the capture + Some(multiple_capture_request_data) => multiple_capture_request_data.capture_reference, + // if single capture request, send connector_request_reference_id(attempt_id) + None => item.connector_request_reference_id.clone(), + }; Ok(Self { merchant_account: auth_type.merchant_account, - reference: item.connector_request_reference_id.clone(), + reference, amount: Amount { currency: item.request.currency.to_string(), value: item.request.amount_to_capture, @@ -3348,13 +3398,18 @@ impl TryFrom<types::PaymentsCaptureResponseRouterData<AdyenCaptureResponse>> fn try_from( item: types::PaymentsCaptureResponseRouterData<AdyenCaptureResponse>, ) -> Result<Self, Self::Error> { + let connector_transaction_id = if item.data.request.multiple_capture_data.is_some() { + item.response.psp_reference + } else { + item.response.payment_psp_reference + }; Ok(Self { // From the docs, the only value returned is "received", outcome of refund is available // through refund notification webhook // For more info: https://docs.adyen.com/online-payments/capture status: storage_enums::AttemptStatus::Pending, response: Ok(types::PaymentsResponseData::TransactionResponse { - resource_id: types::ResponseId::ConnectorTransactionId(item.response.psp_reference), + resource_id: types::ResponseId::ConnectorTransactionId(connector_transaction_id), redirection_data: None, mandate_reference: None, connector_metadata: None, @@ -3493,7 +3548,7 @@ pub struct AdyenAmountWH { pub currency: String, } -#[derive(Clone, Debug, Deserialize, strum::Display)] +#[derive(Clone, Debug, Deserialize, Serialize, strum::Display, PartialEq)] #[serde(rename_all = "SCREAMING_SNAKE_CASE")] #[strum(serialize_all = "SCREAMING_SNAKE_CASE")] pub enum WebhookEventCode { @@ -3507,6 +3562,8 @@ pub enum WebhookEventCode { SecondChargeback, PrearbitrationWon, PrearbitrationLost, + Capture, + CaptureFailed, #[serde(other)] Unknown, } @@ -3515,6 +3572,13 @@ pub fn is_transaction_event(event_code: &WebhookEventCode) -> bool { matches!(event_code, WebhookEventCode::Authorisation) } +pub fn is_capture_event(event_code: &WebhookEventCode) -> bool { + matches!( + event_code, + WebhookEventCode::Capture | WebhookEventCode::CaptureFailed + ) +} + pub fn is_refund_event(event_code: &WebhookEventCode) -> bool { matches!( event_code, @@ -3559,6 +3623,8 @@ impl ForeignFrom<(WebhookEventCode, Option<DisputeStatus>)> for webhooks::Incomi (WebhookEventCode::PrearbitrationWon, _) => Self::DisputeWon, (WebhookEventCode::PrearbitrationLost, _) => Self::DisputeLost, (WebhookEventCode::Unknown, _) => Self::EventNotSupported, + (WebhookEventCode::Capture, _) => Self::PaymentIntentSuccess, + (WebhookEventCode::CaptureFailed, _) => Self::PaymentIntentFailure, } } } @@ -3619,10 +3685,33 @@ impl From<AdyenNotificationRequestItemWH> for Response { refusal_reason: None, refusal_reason_code: None, additional_data: None, + event_code: Some(notif.event_code), } } } +impl utils::MultipleCaptureSyncResponse for Response { + fn get_connector_capture_id(&self) -> String { + self.psp_reference.clone() + } + + fn get_capture_attempt_status(&self) -> enums::AttemptStatus { + match self.result_code { + AdyenStatus::Authorised => enums::AttemptStatus::Charged, + _ => enums::AttemptStatus::CaptureFailed, + } + } + + fn is_capture_response(&self) -> bool { + self.event_code == Some(WebhookEventCode::Capture) + || self.event_code == Some(WebhookEventCode::CaptureFailed) + } + + fn get_connector_reference_id(&self) -> Option<String> { + Some(self.merchant_reference.clone()) + } +} + // Payouts #[cfg(feature = "payouts")] #[derive(Debug, Serialize, Deserialize)] diff --git a/crates/router/src/connector/globalpay.rs b/crates/router/src/connector/globalpay.rs index 31696ee3868..de0470be2e4 100644 --- a/crates/router/src/connector/globalpay.rs +++ b/crates/router/src/connector/globalpay.rs @@ -483,11 +483,18 @@ impl ConnectorIntegration<api::PSync, types::PaymentsSyncData, types::PaymentsRe .response .parse_struct("globalpay PaymentsResponse") .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; - types::RouterData::try_from(types::ResponseRouterData { - response, - data: data.clone(), - http_code: res.status_code, - }) + let is_multiple_capture_sync = match data.request.sync_type { + types::SyncRequestType::MultipleCaptureSync(_) => true, + types::SyncRequestType::SinglePaymentSync => false, + }; + types::RouterData::try_from(( + types::ResponseRouterData { + response, + data: data.clone(), + http_code: res.status_code, + }, + is_multiple_capture_sync, + )) .change_context(errors::ConnectorError::ResponseHandlingFailed) } fn get_multiple_capture_sync_method( diff --git a/crates/router/src/connector/globalpay/requests.rs b/crates/router/src/connector/globalpay/requests.rs index 4e3efcd12f2..ee62e8c2c2c 100644 --- a/crates/router/src/connector/globalpay/requests.rs +++ b/crates/router/src/connector/globalpay/requests.rs @@ -806,6 +806,7 @@ pub struct GlobalpayRefundRequest { pub struct GlobalpayCaptureRequest { pub amount: Option<String>, pub capture_sequence: Option<Sequence>, + pub reference: Option<String>, } #[derive(Default, Debug, Serialize)] diff --git a/crates/router/src/connector/globalpay/transformers.rs b/crates/router/src/connector/globalpay/transformers.rs index 6ef80213209..2100aa34f66 100644 --- a/crates/router/src/connector/globalpay/transformers.rs +++ b/crates/router/src/connector/globalpay/transformers.rs @@ -98,6 +98,11 @@ impl TryFrom<&types::PaymentsCaptureRouterData> for requests::GlobalpayCaptureRe Sequence::Subsequent } }), + reference: value + .request + .multiple_capture_data + .as_ref() + .map(|mcd| mcd.capture_reference.clone()), }) } } @@ -228,7 +233,7 @@ fn get_payment_response( mandate_reference, connector_metadata: None, network_txn_id: None, - connector_response_reference_id: None, + connector_response_reference_id: response.reference, }), } } @@ -274,6 +279,35 @@ impl<F, T> } } +impl + TryFrom<( + types::PaymentsSyncResponseRouterData<GlobalpayPaymentsResponse>, + bool, + )> for types::PaymentsSyncRouterData +{ + type Error = Error; + + fn try_from( + (value, is_multiple_capture_sync): ( + types::PaymentsSyncResponseRouterData<GlobalpayPaymentsResponse>, + bool, + ), + ) -> Result<Self, Self::Error> { + if is_multiple_capture_sync { + let capture_sync_response_list = + utils::construct_captures_response_hashmap(vec![value.response]); + Ok(Self { + response: Ok(types::PaymentsResponseData::MultipleCaptureResponse { + capture_sync_response_list, + }), + ..value.data + }) + } else { + Self::try_from(value) + } + } +} + impl<F, T> TryFrom<types::ResponseRouterData<F, GlobalpayRefreshTokenResponse, T, types::AccessToken>> for types::RouterData<F, T, types::AccessToken> @@ -458,3 +492,21 @@ impl TryFrom<&api_models::payments::BankRedirectData> for PaymentMethodData { } } } + +impl utils::MultipleCaptureSyncResponse for GlobalpayPaymentsResponse { + fn get_connector_capture_id(&self) -> String { + self.id.clone() + } + + fn get_capture_attempt_status(&self) -> diesel_models::enums::AttemptStatus { + enums::AttemptStatus::from(self.status) + } + + fn is_capture_response(&self) -> bool { + true + } + + fn get_connector_reference_id(&self) -> Option<String> { + self.reference.clone() + } +} diff --git a/crates/router/src/connector/utils.rs b/crates/router/src/connector/utils.rs index d7f0cf6d404..04c9af069c7 100644 --- a/crates/router/src/connector/utils.rs +++ b/crates/router/src/connector/utils.rs @@ -21,10 +21,7 @@ use crate::{ consts, core::errors::{self, CustomResult}, pii::PeekInterface, - types::{ - self, api, storage::enums as storage_enums, transformers::ForeignTryFrom, - PaymentsCancelData, ResponseId, - }, + types::{self, api, transformers::ForeignTryFrom, PaymentsCancelData, ResponseId}, utils::{OptionExt, ValueExt}, }; @@ -1364,7 +1361,7 @@ mod error_code_error_message_tests { pub trait MultipleCaptureSyncResponse { fn get_connector_capture_id(&self) -> String; - fn get_capture_attempt_status(&self) -> storage_enums::AttemptStatus; + fn get_capture_attempt_status(&self) -> enums::AttemptStatus; fn is_capture_response(&self) -> bool; fn get_connector_reference_id(&self) -> Option<String> { None @@ -1397,6 +1394,11 @@ where hashmap } +pub fn is_manual_capture(capture_method: Option<enums::CaptureMethod>) -> bool { + capture_method == Some(enums::CaptureMethod::Manual) + || capture_method == Some(enums::CaptureMethod::ManualMultiple) +} + pub fn validate_currency( request_currency: types::storage::enums::Currency, merchant_config_currency: Option<types::storage::enums::Currency>, diff --git a/crates/router/src/core/payments.rs b/crates/router/src/core/payments.rs index 0b1830bbf36..70c250d5335 100644 --- a/crates/router/src/core/payments.rs +++ b/crates/router/src/core/payments.rs @@ -1346,7 +1346,7 @@ where Ok(payment_data.to_owned()) } -#[derive(Clone)] +#[derive(Clone, PartialEq)] pub enum CallConnectorAction { Trigger, Avoid, @@ -1487,7 +1487,13 @@ pub fn should_call_connector<Op: Debug, F: Clone>( payment_data.payment_intent.status, storage_enums::IntentStatus::RequiresCapture | storage_enums::IntentStatus::PartiallyCaptured - ) + ) || (matches!( + payment_data.payment_intent.status, + storage_enums::IntentStatus::Processing + ) && matches!( + payment_data.payment_attempt.capture_method, + Some(storage_enums::CaptureMethod::ManualMultiple) + )) } "CompleteAuthorize" => true, "PaymentApprove" => true, diff --git a/crates/router/src/core/payments/flows/psync_flow.rs b/crates/router/src/core/payments/flows/psync_flow.rs index b6920387b13..1c01af79f56 100644 --- a/crates/router/src/core/payments/flows/psync_flow.rs +++ b/crates/router/src/core/payments/flows/psync_flow.rs @@ -157,10 +157,9 @@ impl types::RouterData<api::PSync, types::PaymentsSyncData, types::PaymentsRespo types::PaymentsResponseData, >, ) -> RouterResult<Self> { - let mut capture_sync_response_list = HashMap::new(); - for connector_capture_id in pending_connector_capture_id_list { - self.request.connector_transaction_id = - types::ResponseId::ConnectorTransactionId(connector_capture_id.clone()); + let mut capture_sync_response_map = HashMap::new(); + if let payments::CallConnectorAction::HandleResponse(_) = call_connector_action { + // webhook consume flow, only call connector once. Since there will only be a single event in every webhook let resp = services::execute_connector_processing_step( state, connector_integration.clone(), @@ -170,30 +169,40 @@ impl types::RouterData<api::PSync, types::PaymentsSyncData, types::PaymentsRespo ) .await .to_payment_failed_response()?; - let capture_sync_response = match resp.response { - Err(err) => types::CaptureSyncResponse::Error { - code: err.code, - message: err.message, - reason: err.reason, - status_code: err.status_code, - }, - Ok(types::PaymentsResponseData::TransactionResponse { - resource_id, - connector_response_reference_id, - .. - }) => types::CaptureSyncResponse::Success { - resource_id, - status: resp.status, - connector_response_reference_id, - }, - // this error is never meant to occur. response type will always be PaymentsResponseData::TransactionResponse - _ => Err(ApiErrorResponse::PreconditionFailed { message: "Response type must be PaymentsResponseData::TransactionResponse for payment sync".into() })?, - }; - capture_sync_response_list.insert(connector_capture_id.clone(), capture_sync_response); + Ok(resp) + } else { + // in trigger, call connector for every capture_id + for connector_capture_id in pending_connector_capture_id_list { + self.request.connector_transaction_id = + types::ResponseId::ConnectorTransactionId(connector_capture_id.clone()); + let resp = services::execute_connector_processing_step( + state, + connector_integration.clone(), + &self, + call_connector_action.clone(), + None, + ) + .await + .to_payment_failed_response()?; + match resp.response { + Err(err) => { + capture_sync_response_map.insert(connector_capture_id, types::CaptureSyncResponse::Error { + code: err.code, + message: err.message, + reason: err.reason, + status_code: err.status_code, + }); + }, + Ok(types::PaymentsResponseData::MultipleCaptureResponse { capture_sync_response_list })=> { + capture_sync_response_map.extend(capture_sync_response_list.into_iter()); + } + _ => Err(ApiErrorResponse::PreconditionFailed { message: "Response type must be PaymentsResponseData::MultipleCaptureResponse for payment sync".into() })?, + }; + } + self.response = Ok(types::PaymentsResponseData::MultipleCaptureResponse { + capture_sync_response_list: capture_sync_response_map, + }); + Ok(self) } - self.response = Ok(types::PaymentsResponseData::MultipleCaptureResponse { - capture_sync_response_list, - }); - Ok(self) } } diff --git a/crates/router/src/core/payments/helpers.rs b/crates/router/src/core/payments/helpers.rs index bbba0dffd0b..ef6bdc9f79b 100644 --- a/crates/router/src/core/payments/helpers.rs +++ b/crates/router/src/core/payments/helpers.rs @@ -1450,16 +1450,30 @@ pub(crate) fn validate_capture_method( } #[instrument(skip_all)] -pub(crate) fn validate_status(status: storage_enums::IntentStatus) -> RouterResult<()> { +pub(crate) fn validate_status_with_capture_method( + status: storage_enums::IntentStatus, + capture_method: storage_enums::CaptureMethod, +) -> RouterResult<()> { + if status == storage_enums::IntentStatus::Processing + && !(capture_method == storage_enums::CaptureMethod::ManualMultiple) + { + return Err(report!(errors::ApiErrorResponse::PaymentUnexpectedState { + field_name: "capture_method".to_string(), + current_flow: "captured".to_string(), + current_value: capture_method.to_string(), + states: "manual_multiple".to_string() + })); + } utils::when( status != storage_enums::IntentStatus::RequiresCapture - && status != storage_enums::IntentStatus::PartiallyCaptured, + && status != storage_enums::IntentStatus::PartiallyCaptured + && status != storage_enums::IntentStatus::Processing, || { Err(report!(errors::ApiErrorResponse::PaymentUnexpectedState { field_name: "payment.status".to_string(), current_flow: "captured".to_string(), current_value: status.to_string(), - states: "requires_capture, partially captured".to_string() + states: "requires_capture, partially_captured, processing".to_string() })) }, ) diff --git a/crates/router/src/core/payments/operations/payment_capture.rs b/crates/router/src/core/payments/operations/payment_capture.rs index 596e25f0528..054f9a31b90 100644 --- a/crates/router/src/core/payments/operations/payment_capture.rs +++ b/crates/router/src/core/payments/operations/payment_capture.rs @@ -61,10 +61,6 @@ impl<F: Send + Clone> GetTracker<F, payments::PaymentData<F>, api::PaymentsCaptu .await .to_not_found_response(errors::ApiErrorResponse::PaymentNotFound)?; - helpers::validate_status(payment_intent.status)?; - - helpers::validate_amount_to_capture(payment_intent.amount, request.amount_to_capture)?; - payment_attempt = db .find_payment_attempt_by_payment_id_merchant_id_attempt_id( payment_intent.payment_id.as_str(), @@ -83,6 +79,10 @@ impl<F: Send + Clone> GetTracker<F, payments::PaymentData<F>, api::PaymentsCaptu .capture_method .get_required_value("capture_method")?; + helpers::validate_status_with_capture_method(payment_intent.status, capture_method)?; + + helpers::validate_amount_to_capture(payment_intent.amount, request.amount_to_capture)?; + helpers::validate_capture_method(capture_method)?; let (multiple_capture_data, connector_response) = if capture_method
feat
(adyen) add support for multiple partial capture adyen (#2102)
8ee097ea21bd2fe48854d5950cf27f879a4aa2f7
2023-02-23 14:56:30
Sangamesh Kulkarni
feat: applepay payment request object (#519)
false
diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rs index a4705057be9..a06d6420103 100644 --- a/crates/api_models/src/payments.rs +++ b/crates/api_models/src/payments.rs @@ -1096,51 +1096,100 @@ pub struct GpaySessionTokenData { #[serde(rename_all = "lowercase")] pub enum SessionToken { /// The session response structure for Google Pay - Gpay { - /// The merchant info - merchant_info: GpayMerchantInfo, - /// List of the allowed payment meythods - allowed_payment_methods: Vec<GpayAllowedPaymentMethods>, - /// The transaction info Google Pay requires - transaction_info: GpayTransactionInfo, - }, + Gpay(Box<GpayData>), /// The session response structure for Klarna - Klarna { - /// The session token for Klarna - session_token: String, - /// The identifier for the session - session_id: String, - }, + Klarna(Box<KlarnaData>), /// The session response structure for PayPal - Paypal { - /// The session token for PayPal - session_token: String, - }, + Paypal(Box<PaypalData>), /// The session response structure for Apple Pay - Applepay { - /// Timestamp at which session is requested - epoch_timestamp: u64, - /// Timestamp at which session expires - expires_at: u64, - /// The identifier for the merchant session - merchant_session_identifier: String, - /// Applepay generates unique ID (UUID) value - nonce: String, - /// The identifier for the merchant - merchant_identifier: String, - /// The domain name of the merchant which is registered in Apple Pay - domain_name: String, - /// The name to be displayed on Apple Pay button - display_name: String, - /// A string which represents the properties of a payment - signature: String, - /// The identifier for the operational analytics - operational_analytics_identifier: String, - /// The number of retries to get the session response - retries: u8, - /// The identifier for the connector transaction - psp_id: String, - }, + Applepay(Box<ApplepayData>), +} + +#[derive(Debug, Clone, serde::Serialize, ToSchema)] +#[serde(rename_all = "lowercase")] +pub struct GpayData { + /// The merchant info + pub merchant_info: GpayMerchantInfo, + /// List of the allowed payment meythods + pub allowed_payment_methods: Vec<GpayAllowedPaymentMethods>, + /// The transaction info Google Pay requires + pub transaction_info: GpayTransactionInfo, +} + +#[derive(Debug, Clone, serde::Serialize, ToSchema)] +#[serde(rename_all = "lowercase")] +pub struct KlarnaData { + /// The session token for Klarna + pub session_token: String, + /// The identifier for the session + pub session_id: String, +} + +#[derive(Debug, Clone, serde::Serialize, ToSchema)] +#[serde(rename_all = "lowercase")] +pub struct PaypalData { + /// The session token for PayPal + pub session_token: String, +} + +#[derive(Debug, Clone, serde::Serialize, ToSchema)] +#[serde(rename_all = "lowercase")] +pub struct ApplepayData { + /// Session object for Apple Pay + pub session_object: ApplePaySessionObject, + /// Payment request object for Apple Pay + pub payment_request_object: ApplePayRequest, +} + +#[derive(Debug, Clone, serde::Serialize, ToSchema, serde::Deserialize)] +pub struct ApplePaySessionObject { + /// Timestamp at which session is requested + pub epoch_timestamp: u64, + /// Timestamp at which session expires + pub expires_at: u64, + /// The identifier for the merchant session + pub merchant_session_identifier: String, + /// Applepay generates unique ID (UUID) value + pub nonce: String, + /// The identifier for the merchant + pub merchant_identifier: String, + /// The domain name of the merchant which is registered in Apple Pay + pub domain_name: String, + /// The name to be displayed on Apple Pay button + pub display_name: String, + /// A string which represents the properties of a payment + pub signature: String, + /// The identifier for the operational analytics + pub operational_analytics_identifier: String, + /// The number of retries to get the session response + pub retries: u8, + /// The identifier for the connector transaction + pub psp_id: String, +} + +#[derive(Debug, Clone, serde::Serialize, ToSchema, serde::Deserialize)] +pub struct ApplePayRequest { + /// The code for country + pub country_code: String, + /// The code for currency + pub currency_code: String, + /// Represents the total for the payment. + pub total: AmountInfo, + /// The list of merchant capabilities(ex: whether capable of 3ds or no-3ds) + pub merchant_capabilities: Vec<String>, + /// The list of supported networks + pub supported_networks: Vec<String>, +} + +#[derive(Debug, Clone, serde::Serialize, ToSchema, serde::Deserialize)] +pub struct AmountInfo { + /// the label must be non-empty to pass validation. + pub label: String, + /// The type of label + #[serde(rename = "type")] + pub label_type: String, + /// The total amount for the payment + pub amount: String, } #[derive(Default, Debug, serde::Serialize, Clone, ToSchema)] diff --git a/crates/router/src/connector/applepay.rs b/crates/router/src/connector/applepay.rs index edcd40127cb..3687c3b7824 100644 --- a/crates/router/src/connector/applepay.rs +++ b/crates/router/src/connector/applepay.rs @@ -197,11 +197,11 @@ impl .get_required_value("connector_meta_data") .change_context(errors::ConnectorError::NoConnectorMetaData)?; - let session_object: transformers::SessionObject = metadata - .parse_value("SessionObject") + let metadata: transformers::ApplePayMetaData = metadata + .parse_value("ApplePayMetaData") .change_context(errors::ConnectorError::RequestEncodingFailed)?; - Ok(Some(session_object.certificate)) + Ok(Some(metadata.session_object.certificate)) } fn get_certificate_key( @@ -214,11 +214,11 @@ impl .get_required_value("connector_meta_data") .change_context(errors::ConnectorError::NoConnectorMetaData)?; - let session_object: transformers::SessionObject = metadata - .parse_value("SessionObject") + let metadata: transformers::ApplePayMetaData = metadata + .parse_value("ApplePayMetaData") .change_context(errors::ConnectorError::RequestEncodingFailed)?; - Ok(Some(session_object.certificate_keys)) + Ok(Some(metadata.session_object.certificate_keys)) } } diff --git a/crates/router/src/connector/applepay/transformers.rs b/crates/router/src/connector/applepay/transformers.rs index 44379991fc6..3488c2126eb 100644 --- a/crates/router/src/connector/applepay/transformers.rs +++ b/crates/router/src/connector/applepay/transformers.rs @@ -1,3 +1,4 @@ +use api_models::payments; use common_utils::ext_traits::ValueExt; use error_stack::ResultExt; use masking::{Deserialize, Serialize}; @@ -16,17 +17,17 @@ pub struct ApplepaySessionRequest { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct ApplepaySessionResponse { - epoch_timestamp: u64, - expires_at: u64, - merchant_session_identifier: String, - nonce: String, - merchant_identifier: String, - domain_name: String, - display_name: String, - signature: String, - operational_analytics_identifier: String, - retries: u8, - psp_id: String, + pub epoch_timestamp: u64, + pub expires_at: u64, + pub merchant_session_identifier: String, + pub nonce: String, + pub merchant_identifier: String, + pub domain_name: String, + pub display_name: String, + pub signature: String, + pub operational_analytics_identifier: String, + pub retries: u8, + pub psp_id: String, } #[derive(Debug, Default, Serialize, Deserialize)] @@ -36,6 +37,19 @@ pub struct ErrorResponse { pub status_message: String, } +#[derive(Debug, Default, Serialize, Deserialize)] +pub struct ApplePayMetaData { + pub payment_object: PaymentObjectMetaData, + pub session_object: SessionObject, +} + +#[derive(Debug, Default, Serialize, Deserialize)] +pub struct PaymentObjectMetaData { + pub supported_networks: Vec<String>, + pub merchant_capabilities: Vec<String>, + pub label: String, +} + #[derive(Debug, Default, Serialize, Deserialize)] pub struct SessionObject { pub certificate: String, @@ -46,6 +60,25 @@ pub struct SessionObject { pub initiative_context: String, } +#[derive(Debug, Default, Serialize, Deserialize)] +#[serde(rename_all = "snake_case")] +pub struct PaymentRequest { + pub apple_pay_merchant_id: String, + pub country_code: String, + pub currency_code: String, + pub total: AmountInfo, + pub merchant_capabilities: Vec<String>, + pub supported_networks: Vec<String>, +} + +#[derive(Debug, Default, Serialize, Deserialize)] +pub struct AmountInfo { + pub label: String, + #[serde(rename = "type")] + pub label_type: String, + pub amount: String, +} + impl TryFrom<&types::PaymentsSessionRouterData> for ApplepaySessionRequest { type Error = error_stack::Report<errors::ConnectorError>; fn try_from(item: &types::PaymentsSessionRouterData) -> Result<Self, Self::Error> { @@ -55,48 +88,136 @@ impl TryFrom<&types::PaymentsSessionRouterData> for ApplepaySessionRequest { .get_required_value("connector_meta_data") .change_context(errors::ConnectorError::NoConnectorMetaData)?; - let session_object: SessionObject = metadata - .parse_value("SessionObject") + let metadata: ApplePayMetaData = metadata + .parse_value("ApplePayMetaData") .change_context(errors::ConnectorError::RequestEncodingFailed)?; Ok(Self { - merchant_identifier: session_object.merchant_identifier, - display_name: session_object.display_name, - initiative: session_object.initiative, - initiative_context: session_object.initiative_context, + merchant_identifier: metadata.session_object.merchant_identifier, + display_name: metadata.session_object.display_name, + initiative: metadata.session_object.initiative, + initiative_context: metadata.session_object.initiative_context, }) } } -impl<F, T> - TryFrom<types::ResponseRouterData<F, ApplepaySessionResponse, T, types::PaymentsResponseData>> - for types::RouterData<F, T, types::PaymentsResponseData> +impl<F> + TryFrom< + types::ResponseRouterData< + F, + ApplepaySessionResponse, + types::PaymentsSessionData, + types::PaymentsResponseData, + >, + > for types::RouterData<F, types::PaymentsSessionData, types::PaymentsResponseData> { type Error = error_stack::Report<errors::ConnectorError>; fn try_from( - item: types::ResponseRouterData<F, ApplepaySessionResponse, T, types::PaymentsResponseData>, + item: types::ResponseRouterData< + F, + ApplepaySessionResponse, + types::PaymentsSessionData, + types::PaymentsResponseData, + >, ) -> Result<Self, Self::Error> { + let metadata = item + .data + .connector_meta_data + .to_owned() + .get_required_value("connector_meta_data") + .change_context(errors::ConnectorError::NoConnectorMetaData)?; + + let metadata: ApplePayMetaData = metadata + .parse_value("ApplePayMetaData") + .change_context(errors::ConnectorError::RequestEncodingFailed)?; + + let amount_info = AmountInfo { + label: metadata.payment_object.label, + label_type: "final".to_string(), + amount: (item.data.request.amount / 100).to_string(), + }; + + let payment_request = PaymentRequest { + country_code: item + .data + .request + .country + .to_owned() + .get_required_value("country_code") + .change_context(errors::ConnectorError::MissingRequiredField { + field_name: "country_code", + })?, + currency_code: item.data.request.currency.to_string(), + total: amount_info, + merchant_capabilities: metadata.payment_object.merchant_capabilities, + supported_networks: metadata.payment_object.supported_networks, + apple_pay_merchant_id: metadata.session_object.merchant_identifier, + }; + + let applepay_session_object = ApplepaySessionResponse { + epoch_timestamp: item.response.epoch_timestamp, + expires_at: item.response.expires_at, + merchant_session_identifier: item.response.merchant_session_identifier, + nonce: item.response.nonce, + merchant_identifier: item.response.merchant_identifier, + domain_name: item.response.domain_name, + display_name: item.response.display_name, + signature: item.response.signature, + operational_analytics_identifier: item.response.operational_analytics_identifier, + retries: item.response.retries, + psp_id: item.response.psp_id, + }; + Ok(Self { response: Ok(types::PaymentsResponseData::SessionResponse { session_token: { - api_models::payments::SessionToken::Applepay { - epoch_timestamp: item.response.epoch_timestamp, - expires_at: item.response.expires_at, - merchant_session_identifier: item.response.merchant_session_identifier, - nonce: item.response.nonce, - merchant_identifier: item.response.merchant_identifier, - domain_name: item.response.domain_name, - display_name: item.response.display_name, - signature: item.response.signature, - operational_analytics_identifier: item - .response - .operational_analytics_identifier, - retries: item.response.retries, - psp_id: item.response.psp_id, - } + api_models::payments::SessionToken::Applepay(Box::new(payments::ApplepayData { + session_object: applepay_session_object.into(), + payment_request_object: payment_request.into(), + })) }, }), ..item.data }) } } + +impl From<PaymentRequest> for payments::ApplePayRequest { + fn from(value: PaymentRequest) -> Self { + Self { + country_code: value.country_code, + currency_code: value.currency_code, + total: value.total.into(), + merchant_capabilities: value.merchant_capabilities, + supported_networks: value.supported_networks, + } + } +} + +impl From<AmountInfo> for payments::AmountInfo { + fn from(value: AmountInfo) -> Self { + Self { + label: value.label, + label_type: value.label_type, + amount: value.amount, + } + } +} + +impl From<ApplepaySessionResponse> for payments::ApplePaySessionObject { + fn from(value: ApplepaySessionResponse) -> Self { + Self { + epoch_timestamp: value.epoch_timestamp, + expires_at: value.expires_at, + merchant_session_identifier: value.merchant_session_identifier, + nonce: value.nonce, + merchant_identifier: value.merchant_identifier, + domain_name: value.domain_name, + display_name: value.display_name, + signature: value.signature, + operational_analytics_identifier: value.operational_analytics_identifier, + retries: value.retries, + psp_id: value.psp_id, + } + } +} diff --git a/crates/router/src/connector/braintree/transformers.rs b/crates/router/src/connector/braintree/transformers.rs index e2ca6ae93f8..09962ecd78a 100644 --- a/crates/router/src/connector/braintree/transformers.rs +++ b/crates/router/src/connector/braintree/transformers.rs @@ -1,3 +1,4 @@ +use api_models::payments; use base64::Engine; use error_stack::ResultExt; use serde::{Deserialize, Serialize}; @@ -243,9 +244,9 @@ impl<F, T> ) -> Result<Self, Self::Error> { Ok(Self { response: Ok(types::PaymentsResponseData::SessionResponse { - session_token: types::api::SessionToken::Paypal { + session_token: types::api::SessionToken::Paypal(Box::new(payments::PaypalData { session_token: item.response.client_token.value, - }, + })), }), ..item.data }) diff --git a/crates/router/src/connector/klarna/transformers.rs b/crates/router/src/connector/klarna/transformers.rs index 589eeecf19b..2d4a02289b7 100644 --- a/crates/router/src/connector/klarna/transformers.rs +++ b/crates/router/src/connector/klarna/transformers.rs @@ -1,3 +1,4 @@ +use api_models::payments; use error_stack::report; use serde::{Deserialize, Serialize}; @@ -71,10 +72,10 @@ impl TryFrom<types::PaymentsSessionResponseRouterData<KlarnaSessionResponse>> let response = &item.response; Ok(Self { response: Ok(types::PaymentsResponseData::SessionResponse { - session_token: types::api::SessionToken::Klarna { + session_token: types::api::SessionToken::Klarna(Box::new(payments::KlarnaData { session_token: response.client_token.clone(), session_id: response.session_id.clone(), - }, + })), }), ..item.data }) diff --git a/crates/router/src/core/payments/flows/session_flow.rs b/crates/router/src/core/payments/flows/session_flow.rs index 158edcbc81f..b2950004dbc 100644 --- a/crates/router/src/core/payments/flows/session_flow.rs +++ b/crates/router/src/core/payments/flows/session_flow.rs @@ -91,11 +91,11 @@ fn create_gpay_session_token( let response_router_data = types::PaymentsSessionRouterData { response: Ok(types::PaymentsResponseData::SessionResponse { - session_token: payment_types::SessionToken::Gpay { - transaction_info, + session_token: payment_types::SessionToken::Gpay(Box::new(payment_types::GpayData { merchant_info: gpay_data.data.merchant_info, allowed_payment_methods: gpay_data.data.allowed_payment_methods, - }, + transaction_info, + })), }), ..router_data.clone() }; diff --git a/crates/router/src/openapi.rs b/crates/router/src/openapi.rs index 89032a53ea7..9be89d49bfd 100644 --- a/crates/router/src/openapi.rs +++ b/crates/router/src/openapi.rs @@ -173,12 +173,19 @@ Never share your secret api keys. Keep them guarded and secure. api_models::payments::PaymentsSessionRequest, api_models::payments::PaymentsSessionResponse, api_models::payments::SessionToken, + api_models::payments::ApplePaySessionObject, + api_models::payments::ApplePayRequest, + api_models::payments::AmountInfo, api_models::payments::GpayMerchantInfo, api_models::payments::GpayAllowedPaymentMethods, api_models::payments::GpayAllowedMethodsParameters, api_models::payments::GpayTokenizationSpecification, api_models::payments::GpayTokenParameters, api_models::payments::GpayTransactionInfo, + api_models::payments::GpayData, + api_models::payments::KlarnaData, + api_models::payments::PaypalData, + api_models::payments::ApplepayData, api_models::payments::PaymentsCancelRequest, api_models::payments::PaymentListConstraints, api_models::payments::PaymentListResponse, diff --git a/openapi/generated.json b/openapi/generated.json index 28273b8b5b9..ad3192abbc4 100644 --- a/openapi/generated.json +++ b/openapi/generated.json @@ -2,7 +2,7 @@ "openapi": "3.0.3", "info": { "title": "Hyperswitch - API Documentation", - "description": "\n## Get started\n\nHyperswitch provides a collection of APIs that enable you to process and manage payments.\nOur APIs accept and return JSON in the HTTP body, and return standard HTTP response codes.\n\nYou can consume the APIs directly using your favorite HTTP/REST library.\n\nWe have a testing environment referred to \"sandbox\", which you can setup to test API calls without\naffecting production data. Currently, our sandbox environment is live while our production environment is under development and will be available soon. You can sign up on our Dashboard to get API keys to access Hyperswitch API.\n\n### Environment\n\nUse the following base URLs when making requests to the APIs:\n\n| Environment | Base URL |\n|---------------|------------------------------------|\n| Sandbox | <https://sandbox.hyperswitch.io> |\n| Production | Coming Soon! |\n\n## Authentication\n\nWhen you sign up on our [dashboard](https://app.hyperswitch.io) and create a merchant\naccount, you are given a secret key (also referred as api-key) and a publishable key.\nYou may authenticate all API requests with Hyperswitch server by providing the appropriate key in the\nrequest Authorization header.\n\n| Key | Description |\n|---------------|-----------------------------------------------------------------------------------------------|\n| Sandbox | Private key. Used to authenticate all API requests from your merchant server |\n| Production | Unique identifier for your account. Used to authenticate API requests from your app’s client |\n\nNever share your secret api keys. Keep them guarded and secure.\n", + "description": "\n## Get started\n\nHyperswitch provides a collection of APIs that enable you to process and manage payments.\nOur APIs accept and return JSON in the HTTP body, and return standard HTTP response codes.\n\nYou can consume the APIs directly using your favorite HTTP/REST library.\n\nWe have a testing environment referred to \"sandbox\", which you can setup to test API calls without\naffecting production data.\nCurrently, our sandbox environment is live while our production environment is under development\nand will be available soon.\nYou can sign up on our Dashboard to get API keys to access Hyperswitch API.\n\n### Environment\n\nUse the following base URLs when making requests to the APIs:\n\n| Environment | Base URL |\n|---------------|------------------------------------|\n| Sandbox | <https://sandbox.hyperswitch.io> |\n| Production | Coming Soon! |\n\n## Authentication\n\nWhen you sign up on our [dashboard](https://app.hyperswitch.io) and create a merchant\naccount, you are given a secret key (also referred as api-key) and a publishable key.\nYou may authenticate all API requests with Hyperswitch server by providing the appropriate key in\nthe request Authorization header.\n\n| Key | Description |\n|---------------|-----------------------------------------------------------------------------------------------|\n| Sandbox | Private key. Used to authenticate all API requests from your merchant server |\n| Production | Unique identifier for your account. Used to authenticate API requests from your app's client |\n\nNever share your secret api keys. Keep them guarded and secure.\n", "contact": { "name": "Hyperswitch Support", "url": "https://hyperswitch.io", @@ -22,7 +22,9 @@ "paths": { "/accounts": { "post": { - "tags": ["Merchant Account"], + "tags": [ + "Merchant Account" + ], "summary": "", "description": "\nCreate a new account for a merchant and the merchant could be a seller or retailer or client who likes to receive and send payments.", "operationId": "Create a Merchant Account", @@ -56,7 +58,9 @@ }, "/accounts/{account_id}": { "get": { - "tags": ["Merchant Account"], + "tags": [ + "Merchant Account" + ], "summary": "", "description": "\nRetrieve a merchant account details.", "operationId": "Retrieve a Merchant Account", @@ -89,7 +93,9 @@ "deprecated": false }, "post": { - "tags": ["Merchant Account"], + "tags": [ + "Merchant Account" + ], "summary": "", "description": "\nTo update an existing merchant account. Helpful in updating merchant details such as email, contact details, or other configuration details like webhook, routing algorithm etc", "operationId": "Update a Merchant Account", @@ -132,7 +138,9 @@ "deprecated": false }, "delete": { - "tags": ["Merchant Account"], + "tags": [ + "Merchant Account" + ], "summary": "", "description": "\nTo delete a merchant account", "operationId": "Delete a Merchant Account", @@ -167,7 +175,9 @@ }, "/accounts/{account_id}/connectors": { "get": { - "tags": ["Merchant Connector Account"], + "tags": [ + "Merchant Connector Account" + ], "summary": "", "description": "\nList Payment Connector Details for the merchant", "operationId": "List all Merchant Connectors", @@ -206,7 +216,9 @@ "deprecated": false }, "post": { - "tags": ["Merchant Connector Account"], + "tags": [ + "Merchant Connector Account" + ], "summary": "", "description": "\nCreate a new Payment Connector for the merchant account. The connector could be a payment processor / facilitator / acquirer or specialized services like Fraud / Accounting etc.\"", "operationId": "Create a Merchant Connector", @@ -240,7 +252,9 @@ }, "/accounts/{account_id}/connectors/{connector_id}": { "get": { - "tags": ["Merchant Connector Account"], + "tags": [ + "Merchant Connector Account" + ], "summary": "", "description": "\nRetrieve Payment Connector Details", "operationId": "Retrieve a Merchant Connector", @@ -286,7 +300,9 @@ "deprecated": false }, "post": { - "tags": ["Merchant Connector Account"], + "tags": [ + "Merchant Connector Account" + ], "summary": "", "description": "\nTo update an existing Payment Connector. Helpful in enabling / disabling different payment methods and other settings for the connector etc.", "operationId": "Update a Merchant Connector", @@ -342,7 +358,9 @@ "deprecated": false }, "delete": { - "tags": ["Merchant Connector Account"], + "tags": [ + "Merchant Connector Account" + ], "summary": "", "description": "\nDelete or Detach a Payment Connector from Merchant Account", "operationId": "Delete a Merchant Connector", @@ -388,7 +406,7 @@ "deprecated": false } }, - "/api_keys": { + "/api_keys/{merchant_id)": { "post": { "tags": [ "API Key" @@ -424,7 +442,44 @@ "deprecated": false } }, - "/api_keys/list": { + "/api_keys/{merchant_id)/{key_id}": { + "delete": { + "tags": [ + "API Key" + ], + "summary": "API Key - Revoke", + "description": "API Key - Revoke\n\nRevoke the specified API Key. Once revoked, the API Key can no longer be used for\nauthenticating with our APIs.", + "operationId": "Revoke an API Key", + "parameters": [ + { + "name": "key_id", + "in": "path", + "description": "The unique identifier for the API Key", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "API Key revoked", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RevokeApiKeyResponse" + } + } + } + }, + "404": { + "description": "API Key not found" + } + }, + "deprecated": false + } + }, + "/api_keys/{merchant_id}/list": { "get": { "tags": [ "API Key" @@ -472,7 +527,7 @@ "deprecated": false } }, - "/api_keys/{key_id}": { + "/api_keys/{merchant_id}/{key_id}": { "get": { "tags": [ "API Key" @@ -552,46 +607,13 @@ } }, "deprecated": false - }, - "delete": { - "tags": [ - "API Key" - ], - "summary": "API Key - Revoke", - "description": "API Key - Revoke\n\nRevoke the specified API Key. Once revoked, the API Key can no longer be used for\nauthenticating with our APIs.", - "operationId": "Revoke an API Key", - "parameters": [ - { - "name": "key_id", - "in": "path", - "description": "The unique identifier for the API Key", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "API Key revoked", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RevokeApiKeyResponse" - } - } - } - }, - "404": { - "description": "API Key not found" - } - }, - "deprecated": false } }, "/customers": { "post": { - "tags": ["Customers"], + "tags": [ + "Customers" + ], "summary": "", "description": "\nCreate a customer object and store the customer details to be reused for future payments. Incase the customer already exists in the system, this API will respond with the customer details.", "operationId": "Create a Customer", @@ -625,7 +647,9 @@ }, "/customers/{customer_id}": { "get": { - "tags": ["Customers"], + "tags": [ + "Customers" + ], "summary": "", "description": "\nRetrieve a customer's details.", "operationId": "Retrieve a Customer", @@ -658,7 +682,9 @@ "deprecated": false }, "post": { - "tags": ["Customers"], + "tags": [ + "Customers" + ], "summary": "", "description": "\nUpdates the customer's details in a customer object.", "operationId": "Update a Customer", @@ -701,7 +727,9 @@ "deprecated": false }, "delete": { - "tags": ["Customers"], + "tags": [ + "Customers" + ], "summary": "", "description": "\nDelete a customer record.", "operationId": "Delete a Customer", @@ -736,7 +764,9 @@ }, "/mandates/revoke/{mandate_id}": { "post": { - "tags": ["Mandates"], + "tags": [ + "Mandates" + ], "summary": "", "description": "\nRevoke a mandate", "operationId": "Revoke a Mandate", @@ -771,7 +801,9 @@ }, "/mandates/{mandate_id}": { "get": { - "tags": ["Mandates"], + "tags": [ + "Mandates" + ], "summary": "", "description": "\nRetrieve a mandate", "operationId": "Retrieve a Mandate", @@ -806,7 +838,9 @@ }, "/payment_methods": { "post": { - "tags": ["Payment Methods"], + "tags": [ + "Payment Methods" + ], "summary": "", "description": "\nTo create a payment method against a customer object. In case of cards, this API could be used only by PCI compliant merchants", "operationId": "Create a Payment Method", @@ -840,7 +874,9 @@ }, "/payment_methods/{account_id}": { "get": { - "tags": ["Payment Methods"], + "tags": [ + "Payment Methods" + ], "summary": "", "description": "\nTo filter and list the applicable payment methods for a particular Merchant ID", "operationId": "List all Payment Methods for a Merchant", @@ -940,7 +976,9 @@ }, "/payment_methods/{customer_id}": { "get": { - "tags": ["Payment Methods"], + "tags": [ + "Payment Methods" + ], "summary": "", "description": "\nTo filter and list the applicable payment methods for a particular Customer ID", "operationId": "List all Payment Methods for a Customer", @@ -1040,7 +1078,9 @@ }, "/payment_methods/{method_id}": { "get": { - "tags": ["Payment Methods"], + "tags": [ + "Payment Methods" + ], "summary": "", "description": "\nTo retrieve a payment method", "operationId": "Retrieve a Payment method", @@ -1073,7 +1113,9 @@ "deprecated": false }, "post": { - "tags": ["Payment Methods"], + "tags": [ + "Payment Methods" + ], "summary": "", "description": "\nTo update an existing payment method attached to a customer object. This API is useful for use cases such as updating the card number for expired cards to prevent discontinuity in recurring payments", "operationId": "Update a Payment method", @@ -1116,7 +1158,9 @@ "deprecated": false }, "delete": { - "tags": ["Payment Methods"], + "tags": [ + "Payment Methods" + ], "summary": "", "description": "\nDelete payment method", "operationId": "Delete a Payment method", @@ -1151,7 +1195,9 @@ }, "/payments": { "post": { - "tags": ["Payments"], + "tags": [ + "Payments" + ], "summary": "", "description": "\nTo 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", "operationId": "Create a Payment", @@ -1185,7 +1231,9 @@ }, "/payments/list": { "get": { - "tags": ["Payments"], + "tags": [ + "Payments" + ], "summary": "", "description": "\nTo list the payments", "operationId": "List all Payments", @@ -1291,7 +1339,9 @@ }, "/payments/session_tokens": { "post": { - "tags": ["Payments"], + "tags": [ + "Payments" + ], "summary": "", "description": "\nTo create the session object or to get session token for wallets", "operationId": "Create Session tokens for a Payment", @@ -1325,7 +1375,9 @@ }, "/payments/{payment_id}": { "get": { - "tags": ["Payments"], + "tags": [ + "Payments" + ], "summary": "", "description": "\nTo 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", "operationId": "Retrieve a Payment", @@ -1368,7 +1420,9 @@ "deprecated": false }, "post": { - "tags": ["Payments"], + "tags": [ + "Payments" + ], "summary": "", "description": "\nTo update the properties of a PaymentIntent object. This may include attaching a payment method, or attaching customer object or metadata fields after the Payment is created", "operationId": "Update a Payment", @@ -1413,7 +1467,9 @@ }, "/payments/{payment_id}/cancel": { "post": { - "tags": ["Payments"], + "tags": [ + "Payments" + ], "summary": "", "description": "\nA Payment could can be cancelled when it is in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_customer_action", "operationId": "Cancel a Payment", @@ -1451,7 +1507,9 @@ }, "/payments/{payment_id}/capture": { "post": { - "tags": ["Payments"], + "tags": [ + "Payments" + ], "summary": "", "description": "\nTo capture the funds for an uncaptured payment", "operationId": "Capture a Payment", @@ -1496,7 +1554,9 @@ }, "/payments/{payment_id}/confirm": { "post": { - "tags": ["Payments"], + "tags": [ + "Payments" + ], "summary": "", "description": "\nThis 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", "operationId": "Confirm a Payment", @@ -1541,7 +1601,9 @@ }, "/refunds": { "post": { - "tags": ["Refunds"], + "tags": [ + "Refunds" + ], "summary": "", "description": "\nTo create a refund against an already processed payment", "operationId": "Create a Refund", @@ -1575,7 +1637,9 @@ }, "/refunds/list": { "get": { - "tags": ["Refunds"], + "tags": [ + "Refunds" + ], "summary": "", "description": "\nTo list the refunds associated with a payment_id or with the merchant, if payment_id is not provided", "operationId": "List all Refunds", @@ -1670,7 +1734,9 @@ }, "/refunds/{refund_id}": { "get": { - "tags": ["Refunds"], + "tags": [ + "Refunds" + ], "summary": "", "description": "\nTo 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", "operationId": "Retrieve a Refund", @@ -1703,7 +1769,9 @@ "deprecated": false }, "post": { - "tags": ["Refunds"], + "tags": [ + "Refunds" + ], "summary": "", "description": "\nTo update the properties of a Refund object. This may include attaching a reason for the refund or metadata fields", "operationId": "Update a Refund", @@ -1751,7 +1819,10 @@ "schemas": { "AcceptanceType": { "type": "string", - "enum": ["online", "offline"] + "enum": [ + "online", + "offline" + ] }, "Address": { "type": "object", @@ -1825,11 +1896,37 @@ }, "AffirmIssuer": { "type": "string", - "enum": ["affirm"] + "enum": [ + "affirm" + ] }, "AfterpayClearpayIssuer": { "type": "string", - "enum": ["afterpay_clearpay"] + "enum": [ + "afterpay_clearpay" + ] + }, + "AmountInfo": { + "type": "object", + "required": [ + "label", + "type", + "amount" + ], + "properties": { + "label": { + "type": "string", + "description": "the label must be non-empty to pass validation." + }, + "type": { + "type": "string", + "description": "The type of label" + }, + "amount": { + "type": "string", + "description": "The total amount for the payment" + } + } }, "ApiKeyExpiration": { "oneOf": [ @@ -1845,13 +1942,138 @@ } ] }, + "ApplePayRequest": { + "type": "object", + "required": [ + "country_code", + "currency_code", + "total", + "merchant_capabilities", + "supported_networks" + ], + "properties": { + "country_code": { + "type": "string", + "description": "The code for country" + }, + "currency_code": { + "type": "string", + "description": "The code for currency" + }, + "total": { + "$ref": "#/components/schemas/AmountInfo" + }, + "merchant_capabilities": { + "type": "array", + "items": { + "type": "string", + "description": "The list of merchant capabilities(ex: whether capable of 3ds or no-3ds)" + } + }, + "supported_networks": { + "type": "array", + "items": { + "type": "string", + "description": "The list of supported networks" + } + } + } + }, + "ApplePaySessionObject": { + "type": "object", + "required": [ + "epoch_timestamp", + "expires_at", + "merchant_session_identifier", + "nonce", + "merchant_identifier", + "domain_name", + "display_name", + "signature", + "operational_analytics_identifier", + "retries", + "psp_id" + ], + "properties": { + "epoch_timestamp": { + "type": "integer", + "format": "int64", + "description": "Timestamp at which session is requested" + }, + "expires_at": { + "type": "integer", + "format": "int64", + "description": "Timestamp at which session expires" + }, + "merchant_session_identifier": { + "type": "string", + "description": "The identifier for the merchant session" + }, + "nonce": { + "type": "string", + "description": "Applepay generates unique ID (UUID) value" + }, + "merchant_identifier": { + "type": "string", + "description": "The identifier for the merchant" + }, + "domain_name": { + "type": "string", + "description": "The domain name of the merchant which is registered in Apple Pay" + }, + "display_name": { + "type": "string", + "description": "The name to be displayed on Apple Pay button" + }, + "signature": { + "type": "string", + "description": "A string which represents the properties of a payment" + }, + "operational_analytics_identifier": { + "type": "string", + "description": "The identifier for the operational analytics" + }, + "retries": { + "type": "integer", + "format": "int32", + "description": "The number of retries to get the session response" + }, + "psp_id": { + "type": "string", + "description": "The identifier for the connector transaction" + } + } + }, + "ApplepayData": { + "type": "object", + "required": [ + "session_object", + "payment_request_object" + ], + "properties": { + "session_object": { + "$ref": "#/components/schemas/ApplePaySessionObject" + }, + "payment_request_object": { + "$ref": "#/components/schemas/ApplePayRequest" + } + } + }, "AuthenticationType": { "type": "string", - "enum": ["three_ds", "no_three_ds"] + "enum": [ + "three_ds", + "no_three_ds" + ] }, "CaptureMethod": { "type": "string", - "enum": ["automatic", "manual", "manual_multiple", "scheduled"] + "enum": [ + "automatic", + "manual", + "manual_multiple", + "scheduled" + ] }, "Card": { "type": "object", @@ -2048,7 +2270,7 @@ "api_key": { "type": "string", "description": "The plaintext API Key used for server-side API access. Ensure you store the API Key\nsecurely as you will not be able to see it again.", - "maxLength": 64 + "maxLength": 128 }, "created": { "type": "string", @@ -2063,7 +2285,9 @@ }, "CreateMerchantAccount": { "type": "object", - "required": ["merchant_id"], + "required": [ + "merchant_id" + ], "properties": { "merchant_id": { "type": "string", @@ -2141,7 +2365,9 @@ }, "CreatePaymentMethod": { "type": "object", - "required": ["payment_method"], + "required": [ + "payment_method" + ], "properties": { "payment_method": { "$ref": "#/components/schemas/PaymentMethodType" @@ -2280,7 +2506,9 @@ }, "CustomerAcceptance": { "type": "object", - "required": ["acceptance_type"], + "required": [ + "acceptance_type" + ], "properties": { "acceptance_type": { "$ref": "#/components/schemas/AcceptanceType" @@ -2377,7 +2605,9 @@ "items": { "$ref": "#/components/schemas/PaymentExperience" }, - "example": ["redirect_to_url"] + "example": [ + "redirect_to_url" + ] }, "card": { "$ref": "#/components/schemas/CardDetailFromLocker" @@ -2443,7 +2673,10 @@ }, "CustomerResponse": { "type": "object", - "required": ["customer_id", "created_at"], + "required": [ + "customer_id", + "created_at" + ], "properties": { "customer_id": { "type": "string", @@ -2497,7 +2730,11 @@ }, "DeleteMcaResponse": { "type": "object", - "required": ["merchant_id", "merchant_connector_id", "deleted"], + "required": [ + "merchant_id", + "merchant_connector_id", + "deleted" + ], "properties": { "merchant_id": { "type": "string", @@ -2519,7 +2756,10 @@ }, "DeleteMerchantAccountResponse": { "type": "object", - "required": ["merchant_id", "deleted"], + "required": [ + "merchant_id", + "deleted" + ], "properties": { "merchant_id": { "type": "string", @@ -2536,7 +2776,10 @@ }, "DeletePaymentMethodResponse": { "type": "object", - "required": ["payment_method_id", "deleted"], + "required": [ + "payment_method_id", + "deleted" + ], "properties": { "payment_method_id": { "type": "string", @@ -2552,11 +2795,17 @@ }, "FutureUsage": { "type": "string", - "enum": ["off_session", "on_session"] + "enum": [ + "off_session", + "on_session" + ] }, "GpayAllowedMethodsParameters": { "type": "object", - "required": ["allowed_auth_methods", "allowed_card_networks"], + "required": [ + "allowed_auth_methods", + "allowed_card_networks" + ], "properties": { "allowed_auth_methods": { "type": "array", @@ -2576,7 +2825,11 @@ }, "GpayAllowedPaymentMethods": { "type": "object", - "required": ["type", "parameters", "tokenization_specification"], + "required": [ + "type", + "parameters", + "tokenization_specification" + ], "properties": { "type": { "type": "string", @@ -2590,9 +2843,33 @@ } } }, + "GpayData": { + "type": "object", + "required": [ + "merchant_info", + "allowed_payment_methods", + "transaction_info" + ], + "properties": { + "merchant_info": { + "$ref": "#/components/schemas/GpayMerchantInfo" + }, + "allowed_payment_methods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GpayAllowedPaymentMethods" + } + }, + "transaction_info": { + "$ref": "#/components/schemas/GpayTransactionInfo" + } + } + }, "GpayMerchantInfo": { "type": "object", - "required": ["merchant_name"], + "required": [ + "merchant_name" + ], "properties": { "merchant_name": { "type": "string", @@ -2602,7 +2879,10 @@ }, "GpayTokenParameters": { "type": "object", - "required": ["gateway", "gateway_merchant_id"], + "required": [ + "gateway", + "gateway_merchant_id" + ], "properties": { "gateway": { "type": "string", @@ -2616,7 +2896,10 @@ }, "GpayTokenizationSpecification": { "type": "object", - "required": ["type", "parameters"], + "required": [ + "type", + "parameters" + ], "properties": { "type": { "type": "string", @@ -2668,13 +2951,35 @@ "requires_capture" ] }, + "KlarnaData": { + "type": "object", + "required": [ + "session_token", + "session_id" + ], + "properties": { + "session_token": { + "type": "string", + "description": "The session token for Klarna" + }, + "session_id": { + "type": "string", + "description": "The identifier for the session" + } + } + }, "KlarnaIssuer": { "type": "string", - "enum": ["klarna"] + "enum": [ + "klarna" + ] }, "ListCustomerPaymentMethodsResponse": { "type": "object", - "required": ["enabled_payment_methods", "customer_payment_methods"], + "required": [ + "enabled_payment_methods", + "customer_payment_methods" + ], "properties": { "enabled_payment_methods": { "type": "array", @@ -2683,9 +2988,12 @@ }, "example": [ { - "payment_method": "wallet", "payment_experience": null, - "payment_method_issuers": ["labore magna ipsum", "aute"] + "payment_method": "wallet", + "payment_method_issuers": [ + "labore magna ipsum", + "aute" + ] } ] }, @@ -2713,7 +3021,9 @@ "items": { "$ref": "#/components/schemas/PaymentMethodSubType" }, - "example": ["credit_card"] + "example": [ + "credit_card" + ] }, "payment_method_issuers": { "type": "array", @@ -2721,14 +3031,18 @@ "type": "string", "description": "The name of the bank/ provider issuing the payment method to the end user" }, - "example": ["Citibank"] + "example": [ + "Citibank" + ] }, "payment_method_issuer_code": { "type": "array", "items": { "$ref": "#/components/schemas/PaymentMethodIssuerCode" }, - "example": ["jp_applepay"] + "example": [ + "jp_applepay" + ] }, "payment_schemes": { "type": "array", @@ -2736,7 +3050,11 @@ "type": "string", "description": "List of payment schemes accepted or has the processing capabilities of the processor" }, - "example": ["MASTER", "VISA", "DINERS"] + "example": [ + "MASTER", + "VISA", + "DINERS" + ] }, "accepted_countries": { "type": "array", @@ -2744,14 +3062,21 @@ "type": "string", "description": "List of Countries accepted or has the processing capabilities of the processor" }, - "example": ["US", "UK", "IN"] + "example": [ + "US", + "UK", + "IN" + ] }, "accepted_currencies": { "type": "array", "items": { "$ref": "#/components/schemas/Currency" }, - "example": ["USD", "EUR"] + "example": [ + "USD", + "EUR" + ] }, "minimum_amount": { "type": "integer", @@ -2780,13 +3105,17 @@ "items": { "$ref": "#/components/schemas/PaymentExperience" }, - "example": ["redirect_to_url"] + "example": [ + "redirect_to_url" + ] } } }, "ListPaymentMethodResponse": { "type": "object", - "required": ["payment_methods"], + "required": [ + "payment_methods" + ], "properties": { "redirect_url": { "type": "string", @@ -2800,9 +3129,12 @@ }, "example": [ { - "payment_method": "wallet", "payment_experience": null, - "payment_method_issuers": ["labore magna ipsum", "aute"] + "payment_method": "wallet", + "payment_method_issuers": [ + "labore magna ipsum", + "aute" + ] } ] } @@ -2810,7 +3142,10 @@ }, "MandateAmountData": { "type": "object", - "required": ["amount", "currency"], + "required": [ + "amount", + "currency" + ], "properties": { "amount": { "type": "integer", @@ -2862,7 +3197,10 @@ }, "MandateData": { "type": "object", - "required": ["customer_acceptance", "mandate_type"], + "required": [ + "customer_acceptance", + "mandate_type" + ], "properties": { "customer_acceptance": { "$ref": "#/components/schemas/CustomerAcceptance" @@ -2906,7 +3244,10 @@ }, "MandateRevokedResponse": { "type": "object", - "required": ["mandate_id", "status"], + "required": [ + "mandate_id", + "status" + ], "properties": { "mandate_id": { "type": "string", @@ -2920,13 +3261,20 @@ "MandateStatus": { "type": "string", "description": "The status of the mandate, which indicates whether it can be used to initiate a payment", - "enum": ["active", "inactive", "pending", "revoked"] + "enum": [ + "active", + "inactive", + "pending", + "revoked" + ] }, "MandateType": { "oneOf": [ { "type": "object", - "required": ["single_use"], + "required": [ + "single_use" + ], "properties": { "single_use": { "$ref": "#/components/schemas/MandateAmountData" @@ -2935,7 +3283,9 @@ }, { "type": "object", - "required": ["multi_use"], + "required": [ + "multi_use" + ], "properties": { "multi_use": { "$ref": "#/components/schemas/MandateAmountData" @@ -3030,7 +3380,10 @@ }, "MerchantConnectorId": { "type": "object", - "required": ["merchant_id", "merchant_connector_id"], + "required": [ + "merchant_id", + "merchant_connector_id" + ], "properties": { "merchant_id": { "type": "string" @@ -3113,7 +3466,9 @@ }, "NextAction": { "type": "object", - "required": ["type"], + "required": [ + "type" + ], "properties": { "type": { "$ref": "#/components/schemas/NextActionType" @@ -3136,7 +3491,10 @@ }, "OnlineMandate": { "type": "object", - "required": ["ip_address", "user_agent"], + "required": [ + "ip_address", + "user_agent" + ], "properties": { "ip_address": { "type": "string", @@ -3151,7 +3509,10 @@ }, "OrderDetails": { "type": "object", - "required": ["product_name", "quantity"], + "required": [ + "product_name", + "quantity" + ], "properties": { "product_name": { "type": "string", @@ -3171,12 +3532,17 @@ "oneOf": [ { "type": "object", - "required": ["klarna_redirect"], + "required": [ + "klarna_redirect" + ], "properties": { "klarna_redirect": { "type": "object", "description": "For KlarnaRedirect as PayLater Option", - "required": ["billing_email", "billing_country"], + "required": [ + "billing_email", + "billing_country" + ], "properties": { "billing_email": { "type": "string", @@ -3191,12 +3557,16 @@ }, { "type": "object", - "required": ["klarna_sdk"], + "required": [ + "klarna_sdk" + ], "properties": { "klarna_sdk": { "type": "object", "description": "For Klarna Sdk as PayLater Option", - "required": ["token"], + "required": [ + "token" + ], "properties": { "token": { "type": "string", @@ -3208,7 +3578,9 @@ }, { "type": "object", - "required": ["affirm_redirect"], + "required": [ + "affirm_redirect" + ], "properties": { "affirm_redirect": { "type": "object", @@ -3218,12 +3590,17 @@ }, { "type": "object", - "required": ["afterpay_clearpay_redirect"], + "required": [ + "afterpay_clearpay_redirect" + ], "properties": { "afterpay_clearpay_redirect": { "type": "object", "description": "For AfterpayClearpay redirect as PayLater Option", - "required": ["billing_email", "billing_name"], + "required": [ + "billing_email", + "billing_name" + ], "properties": { "billing_email": { "type": "string", @@ -3242,7 +3619,10 @@ "PaymentConnectorCreate": { "type": "object", "description": "Create a new Payment Connector for the merchant account. The connector could be a payment processor / facilitator / acquirer or specialized services like Fraud / Accounting etc.\"", - "required": ["connector_type", "connector_name"], + "required": [ + "connector_type", + "connector_name" + ], "properties": { "connector_type": { "$ref": "#/components/schemas/ConnectorType" @@ -3279,16 +3659,31 @@ }, "example": [ { - "payment_method": "wallet", - "payment_method_types": ["upi_collect", "upi_intent"], - "payment_method_issuers": ["labore magna ipsum", "aute"], - "payment_schemes": ["Discover", "Discover"], - "accepted_currencies": ["AED", "AED"], - "accepted_countries": ["in", "us"], - "minimum_amount": 1, + "accepted_countries": [ + "in", + "us" + ], + "accepted_currencies": [ + "AED", + "AED" + ], + "installment_payment_enabled": true, "maximum_amount": 68607706, - "recurring_enabled": true, - "installment_payment_enabled": true + "minimum_amount": 1, + "payment_method": "wallet", + "payment_method_issuers": [ + "labore magna ipsum", + "aute" + ], + "payment_method_types": [ + "upi_collect", + "upi_intent" + ], + "payment_schemes": [ + "Discover", + "Discover" + ], + "recurring_enabled": true } ] }, @@ -3312,7 +3707,9 @@ "oneOf": [ { "type": "object", - "required": ["PaymentIntentId"], + "required": [ + "PaymentIntentId" + ], "properties": { "PaymentIntentId": { "type": "string", @@ -3322,7 +3719,9 @@ }, { "type": "object", - "required": ["ConnectorTransactionId"], + "required": [ + "ConnectorTransactionId" + ], "properties": { "ConnectorTransactionId": { "type": "string", @@ -3332,7 +3731,9 @@ }, { "type": "object", - "required": ["PaymentAttemptId"], + "required": [ + "PaymentAttemptId" + ], "properties": { "PaymentAttemptId": { "type": "string", @@ -3410,7 +3811,10 @@ }, "PaymentListResponse": { "type": "object", - "required": ["size", "data"], + "required": [ + "size", + "data" + ], "properties": { "size": { "type": "integer", @@ -3428,7 +3832,9 @@ "oneOf": [ { "type": "object", - "required": ["card"], + "required": [ + "card" + ], "properties": { "card": { "$ref": "#/components/schemas/Card" @@ -3437,11 +3843,15 @@ }, { "type": "string", - "enum": ["bank_transfer"] + "enum": [ + "bank_transfer" + ] }, { "type": "object", - "required": ["wallet"], + "required": [ + "wallet" + ], "properties": { "wallet": { "$ref": "#/components/schemas/WalletData" @@ -3450,7 +3860,9 @@ }, { "type": "object", - "required": ["pay_later"], + "required": [ + "pay_later" + ], "properties": { "pay_later": { "$ref": "#/components/schemas/PayLaterData" @@ -3459,7 +3871,9 @@ }, { "type": "string", - "enum": ["paypal"] + "enum": [ + "paypal" + ] } ] }, @@ -3535,7 +3949,9 @@ "items": { "$ref": "#/components/schemas/PaymentExperience" }, - "example": ["redirect_to_url"] + "example": [ + "redirect_to_url" + ] }, "metadata": { "type": "object" @@ -3593,7 +4009,9 @@ "items": { "$ref": "#/components/schemas/PaymentMethodSubType" }, - "example": ["credit"] + "example": [ + "credit" + ] }, "payment_method_issuers": { "type": "array", @@ -3601,7 +4019,9 @@ "type": "string", "description": "List of payment method issuers to be enabled for this payment method" }, - "example": ["HDFC"] + "example": [ + "HDFC" + ] }, "payment_schemes": { "type": "array", @@ -3609,14 +4029,22 @@ "type": "string", "description": "List of payment schemes accepted or has the processing capabilities of the processor" }, - "example": ["MASTER", "VISA", "DINERS"] + "example": [ + "MASTER", + "VISA", + "DINERS" + ] }, "accepted_currencies": { "type": "array", "items": { "$ref": "#/components/schemas/Currency" }, - "example": ["USD", "EUR", "AED"] + "example": [ + "USD", + "EUR", + "AED" + ] }, "accepted_countries": { "type": "array", @@ -3624,7 +4052,10 @@ "type": "string", "description": "List of Countries accepted or has the processing capabilities of the processor" }, - "example": ["US", "IN"] + "example": [ + "US", + "IN" + ] }, "minimum_amount": { "type": "integer", @@ -3655,7 +4086,9 @@ "items": { "$ref": "#/components/schemas/PaymentExperience" }, - "example": ["redirect_to_url"] + "example": [ + "redirect_to_url" + ] } } }, @@ -3874,7 +4307,12 @@ }, "PaymentsResponse": { "type": "object", - "required": ["status", "amount", "currency", "payment_method"], + "required": [ + "status", + "amount", + "currency", + "payment_method" + ], "properties": { "payment_id": { "type": "string", @@ -4053,7 +4491,10 @@ }, "PaymentsRetrieveRequest": { "type": "object", - "required": ["resource_id", "force_sync"], + "required": [ + "resource_id", + "force_sync" + ], "properties": { "resource_id": { "$ref": "#/components/schemas/PaymentIdType" @@ -4078,7 +4519,11 @@ }, "PaymentsSessionRequest": { "type": "object", - "required": ["payment_id", "client_secret", "wallets"], + "required": [ + "payment_id", + "client_secret", + "wallets" + ], "properties": { "payment_id": { "type": "string", @@ -4098,7 +4543,11 @@ }, "PaymentsSessionResponse": { "type": "object", - "required": ["payment_id", "client_secret", "session_token"], + "required": [ + "payment_id", + "client_secret", + "session_token" + ], "properties": { "payment_id": { "type": "string", @@ -4118,7 +4567,11 @@ }, "PaymentsStartRequest": { "type": "object", - "required": ["payment_id", "merchant_id", "attempt_id"], + "required": [ + "payment_id", + "merchant_id", + "attempt_id" + ], "properties": { "payment_id": { "type": "string", @@ -4134,6 +4587,18 @@ } } }, + "PaypalData": { + "type": "object", + "required": [ + "session_token" + ], + "properties": { + "session_token": { + "type": "string", + "description": "The session token for PayPal" + } + } + }, "PhoneDetails": { "type": "object", "properties": { @@ -4190,7 +4655,9 @@ }, "RefundListResponse": { "type": "object", - "required": ["data"], + "required": [ + "data" + ], "properties": { "data": { "type": "array", @@ -4202,7 +4669,9 @@ }, "RefundRequest": { "type": "object", - "required": ["payment_id"], + "required": [ + "payment_id" + ], "properties": { "refund_id": { "type": "string", @@ -4247,7 +4716,13 @@ }, "RefundResponse": { "type": "object", - "required": ["refund_id", "payment_id", "amount", "currency", "status"], + "required": [ + "refund_id", + "payment_id", + "amount", + "currency", + "status" + ], "properties": { "refund_id": { "type": "string", @@ -4299,11 +4774,19 @@ "RefundStatus": { "type": "string", "description": "The status for refunds", - "enum": ["succeeded", "failed", "pending", "review"] + "enum": [ + "succeeded", + "failed", + "pending", + "review" + ] }, "RefundType": { "type": "string", - "enum": ["scheduled", "instant"] + "enum": [ + "scheduled", + "instant" + ] }, "RefundUpdateRequest": { "type": "object", @@ -4358,7 +4841,7 @@ "prefix": { "type": "string", "description": "The first few characters of the plaintext API Key to help you identify it.", - "maxLength": 16 + "maxLength": 64 }, "created": { "type": "string", @@ -4395,143 +4878,99 @@ "RoutingAlgorithm": { "type": "string", "description": "The routing algorithm to be used to process the incoming request from merchant to outgoing payment processor or payment method. The default is 'Custom'", - "enum": ["round_robin", "max_conversion", "min_cost", "custom"], + "enum": [ + "round_robin", + "max_conversion", + "min_cost", + "custom" + ], "example": "custom" }, "SessionToken": { "oneOf": [ { - "type": "object", - "description": "The session response structure for Google Pay", - "required": [ - "merchant_info", - "allowed_payment_methods", - "transaction_info", - "wallet_name" - ], - "properties": { - "merchant_info": { - "$ref": "#/components/schemas/GpayMerchantInfo" + "allOf": [ + { + "$ref": "#/components/schemas/GpayData" }, - "allowed_payment_methods": { - "type": "array", - "items": { - "$ref": "#/components/schemas/GpayAllowedPaymentMethods" + { + "type": "object", + "required": [ + "wallet_name" + ], + "properties": { + "wallet_name": { + "type": "string", + "enum": [ + "gpay" + ] + } } - }, - "transaction_info": { - "$ref": "#/components/schemas/GpayTransactionInfo" - }, - "wallet_name": { - "type": "string", - "enum": ["gpay"] } - } + ] }, { - "type": "object", - "description": "The session response structure for Klarna", - "required": ["session_token", "session_id", "wallet_name"], - "properties": { - "session_token": { - "type": "string", - "description": "The session token for Klarna" - }, - "session_id": { - "type": "string", - "description": "The identifier for the session" + "allOf": [ + { + "$ref": "#/components/schemas/KlarnaData" }, - "wallet_name": { - "type": "string", - "enum": ["klarna"] + { + "type": "object", + "required": [ + "wallet_name" + ], + "properties": { + "wallet_name": { + "type": "string", + "enum": [ + "klarna" + ] + } + } } - } + ] }, { - "type": "object", - "description": "The session response structure for PayPal", - "required": ["session_token", "wallet_name"], - "properties": { - "session_token": { - "type": "string", - "description": "The session token for PayPal" + "allOf": [ + { + "$ref": "#/components/schemas/PaypalData" }, - "wallet_name": { - "type": "string", - "enum": ["paypal"] + { + "type": "object", + "required": [ + "wallet_name" + ], + "properties": { + "wallet_name": { + "type": "string", + "enum": [ + "paypal" + ] + } + } } - } + ] }, { - "type": "object", - "description": "The session response structure for Apple Pay", - "required": [ - "epoch_timestamp", - "expires_at", - "merchant_session_identifier", - "nonce", - "merchant_identifier", - "domain_name", - "display_name", - "signature", - "operational_analytics_identifier", - "retries", - "psp_id", - "wallet_name" - ], - "properties": { - "epoch_timestamp": { - "type": "integer", - "format": "int64", - "description": "Timestamp at which session is requested" - }, - "expires_at": { - "type": "integer", - "format": "int64", - "description": "Timestamp at which session expires" - }, - "merchant_session_identifier": { - "type": "string", - "description": "The identifier for the merchant session" - }, - "nonce": { - "type": "string", - "description": "Applepay generates unique ID (UUID) value" - }, - "merchant_identifier": { - "type": "string", - "description": "The identifier for the merchant" - }, - "domain_name": { - "type": "string", - "description": "The domain name of the merchant which is registered in Apple Pay" - }, - "display_name": { - "type": "string", - "description": "The name to be displayed on Apple Pay button" - }, - "signature": { - "type": "string", - "description": "A string which represents the properties of a payment" - }, - "operational_analytics_identifier": { - "type": "string", - "description": "The identifier for the operational analytics" - }, - "retries": { - "type": "integer", - "format": "int32", - "description": "The number of retries to get the session response" - }, - "psp_id": { - "type": "string", - "description": "The identifier for the connector transaction" + "allOf": [ + { + "$ref": "#/components/schemas/ApplepayData" }, - "wallet_name": { - "type": "string", - "enum": ["applepay"] + { + "type": "object", + "required": [ + "wallet_name" + ], + "properties": { + "wallet_name": { + "type": "string", + "enum": [ + "applepay" + ] + } + } } - } + ] } ], "discriminator": { @@ -4541,7 +4980,12 @@ "SupportedWallets": { "type": "string", "description": "Wallets which support obtaining session object", - "enum": ["paypal", "apple_pay", "klarna", "gpay"] + "enum": [ + "paypal", + "apple_pay", + "klarna", + "gpay" + ] }, "UpdateApiKeyRequest": { "type": "object", @@ -4577,7 +5021,9 @@ }, "WalletData": { "type": "object", - "required": ["issuer_name"], + "required": [ + "issuer_name" + ], "properties": { "issuer_name": { "$ref": "#/components/schemas/WalletIssuer" @@ -4590,7 +5036,11 @@ }, "WalletIssuer": { "type": "string", - "enum": ["googlepay", "applepay", "paypal"] + "enum": [ + "googlepay", + "applepay", + "paypal" + ] }, "WebhookDetails": { "type": "object", @@ -4671,4 +5121,4 @@ "description": "Create and manage API Keys" } ] -} +} \ No newline at end of file
feat
applepay payment request object (#519)
1c3c5f6b0cff9a0037175ba92c002cdf4249108d
2024-01-09 20:44:19
AkshayaFoiger
feat(pm_list): add required fields for Ideal (#3183)
false
diff --git a/Cargo.lock b/Cargo.lock index 3fa4c12c34e..7ce0851ba15 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -80,7 +80,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" dependencies = [ "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -118,7 +118,7 @@ dependencies = [ "parse-size", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -255,7 +255,7 @@ dependencies = [ "actix-router", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -564,18 +564,18 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] name = "async-trait" -version = "0.1.74" +version = "0.1.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -1292,7 +1292,7 @@ dependencies = [ "proc-macro-crate 2.0.0", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", "syn_derive", ] @@ -1614,7 +1614,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -2011,7 +2011,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -2022,7 +2022,7 @@ checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -2159,7 +2159,7 @@ dependencies = [ "diesel_table_macro_syntax", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -2189,7 +2189,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5" dependencies = [ - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -2246,7 +2246,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -2596,7 +2596,7 @@ checksum = "b0fa992f1656e1707946bbba340ad244f0814009ef8c0118eb7b658395f19a2e" dependencies = [ "frunk_proc_macro_helpers", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -2608,7 +2608,7 @@ dependencies = [ "frunk_core", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -2620,7 +2620,7 @@ dependencies = [ "frunk_core", "frunk_proc_macro_helpers", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -2733,7 +2733,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -3995,7 +3995,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -4281,7 +4281,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -4371,7 +4371,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -4513,9 +4513,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.70" +version = "1.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" +checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" dependencies = [ "unicode-ident", ] @@ -4648,9 +4648,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -5164,7 +5164,7 @@ dependencies = [ "serde", "serde_json", "strum 0.24.1", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -5224,7 +5224,7 @@ dependencies = [ "quote", "rust-embed-utils", "shellexpand", - "syn 2.0.39", + "syn 2.0.48", "walkdir", ] @@ -5570,7 +5570,7 @@ checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -5634,7 +5634,7 @@ checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -5684,7 +5684,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -5709,7 +5709,7 @@ checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -6100,7 +6100,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -6122,9 +6122,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.39" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -6140,7 +6140,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -6248,7 +6248,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -6260,7 +6260,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", "test-case-core", ] @@ -6339,7 +6339,7 @@ checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -6529,7 +6529,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -7115,7 +7115,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -7264,7 +7264,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", "wasm-bindgen-shared", ] @@ -7298,7 +7298,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -7600,7 +7600,7 @@ checksum = "b3c129550b3e6de3fd0ba67ba5c81818f9805e58b8d7fee80a3a59d2c9fc601a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] diff --git a/config/config.example.toml b/config/config.example.toml index 21a3ba6de93..9749a01a8ae 100644 --- a/config/config.example.toml +++ b/config/config.example.toml @@ -386,6 +386,8 @@ pay_later.klarna = { connector_list = "adyen" } # Mandate supported payment bank_debit.ach = { connector_list = "gocardless" } # Mandate supported payment method type and connector for bank_debit bank_debit.becs = { connector_list = "gocardless" } # Mandate supported payment method type and connector for bank_debit bank_debit.sepa = { connector_list = "gocardless" } # Mandate supported payment method type and connector for bank_debit +bank_redirect.ideal = {connector_list = "stripe,adyen"} # Mandate supported payment method type and connector for bank_redirect + # Required fields info used while listing the payment_method_data [required_fields.pay_later] # payment_method = "pay_later" diff --git a/config/development.toml b/config/development.toml index 80d594b248b..65ec470d19d 100644 --- a/config/development.toml +++ b/config/development.toml @@ -476,6 +476,7 @@ card.debit = { connector_list = "stripe,adyen,authorizedotnet,cybersource,global bank_debit.ach = { connector_list = "gocardless"} bank_debit.becs = { connector_list = "gocardless"} bank_debit.sepa = { connector_list = "gocardless"} +bank_redirect.ideal = {connector_list = "stripe,adyen"} [connector_request_reference_id_config] merchant_ids_send_payment_id_as_connector_request_id = [] diff --git a/config/docker_compose.toml b/config/docker_compose.toml index 1d3c845aa54..59aaba2e509 100644 --- a/config/docker_compose.toml +++ b/config/docker_compose.toml @@ -343,6 +343,7 @@ card.debit = {connector_list = "stripe,adyen,authorizedotnet,cybersource,globalp bank_debit.ach = { connector_list = "gocardless"} bank_debit.becs = { connector_list = "gocardless"} bank_debit.sepa = { connector_list = "gocardless"} +bank_redirect.ideal = {connector_list = "stripe,adyen"} [connector_customer] connector_list = "gocardless,stax,stripe" diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rs index 523a2ac93c8..76d62605a43 100644 --- a/crates/api_models/src/payments.rs +++ b/crates/api_models/src/payments.rs @@ -1213,7 +1213,7 @@ pub enum BankRedirectData { }, Ideal { /// The billing details for bank redirection - billing_details: BankRedirectBilling, + billing_details: Option<BankRedirectBilling>, /// The hyperswitch bank code for ideal #[schema(value_type = BankNames, example = "abn_amro")] diff --git a/crates/router/src/configs/defaults.rs b/crates/router/src/configs/defaults.rs index 6c880a4a214..42839bf3513 100644 --- a/crates/router/src/configs/defaults.rs +++ b/crates/router/src/configs/defaults.rs @@ -4418,7 +4418,7 @@ impl Default for super::settings::RequiredFields { RequiredFieldFinal { mandate: HashMap::new(), non_mandate: HashMap::new(), - common:HashMap::from([ + common: HashMap::from([ ( "payment_method_data.bank_redirect.bancontact_card.card_number".to_string(), RequiredFieldInfo { @@ -4481,10 +4481,262 @@ impl Default for super::settings::RequiredFields { ConnectorFields { fields: HashMap::from([ ( - enums::Connector::Stripe, + enums::Connector::Aci, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from([ + ( + "payment_method_data.bank_redirect.ideal.bank_name".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.bank_redirect.ideal.bank_name".to_string(), + display_name: "bank_name".to_string(), + field_type: enums::FieldType::UserBank, + value: None, + } + ), + ( + "payment_method_data.bank_redirect.ideal.country".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.bank_redirect.ideal.country".to_string(), + display_name: "country".to_string(), + field_type: enums::FieldType::UserCountry { + options: vec![ + "NL".to_string(), + ] + }, + value: None, + } + ) + ]), + common: HashMap::new(), + } + ), + ( + enums::Connector::Adyen, RequiredFieldFinal { mandate: HashMap::new(), non_mandate: HashMap::new(), + common: HashMap::from([ + ( + "payment_method_data.bank_redirect.ideal.bank_name".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.bank_redirect.ideal.bank_name".to_string(), + display_name: "bank_name".to_string(), + field_type: enums::FieldType::UserBank, + value: None, + } + ) + ]), + } + ), + ( + enums::Connector::Globalpay, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Mollie, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Nexinets, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Nuvei, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from([ + ( + "email".to_string(), + RequiredFieldInfo { + required_field: "email".to_string(), + display_name: "email".to_string(), + field_type: enums::FieldType::UserEmailAddress, + value: None, + } + ), + ( + "billing.address.first_name".to_string(), + RequiredFieldInfo { + required_field: "billing.address.first_name".to_string(), + display_name: "billing_first_name".to_string(), + field_type: enums::FieldType::UserBillingName, + value: None, + } + ), + ( + "billing.address.last_name".to_string(), + RequiredFieldInfo { + required_field: "billing.address.last_name".to_string(), + display_name: "billing_last_name".to_string(), + field_type: enums::FieldType::UserBillingName, + value: None, + } + ), + ( + "billing.address.country".to_string(), + RequiredFieldInfo { + required_field: "billing.address.country".to_string(), + display_name: "country".to_string(), + field_type: enums::FieldType::UserAddressCountry{ + options: vec![ + "NL".to_string(), + ] + }, + value: None, + } + ) + ]), + common: HashMap::new(), + } + ), + ( + enums::Connector::Shift4, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from([ + ( + "payment_method_data.bank_redirect.ideal.country".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.bank_redirect.ideal.country".to_string(), + display_name: "country".to_string(), + field_type: enums::FieldType::UserCountry{ + options: vec![ + "NL".to_string(), + ] + }, + value: None, + } + ) + ]), + common: HashMap::new(), + } + ), + ( + enums::Connector::Paypal, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from([ + ( + "payment_method_data.bank_redirect.ideal.billing_details.billing_name".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.bank_redirect.ideal.billing_details.billing_name".to_string(), + display_name: "billing_name".to_string(), + field_type: enums::FieldType::UserFullName, + value: None, + } + ), + ( + "payment_method_data.bank_redirect.ideal.country".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.bank_redirect.ideal.country".to_string(), + display_name: "country".to_string(), + field_type: enums::FieldType::UserCountry{ + options: vec![ + "NL".to_string(), + ] + }, + value: None, + } + ) + ]), + common: HashMap::new(), + } + ), + ( + enums::Connector::Stripe, + RequiredFieldFinal { + mandate: HashMap::from([ + ( + "payment_method_data.bank_redirect.ideal.billing_details.billing_name".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.bank_redirect.ideal.billing_details.billing_name".to_string(), + display_name: "billing_name".to_string(), + field_type: enums::FieldType::UserFullName, + value: None, + } + ), + ( + "payment_method_data.bank_redirect.ideal.billing_details.email".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.bank_redirect.ideal.billing_details.email".to_string(), + display_name: "billing_email".to_string(), + field_type: enums::FieldType::UserEmailAddress, + value: None, + } + ) + ]), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Trustpay, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from([ + ( + "billing.address.first_name".to_string(), + RequiredFieldInfo { + required_field: "billing.address.first_name".to_string(), + display_name: "billing_first_name".to_string(), + field_type: enums::FieldType::UserBillingName, + value: None, + } + ), + ( + "billing.address.line1".to_string(), + RequiredFieldInfo { + required_field: "billing.address.line1".to_string(), + display_name: "line1".to_string(), + field_type: enums::FieldType::UserAddressLine1, + value: None, + } + ), + ( + "billing.address.city".to_string(), + RequiredFieldInfo { + required_field: "billing.address.city".to_string(), + display_name: "city".to_string(), + field_type: enums::FieldType::UserAddressCity, + value: None, + } + ), + ( + "billing.address.zip".to_string(), + RequiredFieldInfo { + required_field: "billing.address.zip".to_string(), + display_name: "zip".to_string(), + field_type: enums::FieldType::UserAddressPincode, + value: None, + } + ), + ( + "billing.address.country".to_string(), + RequiredFieldInfo { + required_field: "billing.address.country".to_string(), + display_name: "country".to_string(), + field_type: enums::FieldType::UserAddressCountry{ + options: vec![ + "NL".to_string(), + ] + }, + value: None, + } + ), + ]), common: HashMap::new(), } ), diff --git a/crates/router/src/connector/aci/transformers.rs b/crates/router/src/connector/aci/transformers.rs index 622383ee156..f34909f5489 100644 --- a/crates/router/src/connector/aci/transformers.rs +++ b/crates/router/src/connector/aci/transformers.rs @@ -178,19 +178,27 @@ impl merchant_transaction_id: None, customer_email: None, })), - api_models::payments::BankRedirectData::Ideal { bank_name, .. } => { - Self::BankRedirect(Box::new(BankRedirectionPMData { - payment_brand: PaymentBrand::Ideal, - bank_account_country: Some(api_models::enums::CountryAlpha2::NL), - bank_account_bank_name: bank_name.to_owned(), - bank_account_bic: None, - bank_account_iban: None, - billing_country: None, - merchant_customer_id: None, - merchant_transaction_id: None, - customer_email: None, - })) - } + api_models::payments::BankRedirectData::Ideal { + bank_name, country, .. + } => Self::BankRedirect(Box::new(BankRedirectionPMData { + payment_brand: PaymentBrand::Ideal, + bank_account_country: Some(country.ok_or( + errors::ConnectorError::MissingRequiredField { + field_name: "ideal.country", + }, + )?), + bank_account_bank_name: Some(bank_name.ok_or( + errors::ConnectorError::MissingRequiredField { + field_name: "ideal.bank_name", + }, + )?), + bank_account_bic: None, + bank_account_iban: None, + billing_country: None, + merchant_customer_id: None, + merchant_transaction_id: None, + customer_email: None, + })), api_models::payments::BankRedirectData::Sofort { country, .. } => { Self::BankRedirect(Box::new(BankRedirectionPMData { payment_brand: PaymentBrand::Sofortueberweisung, diff --git a/crates/router/src/connector/adyen/transformers.rs b/crates/router/src/connector/adyen/transformers.rs index bf24d3b7fd2..e00b829f283 100644 --- a/crates/router/src/connector/adyen/transformers.rs +++ b/crates/router/src/connector/adyen/transformers.rs @@ -2182,10 +2182,14 @@ impl<'a> TryFrom<&api_models::payments::BankRedirectData> for AdyenPaymentMethod api_models::payments::BankRedirectData::Ideal { bank_name, .. } => Ok( AdyenPaymentMethod::Ideal(Box::new(BankRedirectionWithIssuer { payment_type: PaymentType::Ideal, - issuer: bank_name - .map(|bank_name| AdyenTestBankNames::try_from(&bank_name)) - .transpose()? - .map(|adyen_bank_name| adyen_bank_name.0), + issuer: Some( + AdyenTestBankNames::try_from(&bank_name.ok_or( + errors::ConnectorError::MissingRequiredField { + field_name: "ideal.bank_name", + }, + )?)? + .0, + ), })), ), api_models::payments::BankRedirectData::OnlineBankingCzechRepublic { issuer } => { diff --git a/crates/router/src/connector/paypal/transformers.rs b/crates/router/src/connector/paypal/transformers.rs index fa6ac81c407..d384bc4cfd5 100644 --- a/crates/router/src/connector/paypal/transformers.rs +++ b/crates/router/src/connector/paypal/transformers.rs @@ -335,7 +335,12 @@ fn get_payment_source( bank_name: _, country, } => Ok(PaymentSourceItem::IDeal(RedirectRequest { - name: billing_details.get_billing_name()?, + name: billing_details + .clone() + .ok_or(errors::ConnectorError::MissingRequiredField { + field_name: "ideal.billing_details", + })? + .get_billing_name()?, country_code: country.ok_or(errors::ConnectorError::MissingRequiredField { field_name: "ideal.country", })?, diff --git a/crates/router/src/connector/stripe/transformers.rs b/crates/router/src/connector/stripe/transformers.rs index ea1b43e22a0..8875fdecfd0 100644 --- a/crates/router/src/connector/stripe/transformers.rs +++ b/crates/router/src/connector/stripe/transformers.rs @@ -1082,10 +1082,15 @@ impl From<&payments::BankDebitBilling> for StripeBillingAddress { } } -impl TryFrom<&payments::BankRedirectData> for StripeBillingAddress { +impl TryFrom<(&payments::BankRedirectData, Option<bool>)> for StripeBillingAddress { type Error = error_stack::Report<errors::ConnectorError>; - fn try_from(bank_redirection_data: &payments::BankRedirectData) -> Result<Self, Self::Error> { + fn try_from( + (bank_redirection_data, is_customer_initiated_mandate_payment): ( + &payments::BankRedirectData, + Option<bool>, + ), + ) -> Result<Self, Self::Error> { match bank_redirection_data { payments::BankRedirectData::Eps { billing_details, .. @@ -1110,11 +1115,36 @@ impl TryFrom<&payments::BankRedirectData> for StripeBillingAddress { }), payments::BankRedirectData::Ideal { billing_details, .. - } => Ok(Self { - name: billing_details.billing_name.clone(), - email: billing_details.email.clone(), - ..Self::default() - }), + } => { + let billing_name = billing_details + .clone() + .and_then(|billing_data| billing_data.billing_name.clone()); + + let billing_email = billing_details + .clone() + .and_then(|billing_data| billing_data.email.clone()); + match is_customer_initiated_mandate_payment { + Some(true) => Ok(Self { + name: Some(billing_name.ok_or( + errors::ConnectorError::MissingRequiredField { + field_name: "billing_name", + }, + )?), + + email: Some(billing_email.ok_or( + errors::ConnectorError::MissingRequiredField { + field_name: "billing_email", + }, + )?), + ..Self::default() + }), + Some(false) | None => Ok(Self { + name: billing_name, + email: billing_email, + ..Self::default() + }), + } + } payments::BankRedirectData::Przelewy24 { billing_details, .. } => Ok(Self { @@ -1239,6 +1269,7 @@ fn create_stripe_payment_method( payment_method_data: &api_models::payments::PaymentMethodData, auth_type: enums::AuthenticationType, payment_method_token: Option<types::PaymentMethodToken>, + is_customer_initiated_mandate_payment: Option<bool>, ) -> Result< ( StripePaymentMethodData, @@ -1271,7 +1302,10 @@ fn create_stripe_payment_method( )) } payments::PaymentMethodData::BankRedirect(bank_redirect_data) => { - let billing_address = StripeBillingAddress::try_from(bank_redirect_data)?; + let billing_address = StripeBillingAddress::try_from(( + bank_redirect_data, + is_customer_initiated_mandate_payment, + ))?; let pm_type = StripePaymentMethodType::try_from(bank_redirect_data)?; let bank_redirect_data = StripePaymentMethodData::try_from(bank_redirect_data)?; @@ -1760,6 +1794,9 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for PaymentIntentRequest { &item.request.payment_method_data, item.auth_type, item.payment_method_token.clone(), + Some(connector_util::PaymentsAuthorizeRequestData::is_customer_initiated_mandate_payment( + &item.request, + )), )?; validate_shipping_address_against_payment_method( @@ -1966,6 +2003,7 @@ impl TryFrom<&types::TokenizationRouterData> for TokenRequest { &item.request.payment_method_data, item.auth_type, item.payment_method_token.clone(), + None, )?; Ok(Self { token_data: payment_data.0, diff --git a/crates/router/src/connector/utils.rs b/crates/router/src/connector/utils.rs index 0144a578eae..886de4174db 100644 --- a/crates/router/src/connector/utils.rs +++ b/crates/router/src/connector/utils.rs @@ -371,6 +371,7 @@ pub trait PaymentsAuthorizeRequestData { fn get_return_url(&self) -> Result<String, Error>; fn connector_mandate_id(&self) -> Option<String>; fn is_mandate_payment(&self) -> bool; + fn is_customer_initiated_mandate_payment(&self) -> bool; fn get_webhook_url(&self) -> Result<String, Error>; fn get_router_return_url(&self) -> Result<String, Error>; fn is_wallet(&self) -> bool; @@ -510,6 +511,10 @@ impl PaymentsAuthorizeRequestData for types::PaymentsAuthorizeData { .as_ref() .map(|surcharge_details| surcharge_details.get_total_surcharge_amount()) } + + fn is_customer_initiated_mandate_payment(&self) -> bool { + self.setup_mandate_details.is_some() + } } pub trait ConnectorCustomerData { diff --git a/loadtest/config/development.toml b/loadtest/config/development.toml index 43eb06820dc..e1f94c4f80a 100644 --- a/loadtest/config/development.toml +++ b/loadtest/config/development.toml @@ -251,6 +251,7 @@ card.debit = {connector_list = "stripe,adyen,authorizedotnet,cybersource,globalp bank_debit.ach = { connector_list = "gocardless"} bank_debit.becs = { connector_list = "gocardless"} bank_debit.sepa = { connector_list = "gocardless"} +bank_redirect.ideal = {connector_list = "stripe,adyen"} [analytics] source = "sqlx" diff --git a/openapi/openapi_spec.json b/openapi/openapi_spec.json index 4efcfec2557..bf0df4dc4b2 100644 --- a/openapi/openapi_spec.json +++ b/openapi/openapi_spec.json @@ -3477,13 +3477,17 @@ "ideal": { "type": "object", "required": [ - "billing_details", "bank_name", "country" ], "properties": { "billing_details": { - "$ref": "#/components/schemas/BankRedirectBilling" + "allOf": [ + { + "$ref": "#/components/schemas/BankRedirectBilling" + } + ], + "nullable": true }, "bank_name": { "$ref": "#/components/schemas/BankNames" diff --git a/postman/collection-json/adyen_uk.postman_collection.json b/postman/collection-json/adyen_uk.postman_collection.json index 3129182cb02..8ac059b0d7a 100644 --- a/postman/collection-json/adyen_uk.postman_collection.json +++ b/postman/collection-json/adyen_uk.postman_collection.json @@ -1,6 +1,6 @@ { "info": { - "_postman_id": "707f91ae-7be8-4899-b9d3-d069a71470ab", + "_postman_id": "03d0a2d2-c07d-45a8-a8f3-e259de3ae319", "name": "adyen_uk", "description": "## Get started\n\nJuspay Router provides a collection of APIs that enable you to process and manage payments. Our APIs accept and return JSON in the HTTP body, and return standard HTTP response codes. \nYou can consume the APIs directly using your favorite HTTP/REST library. \nWe have a testing environment referred to \"sandbox\", which you can setup to test API calls without affecting production data.\n\n### Base URLs\n\nUse the following base URLs when making requests to the APIs:\n\n| Environment | Base URL |\n| --- | --- |\n| Sandbox | [https://sandbox.hyperswitch.io](https://sandbox.hyperswitch.io) |\n| Production | [https://router.juspay.io](https://router.juspay.io) |\n\n# Authentication\n\nWhen you sign up for an account, you are given a secret key (also referred as api-key). You may authenticate all API requests with Juspay server by providing the appropriate key in the request Authorization header. \nNever share your secret api keys. Keep them guarded and secure.\n\nContact Support: \nName: Juspay Support \nEmail: [[email protected]](mailto:[email protected])", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", @@ -406,7 +406,7 @@ ], "body": { "mode": "raw", - "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\":false,\"installment_payment_enabled\":false},{\"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\"}},\"apple_pay\":{\"session_token_data\":{\"initiative\":\"web\",\"certificate\":\"LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUdKakNDQlE2Z0F3SUJBZ0lRRENzRmFrVkNLU01uc2JacTc1YTI0ekFOQmdrcWhraUc5dzBCQVFzRkFEQjEKTVVRd1FnWURWUVFERER0QmNIQnNaU0JYYjNKc1pIZHBaR1VnUkdWMlpXeHZjR1Z5SUZKbGJHRjBhVzl1Y3lCRApaWEowYVdacFkyRjBhVzl1SUVGMWRHaHZjbWwwZVRFTE1Ba0dBMVVFQ3d3Q1J6TXhFekFSQmdOVkJBb01Da0Z3CmNHeGxJRWx1WXk0eEN6QUpCZ05WQkFZVEFsVlRNQjRYRFRJeU1USXdPREE1TVRJeE1Wb1hEVEkxTURFd05qQTUKTVRJeE1Gb3dnYWd4SmpBa0Jnb0praWFKay9Jc1pBRUJEQlp0WlhKamFHRnVkQzVqYjIwdVlXUjVaVzR1YzJGdQpNVHN3T1FZRFZRUUREREpCY0hCc1pTQlFZWGtnVFdWeVkyaGhiblFnU1dSbGJuUnBkSGs2YldWeVkyaGhiblF1ClkyOXRMbUZrZVdWdUxuTmhiakVUTUJFR0ExVUVDd3dLV1UwNVZUY3pXakpLVFRFc01Db0dBMVVFQ2d3alNsVlQKVUVGWklGUkZRMGhPVDB4UFIwbEZVeUJRVWtsV1FWUkZJRXhKVFVsVVJVUXdnZ0VpTUEwR0NTcUdTSWIzRFFFQgpBUVVBQTRJQkR3QXdnZ0VLQW9JQkFRRDhIUy81ZmJZNVJLaElYU3pySEpoeTVrNmY0YUdMaEltYklLaXFYRUlUCnVSQ2RHcGcyMExZM1VhTlBlYXZXTVRIUTBpK3d1RzlZWFVhYzV5eGE0cHg5eHlmQlVIejhzeU9pMjdYNVZaVG8KTlFhd2F6dGM5aGpZc1B2K0s2UW9oaWRTQWZ3cDhMdThkQ0lVZlhQWHBjdjFqVVRyRCtlc1RJTFZUb1FUTmhDcwplQlJtUS9nK05WdTB5c3BqeUYxU2l6VG9BK1BML3NrMlJEYWNaWC9vWTB1R040VWd4c0JYWHdZM0dKbTFSQ3B1CjM0Y2d0UC9kaHNBM1Ixb1VOb0gyQkZBSm9xK3pyUnl3U1RCSEhNMGpEQ2lncVU1RktwL1pBbHdzYmg1WVZOU00KWksrQ0pTK1BPTzlVNGVkeHJmTGlBVkhnQTgzRG43Z2U4K29nV1Y0Z0hUNmhBZ01CQUFHamdnSjhNSUlDZURBTQpCZ05WSFJNQkFmOEVBakFBTUI4R0ExVWRJd1FZTUJhQUZBbit3QldRK2E5a0NwSVN1U1lvWXd5WDdLZXlNSEFHCkNDc0dBUVVGQndFQkJHUXdZakF0QmdnckJnRUZCUWN3QW9ZaGFIUjBjRG92TDJObGNuUnpMbUZ3Y0d4bExtTnYKYlM5M2QyUnlaek11WkdWeU1ERUdDQ3NHQVFVRkJ6QUJoaVZvZEhSd09pOHZiMk56Y0M1aGNIQnNaUzVqYjIwdgpiMk56Y0RBekxYZDNaSEpuTXpBNU1JSUJMUVlEVlIwZ0JJSUJKRENDQVNBd2dnRWNCZ2txaGtpRzkyTmtCUUV3CmdnRU5NSUhSQmdnckJnRUZCUWNDQWpDQnhBeUJ3VkpsYkdsaGJtTmxJRzl1SUhSb2FYTWdRMlZ5ZEdsbWFXTmgKZEdVZ1lua2dZVzU1SUhCaGNuUjVJRzkwYUdWeUlIUm9ZVzRnUVhCd2JHVWdhWE1nY0hKdmFHbGlhWFJsWkM0ZwpVbVZtWlhJZ2RHOGdkR2hsSUdGd2NHeHBZMkZpYkdVZ2MzUmhibVJoY21RZ2RHVnliWE1nWVc1a0lHTnZibVJwCmRHbHZibk1nYjJZZ2RYTmxMQ0JqWlhKMGFXWnBZMkYwWlNCd2IyeHBZM2tnWVc1a0lHTmxjblJwWm1sallYUnAKYjI0Z2NISmhZM1JwWTJVZ2MzUmhkR1Z0Wlc1MGN5NHdOd1lJS3dZQkJRVUhBZ0VXSzJoMGRIQnpPaTh2ZDNkMwpMbUZ3Y0d4bExtTnZiUzlqWlhKMGFXWnBZMkYwWldGMWRHaHZjbWwwZVM4d0V3WURWUjBsQkF3d0NnWUlLd1lCCkJRVUhBd0l3SFFZRFZSME9CQllFRk5RSysxcUNHbDRTQ1p6SzFSUmpnb05nM0hmdk1BNEdBMVVkRHdFQi93UUUKQXdJSGdEQlBCZ2txaGtpRzkyTmtCaUFFUWd4QVFVUkNRemxDTmtGRE5USkVRems0TnpCRk5qYzJNVFpFUkRJdwpPVUkwTWtReE1UVXlSVVpFTURVeFFVRXhRekV6T0ROR00wUkROa1V5TkVNelFqRkVSVEFQQmdrcWhraUc5Mk5rCkJpNEVBZ1VBTUEwR0NTcUdTSWIzRFFFQkN3VUFBNElCQVFBSFR6NTU2RUs5VVp6R0RVd2cvcmFibmYrUXFSYkgKcllVS0ZNcWQwUDhFTHZGMmYrTzN0ZXlDWHNBckF4TmVMY2hRSGVTNUFJOHd2azdMQ0xLUmJCdWJQQy9NVmtBKwpCZ3h5STg2ejJOVUNDWml4QVM1d2JFQWJYOStVMFp2RHp5Y01BbUNrdVVHZjNwWXR5TDNDaEplSGRvOEwwdmdvCnJQWElUSzc4ZjQzenNzYjBTNE5xbTE0eS9LNCs1ZkUzcFUxdEJqME5tUmdKUVJLRnB6MENpV2RPd1BRTk5BYUMKYUNNU2NiYXdwUTBjWEhaZDJWVjNtem4xdUlITEVtaU5GTWVxeEprbjZhUXFFQnNndDUzaUFxcmZMNjEzWStScAppd0tENXVmeU0wYzBweTYyZmkvWEwwS2c4ajEwWU1VdWJpd2dHajAzZThQWTB6bWUvcGZCZ3p6VQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==\",\"display_name\":\"applepay\",\"certificate_keys\":\"LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1JSUV2Z0lCQURBTkJna3Foa2lHOXcwQkFRRUZBQVNDQktnd2dnU2tBZ0VBQW9JQkFRRDhIUy81ZmJZNVJLaEkKWFN6ckhKaHk1azZmNGFHTGhJbWJJS2lxWEVJVHVSQ2RHcGcyMExZM1VhTlBlYXZXTVRIUTBpK3d1RzlZWFVhYwo1eXhhNHB4OXh5ZkJVSHo4c3lPaTI3WDVWWlRvTlFhd2F6dGM5aGpZc1B2K0s2UW9oaWRTQWZ3cDhMdThkQ0lVCmZYUFhwY3YxalVUckQrZXNUSUxWVG9RVE5oQ3NlQlJtUS9nK05WdTB5c3BqeUYxU2l6VG9BK1BML3NrMlJEYWMKWlgvb1kwdUdONFVneHNCWFh3WTNHSm0xUkNwdTM0Y2d0UC9kaHNBM1Ixb1VOb0gyQkZBSm9xK3pyUnl3U1RCSApITTBqRENpZ3FVNUZLcC9aQWx3c2JoNVlWTlNNWksrQ0pTK1BPTzlVNGVkeHJmTGlBVkhnQTgzRG43Z2U4K29nCldWNGdIVDZoQWdNQkFBRUNnZ0VBZFNaRzVhTFJxdmpKVFo3bVFYWHZMT3p4dWY5SlpxQTJwUHZmQkJLTXJjZC8KL2RDZXpGSGRhZ1VvWXNUQjRXekluaVVjL2Z3bDJTUzJyREFMZjB2dnRjNTJIYkQ5OHhwMnc3VmVjTGFnMCtuWAo2dUJaSEZCS3FWNU1LZ1l6YUpVMTdqaDM2VEV3dTFnbmdlZnRqVlpBV1NERTFvbDBlSzZ3Mk5kOExjVWdxRkxUCjVHYUlBV01nd0NKL3pzQmwydUV1Y0Q4S21WL1Z2MkVCQVJLWGZtci92UU1NelZrNkhhalprVGZqbWY2cWFVQVMKQWlFblROcHBic2ZrdTk2VGdIa2owWm10VWc0SFkzSU9qWFlpaGJsSjJzQ1JjS3p6cXkxa3B3WlpHcHo1NXEzbgphSXEwenJ3RjlpTUZubEhCa04yK3FjSnhzcDNTalhRdFRLTTY4WHRrVlFLQmdRRC8wemtCVlExR2Q1U0Mzb2czCnM3QWRCZ243dnVMdUZHZFFZY3c0OUppRGw1a1BZRXlKdGQvTVpNOEpFdk1nbVVTeUZmczNZcGtmQ2VGbUp0S3QKMnNNNEdCRWxqTVBQNjI3Q0QrV3c4L3JpWmlOZEg3OUhPRjRneTRGbjBycDNqanlLSWF1OHJISDQwRUUvSkVyOQpxWFQ1SGdWMmJQOGhMcW5sSjFmSDhpY2Zkd0tCZ1FEOFNWQ3ZDV2txQkh2SzE5ZDVTNlArdm5hcXhnTWo0U0srCnJ6L1I1c3pTaW5lS045VEhyeVkxYUZJbVFJZjJYOUdaQXBocUhrckxtQ3BIcURHOWQ3WDVQdUxxQzhmc09kVTYKRzhWaFRXeXdaSVNjdGRSYkk5S2xKUFk2V2ZDQjk0ODNVaDJGbW1xV2JuNWcwZUJxZWZzamVVdEtHekNRaGJDYworR1dBREVRSXB3S0JnUURmaWYvN3pBZm5sVUh1QU9saVV0OEczV29IMGtxVTRydE1IOGpGMCtVWXgzVDFYSjVFCmp1blp2aFN5eHg0dlUvNFU1dVEzQnk3cFVrYmtiZlFWK2x3dlBjaHQyVXlZK0E0MkFKSWlSMjdvT1h1Wk9jNTQKT3liMDNSNWNUR1NuWjJBN0N5VDNubStRak5rV2hXNEpyUE1MWTFJK293dGtRVlF2YW10bnlZNnFEUUtCZ0ZYWgpLT0IzSmxjSzhZa0R5Nm5WeUhkZUhvbGNHaU55YjkxTlN6MUUrWHZIYklnWEdZdmRtUFhoaXRyRGFNQzR1RjBGCjJoRjZQMTlxWnpDOUZqZnY3WGRrSTlrYXF5eENQY0dwUTVBcHhZdDhtUGV1bEJWemFqR1NFMHVsNFVhSWxDNXgKL2VQQnVQVjVvZjJXVFhST0Q5eHhZT0pWd0QvZGprekw1ZFlkMW1UUEFvR0JBTWVwY3diVEphZ3BoZk5zOHY0WAprclNoWXplbVpxY2EwQzRFc2QwNGYwTUxHSlVNS3Zpck4zN0g1OUFjT2IvNWtZcTU5WFRwRmJPWjdmYlpHdDZnCkxnM2hWSHRacElOVGJ5Ni9GOTBUZ09Za3RxUnhNVmc3UFBxbjFqdEFiVU15eVpVZFdHcFNNMmI0bXQ5dGhlUDEKblhMR09NWUtnS2JYbjZXWWN5K2U5eW9ICi0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0KCg==\",\"initiative_context\":\"hyperswitch-sdk-test.netlify.app\",\"merchant_identifier\":\"merchant.com.adyen.san\"},\"payment_request_data\":{\"label\":\"applepay pvt.ltd\",\"supported_networks\":[\"visa\",\"masterCard\",\"amex\",\"discover\"],\"merchant_capabilities\":[\"supports3DS\"]}}}}", + "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\":false,\"installment_payment_enabled\":false},{\"payment_method_type\":\"ideal\",\"recurring_enabled\":false,\"installment_payment_enabled\":false},{\"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\"}},\"apple_pay\":{\"session_token_data\":{\"initiative\":\"web\",\"certificate\":\"LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUdKakNDQlE2Z0F3SUJBZ0lRRENzRmFrVkNLU01uc2JacTc1YTI0ekFOQmdrcWhraUc5dzBCQVFzRkFEQjEKTVVRd1FnWURWUVFERER0QmNIQnNaU0JYYjNKc1pIZHBaR1VnUkdWMlpXeHZjR1Z5SUZKbGJHRjBhVzl1Y3lCRApaWEowYVdacFkyRjBhVzl1SUVGMWRHaHZjbWwwZVRFTE1Ba0dBMVVFQ3d3Q1J6TXhFekFSQmdOVkJBb01Da0Z3CmNHeGxJRWx1WXk0eEN6QUpCZ05WQkFZVEFsVlRNQjRYRFRJeU1USXdPREE1TVRJeE1Wb1hEVEkxTURFd05qQTUKTVRJeE1Gb3dnYWd4SmpBa0Jnb0praWFKay9Jc1pBRUJEQlp0WlhKamFHRnVkQzVqYjIwdVlXUjVaVzR1YzJGdQpNVHN3T1FZRFZRUUREREpCY0hCc1pTQlFZWGtnVFdWeVkyaGhiblFnU1dSbGJuUnBkSGs2YldWeVkyaGhiblF1ClkyOXRMbUZrZVdWdUxuTmhiakVUTUJFR0ExVUVDd3dLV1UwNVZUY3pXakpLVFRFc01Db0dBMVVFQ2d3alNsVlQKVUVGWklGUkZRMGhPVDB4UFIwbEZVeUJRVWtsV1FWUkZJRXhKVFVsVVJVUXdnZ0VpTUEwR0NTcUdTSWIzRFFFQgpBUVVBQTRJQkR3QXdnZ0VLQW9JQkFRRDhIUy81ZmJZNVJLaElYU3pySEpoeTVrNmY0YUdMaEltYklLaXFYRUlUCnVSQ2RHcGcyMExZM1VhTlBlYXZXTVRIUTBpK3d1RzlZWFVhYzV5eGE0cHg5eHlmQlVIejhzeU9pMjdYNVZaVG8KTlFhd2F6dGM5aGpZc1B2K0s2UW9oaWRTQWZ3cDhMdThkQ0lVZlhQWHBjdjFqVVRyRCtlc1RJTFZUb1FUTmhDcwplQlJtUS9nK05WdTB5c3BqeUYxU2l6VG9BK1BML3NrMlJEYWNaWC9vWTB1R040VWd4c0JYWHdZM0dKbTFSQ3B1CjM0Y2d0UC9kaHNBM1Ixb1VOb0gyQkZBSm9xK3pyUnl3U1RCSEhNMGpEQ2lncVU1RktwL1pBbHdzYmg1WVZOU00KWksrQ0pTK1BPTzlVNGVkeHJmTGlBVkhnQTgzRG43Z2U4K29nV1Y0Z0hUNmhBZ01CQUFHamdnSjhNSUlDZURBTQpCZ05WSFJNQkFmOEVBakFBTUI4R0ExVWRJd1FZTUJhQUZBbit3QldRK2E5a0NwSVN1U1lvWXd5WDdLZXlNSEFHCkNDc0dBUVVGQndFQkJHUXdZakF0QmdnckJnRUZCUWN3QW9ZaGFIUjBjRG92TDJObGNuUnpMbUZ3Y0d4bExtTnYKYlM5M2QyUnlaek11WkdWeU1ERUdDQ3NHQVFVRkJ6QUJoaVZvZEhSd09pOHZiMk56Y0M1aGNIQnNaUzVqYjIwdgpiMk56Y0RBekxYZDNaSEpuTXpBNU1JSUJMUVlEVlIwZ0JJSUJKRENDQVNBd2dnRWNCZ2txaGtpRzkyTmtCUUV3CmdnRU5NSUhSQmdnckJnRUZCUWNDQWpDQnhBeUJ3VkpsYkdsaGJtTmxJRzl1SUhSb2FYTWdRMlZ5ZEdsbWFXTmgKZEdVZ1lua2dZVzU1SUhCaGNuUjVJRzkwYUdWeUlIUm9ZVzRnUVhCd2JHVWdhWE1nY0hKdmFHbGlhWFJsWkM0ZwpVbVZtWlhJZ2RHOGdkR2hsSUdGd2NHeHBZMkZpYkdVZ2MzUmhibVJoY21RZ2RHVnliWE1nWVc1a0lHTnZibVJwCmRHbHZibk1nYjJZZ2RYTmxMQ0JqWlhKMGFXWnBZMkYwWlNCd2IyeHBZM2tnWVc1a0lHTmxjblJwWm1sallYUnAKYjI0Z2NISmhZM1JwWTJVZ2MzUmhkR1Z0Wlc1MGN5NHdOd1lJS3dZQkJRVUhBZ0VXSzJoMGRIQnpPaTh2ZDNkMwpMbUZ3Y0d4bExtTnZiUzlqWlhKMGFXWnBZMkYwWldGMWRHaHZjbWwwZVM4d0V3WURWUjBsQkF3d0NnWUlLd1lCCkJRVUhBd0l3SFFZRFZSME9CQllFRk5RSysxcUNHbDRTQ1p6SzFSUmpnb05nM0hmdk1BNEdBMVVkRHdFQi93UUUKQXdJSGdEQlBCZ2txaGtpRzkyTmtCaUFFUWd4QVFVUkNRemxDTmtGRE5USkVRems0TnpCRk5qYzJNVFpFUkRJdwpPVUkwTWtReE1UVXlSVVpFTURVeFFVRXhRekV6T0ROR00wUkROa1V5TkVNelFqRkVSVEFQQmdrcWhraUc5Mk5rCkJpNEVBZ1VBTUEwR0NTcUdTSWIzRFFFQkN3VUFBNElCQVFBSFR6NTU2RUs5VVp6R0RVd2cvcmFibmYrUXFSYkgKcllVS0ZNcWQwUDhFTHZGMmYrTzN0ZXlDWHNBckF4TmVMY2hRSGVTNUFJOHd2azdMQ0xLUmJCdWJQQy9NVmtBKwpCZ3h5STg2ejJOVUNDWml4QVM1d2JFQWJYOStVMFp2RHp5Y01BbUNrdVVHZjNwWXR5TDNDaEplSGRvOEwwdmdvCnJQWElUSzc4ZjQzenNzYjBTNE5xbTE0eS9LNCs1ZkUzcFUxdEJqME5tUmdKUVJLRnB6MENpV2RPd1BRTk5BYUMKYUNNU2NiYXdwUTBjWEhaZDJWVjNtem4xdUlITEVtaU5GTWVxeEprbjZhUXFFQnNndDUzaUFxcmZMNjEzWStScAppd0tENXVmeU0wYzBweTYyZmkvWEwwS2c4ajEwWU1VdWJpd2dHajAzZThQWTB6bWUvcGZCZ3p6VQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==\",\"display_name\":\"applepay\",\"certificate_keys\":\"LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1JSUV2Z0lCQURBTkJna3Foa2lHOXcwQkFRRUZBQVNDQktnd2dnU2tBZ0VBQW9JQkFRRDhIUy81ZmJZNVJLaEkKWFN6ckhKaHk1azZmNGFHTGhJbWJJS2lxWEVJVHVSQ2RHcGcyMExZM1VhTlBlYXZXTVRIUTBpK3d1RzlZWFVhYwo1eXhhNHB4OXh5ZkJVSHo4c3lPaTI3WDVWWlRvTlFhd2F6dGM5aGpZc1B2K0s2UW9oaWRTQWZ3cDhMdThkQ0lVCmZYUFhwY3YxalVUckQrZXNUSUxWVG9RVE5oQ3NlQlJtUS9nK05WdTB5c3BqeUYxU2l6VG9BK1BML3NrMlJEYWMKWlgvb1kwdUdONFVneHNCWFh3WTNHSm0xUkNwdTM0Y2d0UC9kaHNBM1Ixb1VOb0gyQkZBSm9xK3pyUnl3U1RCSApITTBqRENpZ3FVNUZLcC9aQWx3c2JoNVlWTlNNWksrQ0pTK1BPTzlVNGVkeHJmTGlBVkhnQTgzRG43Z2U4K29nCldWNGdIVDZoQWdNQkFBRUNnZ0VBZFNaRzVhTFJxdmpKVFo3bVFYWHZMT3p4dWY5SlpxQTJwUHZmQkJLTXJjZC8KL2RDZXpGSGRhZ1VvWXNUQjRXekluaVVjL2Z3bDJTUzJyREFMZjB2dnRjNTJIYkQ5OHhwMnc3VmVjTGFnMCtuWAo2dUJaSEZCS3FWNU1LZ1l6YUpVMTdqaDM2VEV3dTFnbmdlZnRqVlpBV1NERTFvbDBlSzZ3Mk5kOExjVWdxRkxUCjVHYUlBV01nd0NKL3pzQmwydUV1Y0Q4S21WL1Z2MkVCQVJLWGZtci92UU1NelZrNkhhalprVGZqbWY2cWFVQVMKQWlFblROcHBic2ZrdTk2VGdIa2owWm10VWc0SFkzSU9qWFlpaGJsSjJzQ1JjS3p6cXkxa3B3WlpHcHo1NXEzbgphSXEwenJ3RjlpTUZubEhCa04yK3FjSnhzcDNTalhRdFRLTTY4WHRrVlFLQmdRRC8wemtCVlExR2Q1U0Mzb2czCnM3QWRCZ243dnVMdUZHZFFZY3c0OUppRGw1a1BZRXlKdGQvTVpNOEpFdk1nbVVTeUZmczNZcGtmQ2VGbUp0S3QKMnNNNEdCRWxqTVBQNjI3Q0QrV3c4L3JpWmlOZEg3OUhPRjRneTRGbjBycDNqanlLSWF1OHJISDQwRUUvSkVyOQpxWFQ1SGdWMmJQOGhMcW5sSjFmSDhpY2Zkd0tCZ1FEOFNWQ3ZDV2txQkh2SzE5ZDVTNlArdm5hcXhnTWo0U0srCnJ6L1I1c3pTaW5lS045VEhyeVkxYUZJbVFJZjJYOUdaQXBocUhrckxtQ3BIcURHOWQ3WDVQdUxxQzhmc09kVTYKRzhWaFRXeXdaSVNjdGRSYkk5S2xKUFk2V2ZDQjk0ODNVaDJGbW1xV2JuNWcwZUJxZWZzamVVdEtHekNRaGJDYworR1dBREVRSXB3S0JnUURmaWYvN3pBZm5sVUh1QU9saVV0OEczV29IMGtxVTRydE1IOGpGMCtVWXgzVDFYSjVFCmp1blp2aFN5eHg0dlUvNFU1dVEzQnk3cFVrYmtiZlFWK2x3dlBjaHQyVXlZK0E0MkFKSWlSMjdvT1h1Wk9jNTQKT3liMDNSNWNUR1NuWjJBN0N5VDNubStRak5rV2hXNEpyUE1MWTFJK293dGtRVlF2YW10bnlZNnFEUUtCZ0ZYWgpLT0IzSmxjSzhZa0R5Nm5WeUhkZUhvbGNHaU55YjkxTlN6MUUrWHZIYklnWEdZdmRtUFhoaXRyRGFNQzR1RjBGCjJoRjZQMTlxWnpDOUZqZnY3WGRrSTlrYXF5eENQY0dwUTVBcHhZdDhtUGV1bEJWemFqR1NFMHVsNFVhSWxDNXgKL2VQQnVQVjVvZjJXVFhST0Q5eHhZT0pWd0QvZGprekw1ZFlkMW1UUEFvR0JBTWVwY3diVEphZ3BoZk5zOHY0WAprclNoWXplbVpxY2EwQzRFc2QwNGYwTUxHSlVNS3Zpck4zN0g1OUFjT2IvNWtZcTU5WFRwRmJPWjdmYlpHdDZnCkxnM2hWSHRacElOVGJ5Ni9GOTBUZ09Za3RxUnhNVmc3UFBxbjFqdEFiVU15eVpVZFdHcFNNMmI0bXQ5dGhlUDEKblhMR09NWUtnS2JYbjZXWWN5K2U5eW9ICi0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0KCg==\",\"initiative_context\":\"hyperswitch-sdk-test.netlify.app\",\"merchant_identifier\":\"merchant.com.adyen.san\"},\"payment_request_data\":{\"label\":\"applepay pvt.ltd\",\"supported_networks\":[\"visa\",\"masterCard\",\"amex\",\"discover\"],\"merchant_capabilities\":[\"supports3DS\"]}}}}", "options": { "raw": { "language": "json" @@ -2029,261 +2029,6 @@ } ] }, - { - "name": "Scenario23-Create PM list for dynamic fields", - "item": [ - { - "name": "Payments - Create", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "// Validate status 2xx", - "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {", - " pm.response.to.be.success;", - "});", - "", - "// Validate if response header has matching content-type", - "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {", - " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(", - " \"application/json\",", - " );", - "});", - "", - "// Validate if response has JSON Body", - "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {", - " pm.response.to.have.jsonBody();", - "});", - "", - "// Set response object as internal variable", - "let jsonData = {};", - "try {", - " jsonData = pm.response.json();", - "} catch (e) {}", - "", - "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id", - "if (jsonData?.payment_id) {", - " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);", - " console.log(", - " \"- use {{payment_id}} as collection variable for value\",", - " jsonData.payment_id,", - " );", - "} else {", - " console.log(", - " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",", - " );", - "}", - "", - "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id", - "if (jsonData?.mandate_id) {", - " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);", - " console.log(", - " \"- use {{mandate_id}} as collection variable for value\",", - " jsonData.mandate_id,", - " );", - "} else {", - " console.log(", - " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",", - " );", - "}", - "", - "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret", - "if (jsonData?.client_secret) {", - " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);", - " console.log(", - " \"- use {{client_secret}} as collection variable for value\",", - " jsonData.client_secret,", - " );", - "} else {", - " console.log(", - " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",", - " );", - "}", - "", - "// Response body should have value \"requires_confirmation\" for \"status\"", - "if (jsonData?.status) {", - " pm.test(", - " \"[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'\",", - " function () {", - " pm.expect(jsonData.status).to.eql(\"requires_confirmation\");", - " },", - " );", - "}", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\"amount\":6540,\"currency\":\"EUR\",\"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\",\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"371449635398431\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"7373\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"AT\",\"first_name\":\"PiX\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"AT\",\"first_name\":\"PiX\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments" - ] - }, - "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture" - }, - "response": [] - }, - { - "name": "List payment methods for Merchants", - "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) {}", - "", - "if (", - " jsonData?.payment_methods &&", - " jsonData.payment_methods.some(", - " (method) =>", - " method.payment_method === \"bank_redirect\" &&", - " method.payment_method_types &&", - " method.payment_method_types.some(", - " (type) =>", - " type.payment_method_type === \"eps\" &&", - " type.required_fields &&", - " type.required_fields[\"payment_method_data.bank_redirect.eps.bank_name\"]", - " )", - " )", - ") {", - " pm.test(", - " \"[GET]::/payments/:id - EPS required field contains 'payment_method_data.bank_redirect.eps.bank_name'\",", - " function () {", - " pm.expect(jsonData.payment_methods).to.be.an('array').that.is.not.empty;", - " }", - " );", - "} else {", - " console.log(", - " \"INFO - EPS required field does not contain 'payment_method_data.bank_redirect.eps.bank_name'.\"", - " );", - "}", - "", - "pm.test(", - " \"[GET]::/payments/:id - EPS required field contains 'payment_method_data.bank_redirect.eps.bank_name'\",", - " function () {", - " pm.expect(", - " jsonData?.payment_methods &&", - " jsonData.payment_methods.some(", - " (method) =>", - " method.payment_method === \"bank_redirect\" &&", - " method.payment_method_types &&", - " method.payment_method_types.some(", - " (type) =>", - " type.payment_method_type === \"eps\" &&", - " type.required_fields &&", - " type.required_fields[\"payment_method_data.bank_redirect.eps.bank_name\"]", - " )", - " )", - ").to.eql(true);", - " }", - " );", - "", - "", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{publishable_key}}", - "type": "string" - }, - { - "key": "key", - "value": "api-key", - "type": "string" - }, - { - "key": "in", - "value": "header", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "url": { - "raw": "{{baseUrl}}/account/payment_methods?client_secret={{client_secret}}", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - "payment_methods" - ], - "query": [ - { - "key": "client_secret", - "value": "{{client_secret}}" - } - ] - } - }, - "response": [] - } - ] - }, { "name": "Scenario3-Create payment without PMD", "item": [ @@ -10520,6 +10265,465 @@ } ] }, + { + "name": "Scenario23-Create PM list for eps dynamic fields", + "item": [ + { + "name": "Payments - Create", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "// Validate status 2xx", + "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {", + " pm.response.to.be.success;", + "});", + "", + "// Validate if response header has matching content-type", + "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {", + " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(", + " \"application/json\",", + " );", + "});", + "", + "// Validate if response has JSON Body", + "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {", + " pm.response.to.have.jsonBody();", + "});", + "", + "// Set response object as internal variable", + "let jsonData = {};", + "try {", + " jsonData = pm.response.json();", + "} catch (e) {}", + "", + "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id", + "if (jsonData?.payment_id) {", + " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);", + " console.log(", + " \"- use {{payment_id}} as collection variable for value\",", + " jsonData.payment_id,", + " );", + "} else {", + " console.log(", + " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",", + " );", + "}", + "", + "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id", + "if (jsonData?.mandate_id) {", + " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);", + " console.log(", + " \"- use {{mandate_id}} as collection variable for value\",", + " jsonData.mandate_id,", + " );", + "} else {", + " console.log(", + " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",", + " );", + "}", + "", + "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret", + "if (jsonData?.client_secret) {", + " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);", + " console.log(", + " \"- use {{client_secret}} as collection variable for value\",", + " jsonData.client_secret,", + " );", + "} else {", + " console.log(", + " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",", + " );", + "}", + "", + "// Response body should have value \"requires_confirmation\" for \"status\"", + "if (jsonData?.status) {", + " pm.test(", + " \"[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'\",", + " function () {", + " pm.expect(jsonData.status).to.eql(\"requires_confirmation\");", + " },", + " );", + "}", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\"amount\":6540,\"currency\":\"EUR\",\"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\",\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"371449635398431\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"7373\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"AT\",\"first_name\":\"PiX\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"AT\",\"first_name\":\"PiX\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/payments", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "payments" + ] + }, + "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture" + }, + "response": [] + }, + { + "name": "List payment methods for Merchants", + "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.test(", + " \"[GET]::/payments/:id - EPS required field contains 'payment_method_data.bank_redirect.eps.bank_name'\",", + " function () {", + " pm.expect(", + " jsonData?.payment_methods &&", + " jsonData.payment_methods.some(", + " (method) =>", + " method.payment_method === \"bank_redirect\" &&", + " method.payment_method_types &&", + " method.payment_method_types.some(", + " (type) =>", + " type.payment_method_type === \"eps\" &&", + " type.required_fields &&", + " type.required_fields[\"payment_method_data.bank_redirect.eps.bank_name\"]", + " )", + " )", + ").to.eql(true);", + " }", + " );", + "", + "", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{publishable_key}}", + "type": "string" + }, + { + "key": "key", + "value": "api-key", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/account/payment_methods?client_secret={{client_secret}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "account", + "payment_methods" + ], + "query": [ + { + "key": "client_secret", + "value": "{{client_secret}}" + } + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Scenario24-Create PM list for ideal dynamic fields", + "item": [ + { + "name": "Payments - Create", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "// Validate status 2xx", + "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {", + " pm.response.to.be.success;", + "});", + "", + "// Validate if response header has matching content-type", + "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {", + " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(", + " \"application/json\",", + " );", + "});", + "", + "// Validate if response has JSON Body", + "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {", + " pm.response.to.have.jsonBody();", + "});", + "", + "// Set response object as internal variable", + "let jsonData = {};", + "try {", + " jsonData = pm.response.json();", + "} catch (e) {}", + "", + "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id", + "if (jsonData?.payment_id) {", + " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);", + " console.log(", + " \"- use {{payment_id}} as collection variable for value\",", + " jsonData.payment_id,", + " );", + "} else {", + " console.log(", + " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",", + " );", + "}", + "", + "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id", + "if (jsonData?.mandate_id) {", + " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);", + " console.log(", + " \"- use {{mandate_id}} as collection variable for value\",", + " jsonData.mandate_id,", + " );", + "} else {", + " console.log(", + " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",", + " );", + "}", + "", + "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret", + "if (jsonData?.client_secret) {", + " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);", + " console.log(", + " \"- use {{client_secret}} as collection variable for value\",", + " jsonData.client_secret,", + " );", + "} else {", + " console.log(", + " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",", + " );", + "}", + "", + "// Response body should have value \"requires_confirmation\" for \"status\"", + "if (jsonData?.status) {", + " pm.test(", + " \"[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'\",", + " function () {", + " pm.expect(jsonData.status).to.eql(\"requires_confirmation\");", + " },", + " );", + "}", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\"amount\":6540,\"currency\":\"EUR\",\"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\",\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"371449635398431\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"7373\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"NL\",\"first_name\":\"PiX\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"NL\",\"first_name\":\"PiX\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/payments", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "payments" + ] + }, + "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture" + }, + "response": [] + }, + { + "name": "List payment methods for Merchants", + "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.test(", + " \"[GET]::/payments/:id - EPS required field contains 'payment_method_data.bank_redirect.ideal.bank_name'\",", + " function () {", + " pm.expect(", + " jsonData?.payment_methods &&", + " jsonData.payment_methods.some(", + " (method) =>", + " method.payment_method === \"bank_redirect\" &&", + " method.payment_method_types &&", + " method.payment_method_types.some(", + " (type) =>", + " type.payment_method_type === \"ideal\" &&", + " type.required_fields &&", + " type.required_fields[\"payment_method_data.bank_redirect.ideal.bank_name\"]", + " )", + " )", + ").to.eql(true);", + " }", + " );", + "", + "", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{publishable_key}}", + "type": "string" + }, + { + "key": "key", + "value": "api-key", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/account/payment_methods?client_secret={{client_secret}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "account", + "payment_methods" + ], + "query": [ + { + "key": "client_secret", + "value": "{{client_secret}}" + } + ] + } + }, + "response": [] + } + ] + }, { "name": "Scenario21-Don't Pass CVV for save card flow and verify failed payment Copy", "item": [ diff --git a/postman/collection-json/stripe.postman_collection.json b/postman/collection-json/stripe.postman_collection.json index 0f7f146b9d1..8a68413cc03 100644 --- a/postman/collection-json/stripe.postman_collection.json +++ b/postman/collection-json/stripe.postman_collection.json @@ -1,6 +1,6 @@ { "info": { - "_postman_id": "7f70e958-403f-4dc3-ab14-5bc888950601", + "_postman_id": "680eadff-6c51-4656-956f-1439b3b9d469", "name": "Stripe Postman Collection", "description": "## Get started\n\nJuspay Router provides a collection of APIs that enable you to process and manage payments. Our APIs accept and return JSON in the HTTP body, and return standard HTTP response codes. \nYou can consume the APIs directly using your favorite HTTP/REST library. \nWe have a testing environment referred to \"sandbox\", which you can setup to test API calls without affecting production data.\n\n### Base URLs\n\nUse the following base URLs when making requests to the APIs:\n\n| Environment | Base URL |\n| --- | --- |\n| Sandbox | [https://sandbox.hyperswitch.io](https://sandbox.hyperswitch.io) |\n| Production | [https://router.juspay.io](https://router.juspay.io) |\n\n# Authentication\n\nWhen you sign up for an account, you are given a secret key (also referred as api-key). You may authenticate all API requests with Juspay server by providing the appropriate key in the request Authorization header. \nNever share your secret api keys. Keep them guarded and secure.\n\nContact Support: \nName: Juspay Support \nEmail: [[email protected]](mailto:[email protected])", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", @@ -2048,7 +2048,7 @@ ], "body": { "mode": "raw", - "raw": "{\"connector_type\":\"fiz_operations\",\"connector_name\":\"stripe\",\"business_country\":\"US\",\"business_label\":\"default\",\"connector_account_details\":{\"auth_type\":\"HeaderKey\",\"api_key\":\"{{connector_api_key}}_invalid_values\"},\"test_mode\":false,\"disabled\":false,\"payment_methods_enabled\":[{\"payment_method\":\"pay_later\",\"payment_method_types\":[{\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true,\"payment_experience\":\"redirect_to_url\",\"payment_method_type\":\"affirm\"}]},{\"payment_method\":\"pay_later\",\"payment_method_types\":[{\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true,\"payment_experience\":\"redirect_to_url\",\"payment_method_type\":\"afterpay_clearpay\"}]},{\"payment_method\":\"pay_later\",\"payment_method_types\":[{\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true,\"payment_experience\":\"redirect_to_url\",\"payment_method_type\":\"klarna\"}]},{\"payment_method\":\"pay_later\",\"payment_method_types\":[{\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true,\"payment_experience\":\"invoke_sdk_client\",\"payment_method_type\":\"klarna\"}]},{\"payment_method\":\"bank_redirect\",\"payment_method_types\":[{\"payment_method_type\":\"ideal\",\"payment_experience\":null,\"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\":\"giropay\",\"payment_experience\":null,\"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\":\"sofort\",\"payment_experience\":null,\"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\":\"eps\",\"payment_experience\":null,\"card_networks\":null,\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"bank_debit\",\"payment_method_types\":[{\"payment_method_type\":\"ach\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"becs\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"sepa\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"bank_transfer\",\"payment_method_types\":[{\"payment_method_type\":\"ach\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"bacs\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"sepa\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"card\",\"payment_method_types\":[{\"payment_method_type\":\"credit\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"card\",\"payment_method_types\":[{\"payment_method_type\":\"debit\",\"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\":\"invoke_sdk_client\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"wallet\",\"payment_method_types\":[{\"payment_method_type\":\"google_pay\",\"payment_experience\":\"invoke_sdk_client\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"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\",\"parameters\":{\"gateway\":\"example\",\"gateway_merchant_id\":\"{{gateway_merchant_id}}\"}}}],\"merchant_info\":{\"merchant_name\":\"Narayan Bhat\"}}\n,\"apple_pay\":{\"session_token_data\":{\"initiative\":\"web\",\"certificate\":\"{{certificate}}\",\"display_name\":\"applepay\",\"certificate_keys\":\"{{certificate_keys}}\",\"initiative_context\":\"hyperswitch-sdk-test.netlify.app\",\"merchant_identifier\":\"merchant.com.stripe.sang\"},\"payment_request_data\":{\"label\":\"applepay pvt.ltd\",\"supported_networks\":[\"visa\",\"masterCard\",\"amex\",\"discover\"],\"merchant_capabilities\":[\"supports3DS\"]}}\n}}", + "raw": "{\"connector_type\":\"fiz_operations\",\"connector_name\":\"stripe\",\"business_country\":\"US\",\"business_label\":\"default\",\"connector_account_details\":{\"auth_type\":\"HeaderKey\",\"api_key\":\"{{connector_api_key}}_invalid_values\"},\"test_mode\":false,\"disabled\":false,\"payment_methods_enabled\":[{\"payment_method\":\"pay_later\",\"payment_method_types\":[{\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true,\"payment_experience\":\"redirect_to_url\",\"payment_method_type\":\"affirm\"}]},{\"payment_method\":\"pay_later\",\"payment_method_types\":[{\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true,\"payment_experience\":\"redirect_to_url\",\"payment_method_type\":\"afterpay_clearpay\"}]},{\"payment_method\":\"pay_later\",\"payment_method_types\":[{\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true,\"payment_experience\":\"redirect_to_url\",\"payment_method_type\":\"klarna\"}]},{\"payment_method\":\"pay_later\",\"payment_method_types\":[{\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true,\"payment_experience\":\"invoke_sdk_client\",\"payment_method_type\":\"klarna\"}]},{\"payment_method\":\"bank_redirect\",\"payment_method_types\":[{\"payment_method_type\":\"ideal\",\"payment_experience\":\"redirect_to_url\",\"card_networks\":null,\"accepted_currencies\":{\"type\":\"enable_only\",\"list\":[\"EUR\"]},\"accepted_countries\":{\"type\":\"enable_only\",\"list\":[\"NL\"]},\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"giropay\",\"payment_experience\":null,\"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\":\"sofort\",\"payment_experience\":null,\"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\":\"eps\",\"payment_experience\":null,\"card_networks\":null,\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"bank_debit\",\"payment_method_types\":[{\"payment_method_type\":\"ach\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"becs\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"sepa\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"bank_transfer\",\"payment_method_types\":[{\"payment_method_type\":\"ach\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"bacs\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"sepa\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"card\",\"payment_method_types\":[{\"payment_method_type\":\"credit\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"card\",\"payment_method_types\":[{\"payment_method_type\":\"debit\",\"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\":\"invoke_sdk_client\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"wallet\",\"payment_method_types\":[{\"payment_method_type\":\"google_pay\",\"payment_experience\":\"invoke_sdk_client\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"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\",\"parameters\":{\"gateway\":\"example\",\"gateway_merchant_id\":\"{{gateway_merchant_id}}\"}}}],\"merchant_info\":{\"merchant_name\":\"Narayan Bhat\"}}\n,\"apple_pay\":{\"session_token_data\":{\"initiative\":\"web\",\"certificate\":\"{{certificate}}\",\"display_name\":\"applepay\",\"certificate_keys\":\"{{certificate_keys}}\",\"initiative_context\":\"hyperswitch-sdk-test.netlify.app\",\"merchant_identifier\":\"merchant.com.stripe.sang\"},\"payment_request_data\":{\"label\":\"applepay pvt.ltd\",\"supported_networks\":[\"visa\",\"masterCard\",\"amex\",\"discover\"],\"merchant_capabilities\":[\"supports3DS\"]}}\n}}", "options": { "raw": { "language": "json" @@ -6697,243 +6697,6 @@ } ] }, - { - "name": "Scenario28-Create PM list for eps dynamic fields", - "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", - "raw": "{\"amount\":6540,\"currency\":\"EUR\",\"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\":\"AT\",\"first_name\":\"PiX\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"AT\",\"first_name\":\"PiX\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{baseUrl}}/payments", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments" - ] - }, - "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture" - }, - "response": [] - }, - { - "name": "List payment methods for Merchants", - "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.test(", - " \"[GET]::/payments/:id - EPS required field contains 'payment_method_data.bank_redirect.eps.billing_details.billing_name'\",", - " function () {", - " pm.expect(", - " jsonData?.payment_methods &&", - " jsonData.payment_methods.some(", - " (method) =>", - " method.payment_method === \"bank_redirect\" &&", - " method.payment_method_types &&", - " method.payment_method_types.some(", - " (type) =>", - " type.payment_method_type === \"eps\" &&", - " type.required_fields &&", - " type.required_fields[\"payment_method_data.bank_redirect.eps.billing_details.billing_name\"]", - " )", - " )", - ").to.eql(true);", - " }", - " );", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{publishable_key}}", - "type": "string" - }, - { - "key": "key", - "value": "api-key", - "type": "string" - }, - { - "key": "in", - "value": "header", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "Accept", - "value": "application/json" - } - ], - "url": { - "raw": "{{baseUrl}}/account/payment_methods?client_secret={{client_secret}}", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "account", - "payment_methods" - ], - "query": [ - { - "key": "client_secret", - "value": "{{client_secret}}" - } - ] - } - }, - "response": [] - } - ] - }, { "name": "Scenario2a-Create payment with confirm false card holder name null", "item": [ @@ -20243,6 +20006,500 @@ } ] }, + { + "name": "Scenario28-Create PM list for eps required fields", + "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", + "raw": "{\"amount\":6540,\"currency\":\"EUR\",\"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\":\"AT\",\"first_name\":\"PiX\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"AT\",\"first_name\":\"PiX\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/payments", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "payments" + ] + }, + "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture" + }, + "response": [] + }, + { + "name": "List payment methods for Merchants", + "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.test(", + " \"[GET]::/payments/:id - EPS required field contains 'payment_method_data.bank_redirect.eps.billing_details.billing_name'\",", + " function () {", + " pm.expect(", + " jsonData?.payment_methods &&", + " jsonData.payment_methods.some(", + " (method) =>", + " method.payment_method === \"bank_redirect\" &&", + " method.payment_method_types &&", + " method.payment_method_types.some(", + " (type) =>", + " type.payment_method_type === \"eps\" &&", + " type.required_fields &&", + " type.required_fields[\"payment_method_data.bank_redirect.eps.billing_details.billing_name\"]", + " )", + " )", + ").to.eql(true);", + " }", + " );", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{publishable_key}}", + "type": "string" + }, + { + "key": "key", + "value": "api-key", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/account/payment_methods?client_secret={{client_secret}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "account", + "payment_methods" + ], + "query": [ + { + "key": "client_secret", + "value": "{{client_secret}}" + } + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Scenario27-Create PM list for ideal mandate required fields", + "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", + "raw": "{\"amount\":6540,\"currency\":\"EUR\",\"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\":\"NL\",\"first_name\":\"PiX\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"NL\",\"first_name\":\"PiX\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}, \"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\":6540,\"currency\":\"EUR\"}}}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/payments", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "payments" + ] + }, + "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture" + }, + "response": [] + }, + { + "name": "List payment methods for Merchants", + "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.test(", + " \"[GET]::/payments/:id - Ideal required field contains 'payment_method_data.bank_redirect.ideal.billing_details.billing_name'\",", + " function () {", + " pm.expect(", + " jsonData?.payment_methods &&", + " jsonData.payment_methods.some(", + " (method) =>", + " method.payment_method === \"bank_redirect\" &&", + " method.payment_method_types &&", + " method.payment_method_types.some(", + " (type) =>", + " type.payment_method_type === \"ideal\" &&", + " type.required_fields &&", + " type.required_fields[\"payment_method_data.bank_redirect.ideal.billing_details.billing_name\"]", + " )", + " )", + ").to.eql(true);", + " }", + " );", + "", + "", + "pm.test(", + " \"[GET]::/payments/:id - Ideal required field contains 'payment_method_data.bank_redirect.ideal.billing_details.email'\",", + " function () {", + " pm.expect(", + " jsonData?.payment_methods &&", + " jsonData.payment_methods.some(", + " (method) =>", + " method.payment_method === \"bank_redirect\" &&", + " method.payment_method_types &&", + " method.payment_method_types.some(", + " (type) =>", + " type.payment_method_type === \"ideal\" &&", + " type.required_fields &&", + " type.required_fields[\"payment_method_data.bank_redirect.ideal.billing_details.email\"]", + " )", + " )", + ").to.eql(true);", + " }", + " );", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{publishable_key}}", + "type": "string" + }, + { + "key": "key", + "value": "api-key", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/account/payment_methods?client_secret={{client_secret}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "account", + "payment_methods" + ], + "query": [ + { + "key": "client_secret", + "value": "{{client_secret}}" + } + ] + } + }, + "response": [] + } + ] + }, { "name": "Scenario27-Create payment without customer_id and with billing address and shipping address", "item": [ diff --git a/postman/collection-json/trustpay.postman_collection.json b/postman/collection-json/trustpay.postman_collection.json index f4fa25c371a..f1895e3f2ce 100644 --- a/postman/collection-json/trustpay.postman_collection.json +++ b/postman/collection-json/trustpay.postman_collection.json @@ -1,6 +1,6 @@ { "info": { - "_postman_id": "41080d78-8917-4534-81bc-42318eaab2a0", + "_postman_id": "f68d69cc-3a9d-4da4-9a00-a7f5ce185737", "name": "trustpay", "description": "## Get started\n\nJuspay Router provides a collection of APIs that enable you to process and manage payments. Our APIs accept and return JSON in the HTTP body, and return standard HTTP response codes. \nYou can consume the APIs directly using your favorite HTTP/REST library. \nWe have a testing environment referred to \"sandbox\", which you can setup to test API calls without affecting production data.\n\n### Base URLs\n\nUse the following base URLs when making requests to the APIs:\n\n| Environment | Base URL |\n| --- | --- |\n| Sandbox | [https://sandbox.hyperswitch.io](https://sandbox.hyperswitch.io) |\n| Production | [https://router.juspay.io](https://router.juspay.io) |\n\n# Authentication\n\nWhen you sign up for an account, you are given a secret key (also referred as api-key). You may authenticate all API requests with Juspay server by providing the appropriate key in the request Authorization header. \nNever share your secret api keys. Keep them guarded and secure.\n\nContact Support: \nName: Juspay Support \nEmail: [[email protected]](mailto:[email protected])", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", @@ -4863,6 +4863,322 @@ "response": [] } ] + }, + { + "name": "Scenario9-Create PM list for ideal dynamic fields", + "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", + "raw": "{\"amount\":6540,\"currency\":\"EUR\",\"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\":\"NL\",\"first_name\":\"PiX\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"NL\",\"first_name\":\"PiX\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/payments", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "payments" + ] + }, + "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture" + }, + "response": [] + }, + { + "name": "List payment methods for Merchants", + "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.test(", + " \"[GET]::/payments/:id - Ideal required field contains 'billing.address.first_name'\",", + " function () {", + " pm.expect(", + " jsonData?.payment_methods &&", + " jsonData.payment_methods.some(", + " (method) =>", + " method.payment_method === \"bank_redirect\" &&", + " method.payment_method_types &&", + " method.payment_method_types.some(", + " (type) =>", + " type.payment_method_type === \"ideal\" &&", + " type.required_fields &&", + " type.required_fields[\"billing.address.first_name\"]", + " )", + " )", + ").to.eql(true);", + " }", + " );", + "", + "pm.test(", + " \"[GET]::/payments/:id - Ideal required field contains 'billing.address.country'\",", + " function () {", + " pm.expect(", + " jsonData?.payment_methods &&", + " jsonData.payment_methods.some(", + " (method) =>", + " method.payment_method === \"bank_redirect\" &&", + " method.payment_method_types &&", + " method.payment_method_types.some(", + " (type) =>", + " type.payment_method_type === \"ideal\" &&", + " type.required_fields &&", + " type.required_fields[\"billing.address.country\"]", + " )", + " )", + ").to.eql(true);", + " }", + " );", + "", + "pm.test(", + " \"[GET]::/payments/:id - Ideal required field contains 'billing.address.zip'\",", + " function () {", + " pm.expect(", + " jsonData?.payment_methods &&", + " jsonData.payment_methods.some(", + " (method) =>", + " method.payment_method === \"bank_redirect\" &&", + " method.payment_method_types &&", + " method.payment_method_types.some(", + " (type) =>", + " type.payment_method_type === \"ideal\" &&", + " type.required_fields &&", + " type.required_fields[\"billing.address.zip\"]", + " )", + " )", + ").to.eql(true);", + " }", + " );", + "", + "pm.test(", + " \"[GET]::/payments/:id - Ideal required field contains 'billing.address.city'\",", + " function () {", + " pm.expect(", + " jsonData?.payment_methods &&", + " jsonData.payment_methods.some(", + " (method) =>", + " method.payment_method === \"bank_redirect\" &&", + " method.payment_method_types &&", + " method.payment_method_types.some(", + " (type) =>", + " type.payment_method_type === \"ideal\" &&", + " type.required_fields &&", + " type.required_fields[\"billing.address.city\"]", + " )", + " )", + ").to.eql(true);", + " }", + " );", + "", + " pm.test(", + " \"[GET]::/payments/:id - Ideal required field contains 'billing.address.line1'\",", + " function () {", + " pm.expect(", + " jsonData?.payment_methods &&", + " jsonData.payment_methods.some(", + " (method) =>", + " method.payment_method === \"bank_redirect\" &&", + " method.payment_method_types &&", + " method.payment_method_types.some(", + " (type) =>", + " type.payment_method_type === \"ideal\" &&", + " type.required_fields &&", + " type.required_fields[\"billing.address.line1\"]", + " )", + " )", + ").to.eql(true);", + " }", + " );", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{publishable_key}}", + "type": "string" + }, + { + "key": "key", + "value": "api-key", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/account/payment_methods?client_secret={{client_secret}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "account", + "payment_methods" + ], + "query": [ + { + "key": "client_secret", + "value": "{{client_secret}}" + } + ] + } + }, + "response": [] + } + ] } ] },
feat
add required fields for Ideal (#3183)
0e497811adaad118163f783b225eedf5cc10dcc1
2024-10-28 19:48:52
github-actions
chore(version): 2024.10.28.2
false
diff --git a/CHANGELOG.md b/CHANGELOG.md index e6f92b8cf86..416b6cb7f08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,18 @@ All notable changes to HyperSwitch will be documented here. - - - +## 2024.10.28.2 + +### Bug Fixes + +- **connector:** + - [Novalnet] Remove webhook placeholder connector config ([#6451](https://github.com/juspay/hyperswitch/pull/6451)) ([`e33340e`](https://github.com/juspay/hyperswitch/commit/e33340e70b59e9e4f18e92fc27d8c90b3df5768b)) + - [Adyen] Add MYR currency config ([#6442](https://github.com/juspay/hyperswitch/pull/6442)) ([`925e424`](https://github.com/juspay/hyperswitch/commit/925e4240e4ad6da1d243769b184842c0d8251a7d)) + +**Full Changelog:** [`2024.10.28.1...2024.10.28.2`](https://github.com/juspay/hyperswitch/compare/2024.10.28.1...2024.10.28.2) + +- - - + ## 2024.10.28.1 ### Bug Fixes
chore
2024.10.28.2
b5feab61d950921c75267ad88e944e7e2c4af3ca
2023-10-13 18:14:12
DEEPANSHU BANSAL
feat(connector): [HELCIM] Implement Cards for Helcim (#2210)
false
diff --git a/connector-template/mod.rs b/connector-template/mod.rs index 6c311844c88..9f9793d7d76 100644 --- a/connector-template/mod.rs +++ b/connector-template/mod.rs @@ -57,7 +57,7 @@ where ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> { let mut header = vec![( headers::CONTENT_TYPE.to_string(), - types::PaymentsAuthorizeType::get_content_type(self).to_string().into(), + self.get_content_type().to_string().into(), )]; let mut api_key = self.get_auth_header(&req.connector_auth_type)?; header.append(&mut api_key); diff --git a/crates/api_models/src/enums.rs b/crates/api_models/src/enums.rs index fd6b92a91ce..7a02d3dee65 100644 --- a/crates/api_models/src/enums.rs +++ b/crates/api_models/src/enums.rs @@ -91,7 +91,7 @@ pub enum Connector { Globalpay, Globepay, Gocardless, - //Helcim, added as template code for future usage, + Helcim, Iatapay, Klarna, Mollie, @@ -209,7 +209,7 @@ pub enum RoutableConnectors { Globalpay, Globepay, Gocardless, - //Helcim, added as template code for future usage, + Helcim, Iatapay, Klarna, Mollie, diff --git a/crates/common_enums/src/transformers.rs b/crates/common_enums/src/transformers.rs index 8f967ddf940..73f736cdeef 100644 --- a/crates/common_enums/src/transformers.rs +++ b/crates/common_enums/src/transformers.rs @@ -10,6 +10,261 @@ impl Display for NumericCountryCodeParseError { } } +impl CountryAlpha2 { + pub const fn from_alpha2_to_alpha3(code: Self) -> CountryAlpha3 { + match code { + Self::AF => CountryAlpha3::AFG, + Self::AX => CountryAlpha3::ALA, + Self::AL => CountryAlpha3::ALB, + Self::DZ => CountryAlpha3::DZA, + Self::AS => CountryAlpha3::ASM, + Self::AD => CountryAlpha3::AND, + Self::AO => CountryAlpha3::AGO, + Self::AI => CountryAlpha3::AIA, + Self::AQ => CountryAlpha3::ATA, + Self::AG => CountryAlpha3::ATG, + Self::AR => CountryAlpha3::ARG, + Self::AM => CountryAlpha3::ARM, + Self::AW => CountryAlpha3::ABW, + Self::AU => CountryAlpha3::AUS, + Self::AT => CountryAlpha3::AUT, + Self::AZ => CountryAlpha3::AZE, + Self::BS => CountryAlpha3::BHS, + Self::BH => CountryAlpha3::BHR, + Self::BD => CountryAlpha3::BGD, + Self::BB => CountryAlpha3::BRB, + Self::BY => CountryAlpha3::BLR, + Self::BE => CountryAlpha3::BEL, + Self::BZ => CountryAlpha3::BLZ, + Self::BJ => CountryAlpha3::BEN, + Self::BM => CountryAlpha3::BMU, + Self::BT => CountryAlpha3::BTN, + Self::BO => CountryAlpha3::BOL, + Self::BQ => CountryAlpha3::BES, + Self::BA => CountryAlpha3::BIH, + Self::BW => CountryAlpha3::BWA, + Self::BV => CountryAlpha3::BVT, + Self::BR => CountryAlpha3::BRA, + Self::IO => CountryAlpha3::IOT, + Self::BN => CountryAlpha3::BRN, + Self::BG => CountryAlpha3::BGR, + Self::BF => CountryAlpha3::BFA, + Self::BI => CountryAlpha3::BDI, + Self::CV => CountryAlpha3::CPV, + Self::KH => CountryAlpha3::KHM, + Self::CM => CountryAlpha3::CMR, + Self::CA => CountryAlpha3::CAN, + Self::KY => CountryAlpha3::CYM, + Self::CF => CountryAlpha3::CAF, + Self::TD => CountryAlpha3::TCD, + Self::CL => CountryAlpha3::CHL, + Self::CN => CountryAlpha3::CHN, + Self::CX => CountryAlpha3::CXR, + Self::CC => CountryAlpha3::CCK, + Self::CO => CountryAlpha3::COL, + Self::KM => CountryAlpha3::COM, + Self::CG => CountryAlpha3::COG, + Self::CD => CountryAlpha3::COD, + Self::CK => CountryAlpha3::COK, + Self::CR => CountryAlpha3::CRI, + Self::CI => CountryAlpha3::CIV, + Self::HR => CountryAlpha3::HRV, + Self::CU => CountryAlpha3::CUB, + Self::CW => CountryAlpha3::CUW, + Self::CY => CountryAlpha3::CYP, + Self::CZ => CountryAlpha3::CZE, + Self::DK => CountryAlpha3::DNK, + Self::DJ => CountryAlpha3::DJI, + Self::DM => CountryAlpha3::DMA, + Self::DO => CountryAlpha3::DOM, + Self::EC => CountryAlpha3::ECU, + Self::EG => CountryAlpha3::EGY, + Self::SV => CountryAlpha3::SLV, + Self::GQ => CountryAlpha3::GNQ, + Self::ER => CountryAlpha3::ERI, + Self::EE => CountryAlpha3::EST, + Self::ET => CountryAlpha3::ETH, + Self::FK => CountryAlpha3::FLK, + Self::FO => CountryAlpha3::FRO, + Self::FJ => CountryAlpha3::FJI, + Self::FI => CountryAlpha3::FIN, + Self::FR => CountryAlpha3::FRA, + Self::GF => CountryAlpha3::GUF, + Self::PF => CountryAlpha3::PYF, + Self::TF => CountryAlpha3::ATF, + Self::GA => CountryAlpha3::GAB, + Self::GM => CountryAlpha3::GMB, + Self::GE => CountryAlpha3::GEO, + Self::DE => CountryAlpha3::DEU, + Self::GH => CountryAlpha3::GHA, + Self::GI => CountryAlpha3::GIB, + Self::GR => CountryAlpha3::GRC, + Self::GL => CountryAlpha3::GRL, + Self::GD => CountryAlpha3::GRD, + Self::GP => CountryAlpha3::GLP, + Self::GU => CountryAlpha3::GUM, + Self::GT => CountryAlpha3::GTM, + Self::GG => CountryAlpha3::GGY, + Self::GN => CountryAlpha3::GIN, + Self::GW => CountryAlpha3::GNB, + Self::GY => CountryAlpha3::GUY, + Self::HT => CountryAlpha3::HTI, + Self::HM => CountryAlpha3::HMD, + Self::VA => CountryAlpha3::VAT, + Self::HN => CountryAlpha3::HND, + Self::HK => CountryAlpha3::HKG, + Self::HU => CountryAlpha3::HUN, + Self::IS => CountryAlpha3::ISL, + Self::IN => CountryAlpha3::IND, + Self::ID => CountryAlpha3::IDN, + Self::IR => CountryAlpha3::IRN, + Self::IQ => CountryAlpha3::IRQ, + Self::IE => CountryAlpha3::IRL, + Self::IM => CountryAlpha3::IMN, + Self::IL => CountryAlpha3::ISR, + Self::IT => CountryAlpha3::ITA, + Self::JM => CountryAlpha3::JAM, + Self::JP => CountryAlpha3::JPN, + Self::JE => CountryAlpha3::JEY, + Self::JO => CountryAlpha3::JOR, + Self::KZ => CountryAlpha3::KAZ, + Self::KE => CountryAlpha3::KEN, + Self::KI => CountryAlpha3::KIR, + Self::KP => CountryAlpha3::PRK, + Self::KR => CountryAlpha3::KOR, + Self::KW => CountryAlpha3::KWT, + Self::KG => CountryAlpha3::KGZ, + Self::LA => CountryAlpha3::LAO, + Self::LV => CountryAlpha3::LVA, + Self::LB => CountryAlpha3::LBN, + Self::LS => CountryAlpha3::LSO, + Self::LR => CountryAlpha3::LBR, + Self::LY => CountryAlpha3::LBY, + Self::LI => CountryAlpha3::LIE, + Self::LT => CountryAlpha3::LTU, + Self::LU => CountryAlpha3::LUX, + Self::MO => CountryAlpha3::MAC, + Self::MK => CountryAlpha3::MKD, + Self::MG => CountryAlpha3::MDG, + Self::MW => CountryAlpha3::MWI, + Self::MY => CountryAlpha3::MYS, + Self::MV => CountryAlpha3::MDV, + Self::ML => CountryAlpha3::MLI, + Self::MT => CountryAlpha3::MLT, + Self::MH => CountryAlpha3::MHL, + Self::MQ => CountryAlpha3::MTQ, + Self::MR => CountryAlpha3::MRT, + Self::MU => CountryAlpha3::MUS, + Self::YT => CountryAlpha3::MYT, + Self::MX => CountryAlpha3::MEX, + Self::FM => CountryAlpha3::FSM, + Self::MD => CountryAlpha3::MDA, + Self::MC => CountryAlpha3::MCO, + Self::MN => CountryAlpha3::MNG, + Self::ME => CountryAlpha3::MNE, + Self::MS => CountryAlpha3::MSR, + Self::MA => CountryAlpha3::MAR, + Self::MZ => CountryAlpha3::MOZ, + Self::MM => CountryAlpha3::MMR, + Self::NA => CountryAlpha3::NAM, + Self::NR => CountryAlpha3::NRU, + Self::NP => CountryAlpha3::NPL, + Self::NL => CountryAlpha3::NLD, + Self::NC => CountryAlpha3::NCL, + Self::NZ => CountryAlpha3::NZL, + Self::NI => CountryAlpha3::NIC, + Self::NE => CountryAlpha3::NER, + Self::NG => CountryAlpha3::NGA, + Self::NU => CountryAlpha3::NIU, + Self::NF => CountryAlpha3::NFK, + Self::MP => CountryAlpha3::MNP, + Self::NO => CountryAlpha3::NOR, + Self::OM => CountryAlpha3::OMN, + Self::PK => CountryAlpha3::PAK, + Self::PW => CountryAlpha3::PLW, + Self::PS => CountryAlpha3::PSE, + Self::PA => CountryAlpha3::PAN, + Self::PG => CountryAlpha3::PNG, + Self::PY => CountryAlpha3::PRY, + Self::PE => CountryAlpha3::PER, + Self::PH => CountryAlpha3::PHL, + Self::PN => CountryAlpha3::PCN, + Self::PL => CountryAlpha3::POL, + Self::PT => CountryAlpha3::PRT, + Self::PR => CountryAlpha3::PRI, + Self::QA => CountryAlpha3::QAT, + Self::RE => CountryAlpha3::REU, + Self::RO => CountryAlpha3::ROU, + Self::RU => CountryAlpha3::RUS, + Self::RW => CountryAlpha3::RWA, + Self::BL => CountryAlpha3::BLM, + Self::SH => CountryAlpha3::SHN, + Self::KN => CountryAlpha3::KNA, + Self::LC => CountryAlpha3::LCA, + Self::MF => CountryAlpha3::MAF, + Self::PM => CountryAlpha3::SPM, + Self::VC => CountryAlpha3::VCT, + Self::WS => CountryAlpha3::WSM, + Self::SM => CountryAlpha3::SMR, + Self::ST => CountryAlpha3::STP, + Self::SA => CountryAlpha3::SAU, + Self::SN => CountryAlpha3::SEN, + Self::RS => CountryAlpha3::SRB, + Self::SC => CountryAlpha3::SYC, + Self::SL => CountryAlpha3::SLE, + Self::SG => CountryAlpha3::SGP, + Self::SX => CountryAlpha3::SXM, + Self::SK => CountryAlpha3::SVK, + Self::SI => CountryAlpha3::SVN, + Self::SB => CountryAlpha3::SLB, + Self::SO => CountryAlpha3::SOM, + Self::ZA => CountryAlpha3::ZAF, + Self::GS => CountryAlpha3::SGS, + Self::SS => CountryAlpha3::SSD, + Self::ES => CountryAlpha3::ESP, + Self::LK => CountryAlpha3::LKA, + Self::SD => CountryAlpha3::SDN, + Self::SR => CountryAlpha3::SUR, + Self::SJ => CountryAlpha3::SJM, + Self::SZ => CountryAlpha3::SWZ, + Self::SE => CountryAlpha3::SWE, + Self::CH => CountryAlpha3::CHE, + Self::SY => CountryAlpha3::SYR, + Self::TW => CountryAlpha3::TWN, + Self::TJ => CountryAlpha3::TJK, + Self::TZ => CountryAlpha3::TZA, + Self::TH => CountryAlpha3::THA, + Self::TL => CountryAlpha3::TLS, + Self::TG => CountryAlpha3::TGO, + Self::TK => CountryAlpha3::TKL, + Self::TO => CountryAlpha3::TON, + Self::TT => CountryAlpha3::TTO, + Self::TN => CountryAlpha3::TUN, + Self::TR => CountryAlpha3::TUR, + Self::TM => CountryAlpha3::TKM, + Self::TC => CountryAlpha3::TCA, + Self::TV => CountryAlpha3::TUV, + Self::UG => CountryAlpha3::UGA, + Self::UA => CountryAlpha3::UKR, + Self::AE => CountryAlpha3::ARE, + Self::GB => CountryAlpha3::GBR, + Self::US => CountryAlpha3::USA, + Self::UM => CountryAlpha3::UMI, + Self::UY => CountryAlpha3::URY, + Self::UZ => CountryAlpha3::UZB, + Self::VU => CountryAlpha3::VUT, + Self::VE => CountryAlpha3::VEN, + Self::VN => CountryAlpha3::VNM, + Self::VG => CountryAlpha3::VGB, + Self::VI => CountryAlpha3::VIR, + Self::WF => CountryAlpha3::WLF, + Self::EH => CountryAlpha3::ESH, + Self::YE => CountryAlpha3::YEM, + Self::ZM => CountryAlpha3::ZMB, + Self::ZW => CountryAlpha3::ZWE, + } + } +} impl Country { pub const fn from_alpha2(code: CountryAlpha2) -> Self { match code { diff --git a/crates/router/src/connector/gocardless/transformers.rs b/crates/router/src/connector/gocardless/transformers.rs index c5322ccf7fc..d3b2d244760 100644 --- a/crates/router/src/connector/gocardless/transformers.rs +++ b/crates/router/src/connector/gocardless/transformers.rs @@ -9,7 +9,8 @@ use serde::{Deserialize, Serialize}; use crate::{ connector::utils::{ self, AddressDetailsData, BankDirectDebitBillingData, BrowserInformationData, - ConnectorCustomerData, PaymentsAuthorizeRequestData, RouterData, SetupMandateRequestData, + ConnectorCustomerData, PaymentsAuthorizeRequestData, PaymentsSetupMandateRequestData, + RouterData, }, core::errors, types::{ diff --git a/crates/router/src/connector/helcim.rs b/crates/router/src/connector/helcim.rs index a3cb5f7a22e..87fcfdd36d8 100644 --- a/crates/router/src/connector/helcim.rs +++ b/crates/router/src/connector/helcim.rs @@ -2,12 +2,15 @@ pub mod transformers; use std::fmt::Debug; +use diesel_models::enums; use error_stack::{IntoReport, ResultExt}; use masking::ExposeInterface; use transformers as helcim; +use super::utils::{to_connector_meta, PaymentsAuthorizeRequestData}; use crate::{ configs::settings, + consts::NO_ERROR_CODE, core::errors::{self, CustomResult}, headers, services::{ @@ -39,6 +42,16 @@ impl api::RefundExecute for Helcim {} impl api::RefundSync for Helcim {} impl api::PaymentToken for Helcim {} +impl Helcim { + pub fn connector_transaction_id( + &self, + connector_meta: &Option<serde_json::Value>, + ) -> CustomResult<Option<String>, errors::ConnectorError> { + let meta: helcim::HelcimMetaData = to_connector_meta(connector_meta.clone())?; + Ok(Some(meta.preauth_transaction_id.to_string())) + } +} + impl ConnectorIntegration< api::PaymentMethodToken, @@ -60,12 +73,19 @@ where ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> { let mut header = vec![( headers::CONTENT_TYPE.to_string(), - types::PaymentsAuthorizeType::get_content_type(self) - .to_string() - .into(), + self.get_content_type().to_string().into(), )]; let mut api_key = self.get_auth_header(&req.connector_auth_type)?; + + //Helcim requires an Idempotency Key of length 25. We prefix every ID by "HS_". + const ID_LENGTH: usize = 22; + let mut idempotency_key = vec![( + headers::IDEMPOTENCY_KEY.to_string(), + utils::generate_id(ID_LENGTH, "HS").into_masked(), + )]; + header.append(&mut api_key); + header.append(&mut idempotency_key); Ok(header) } } @@ -75,6 +95,10 @@ impl ConnectorCommon for Helcim { "helcim" } + fn get_currency_unit(&self) -> api::CurrencyUnit { + api::CurrencyUnit::Base + } + fn common_get_content_type(&self) -> &'static str { "application/json" } @@ -90,7 +114,7 @@ impl ConnectorCommon for Helcim { let auth = helcim::HelcimAuthType::try_from(auth_type) .change_context(errors::ConnectorError::FailedToObtainAuthType)?; Ok(vec![( - headers::AUTHORIZATION.to_string(), + headers::API_TOKEN.to_string(), auth.api_key.expose().into_masked(), )]) } @@ -103,18 +127,33 @@ impl ConnectorCommon for Helcim { .response .parse_struct("HelcimErrorResponse") .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; + let error_string = match response.errors { + transformers::HelcimErrorTypes::StringType(error) => error, + transformers::HelcimErrorTypes::JsonType(error) => error.to_string(), + }; Ok(ErrorResponse { status_code: res.status_code, - code: response.code, - message: response.message, - reason: response.reason, + code: NO_ERROR_CODE.to_owned(), + message: error_string.clone(), + reason: Some(error_string), }) } } impl ConnectorValidation for Helcim { - //TODO: implement functions when support enabled + fn validate_capture_method( + &self, + capture_method: Option<enums::CaptureMethod>, + ) -> CustomResult<(), errors::ConnectorError> { + let capture_method = capture_method.unwrap_or_default(); + match capture_method { + enums::CaptureMethod::Automatic | enums::CaptureMethod::Manual => Ok(()), + enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err( + super::utils::construct_not_supported_error_report(capture_method, self.id()), + ), + } + } } impl ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData> @@ -135,6 +174,70 @@ impl types::PaymentsResponseData, > for Helcim { + fn get_headers( + &self, + req: &types::SetupMandateRouterData, + connectors: &settings::Connectors, + ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> { + self.build_headers(req, connectors) + } + + fn get_url( + &self, + _req: &types::SetupMandateRouterData, + connectors: &settings::Connectors, + ) -> CustomResult<String, errors::ConnectorError> { + Ok(format!("{}v2/payment/verify", self.base_url(connectors))) + } + fn get_request_body( + &self, + req: &types::SetupMandateRouterData, + ) -> CustomResult<Option<types::RequestBody>, errors::ConnectorError> { + let connector_req = helcim::HelcimVerifyRequest::try_from(req)?; + + let helcim_req = types::RequestBody::log_and_get_request_body( + &connector_req, + utils::Encode::<helcim::HelcimVerifyRequest>::encode_to_string_of_json, + ) + .change_context(errors::ConnectorError::RequestEncodingFailed)?; + Ok(Some(helcim_req)) + } + fn build_request( + &self, + req: &types::SetupMandateRouterData, + connectors: &settings::Connectors, + ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + Ok(Some( + services::RequestBuilder::new() + .method(services::Method::Post) + .url(&types::SetupMandateType::get_url(self, req, connectors)?) + .attach_default_headers() + .headers(types::SetupMandateType::get_headers(self, req, connectors)?) + .body(types::SetupMandateType::get_request_body(self, req)?) + .build(), + )) + } + fn handle_response( + &self, + data: &types::SetupMandateRouterData, + res: Response, + ) -> CustomResult<types::SetupMandateRouterData, errors::ConnectorError> { + let response: helcim::HelcimPaymentsResponse = res + .response + .parse_struct("Helcim PaymentsAuthorizeResponse") + .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; + types::RouterData::try_from(types::ResponseRouterData { + response, + data: data.clone(), + http_code: res.status_code, + }) + } + fn get_error_response( + &self, + res: Response, + ) -> CustomResult<ErrorResponse, errors::ConnectorError> { + self.build_error_response(res) + } } impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::PaymentsResponseData> @@ -154,17 +257,26 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P fn get_url( &self, - _req: &types::PaymentsAuthorizeRouterData, - _connectors: &settings::Connectors, + req: &types::PaymentsAuthorizeRouterData, + connectors: &settings::Connectors, ) -> CustomResult<String, errors::ConnectorError> { - Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into()) + if req.request.is_auto_capture()? { + return Ok(format!("{}v2/payment/purchase", self.base_url(connectors))); + } + Ok(format!("{}v2/payment/preauth", self.base_url(connectors))) } fn get_request_body( &self, req: &types::PaymentsAuthorizeRouterData, ) -> CustomResult<Option<types::RequestBody>, errors::ConnectorError> { - let req_obj = helcim::HelcimPaymentsRequest::try_from(req)?; + let connector_router_data = helcim::HelcimRouterData::try_from(( + &self.get_currency_unit(), + req.request.currency, + req.request.amount, + req, + ))?; + let req_obj = helcim::HelcimPaymentsRequest::try_from(&connector_router_data)?; let helcim_req = types::RequestBody::log_and_get_request_body( &req_obj, utils::Encode::<helcim::HelcimPaymentsRequest>::encode_to_string_of_json, @@ -223,9 +335,17 @@ impl ConnectorIntegration<api::PSync, types::PaymentsSyncData, types::PaymentsRe fn get_headers( &self, req: &types::PaymentsSyncRouterData, - connectors: &settings::Connectors, + _connectors: &settings::Connectors, ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> { - self.build_headers(req, connectors) + let mut header = vec![( + headers::CONTENT_TYPE.to_string(), + types::PaymentsSyncType::get_content_type(self) + .to_string() + .into(), + )]; + let mut api_key = self.get_auth_header(&req.connector_auth_type)?; + header.append(&mut api_key); + Ok(header) } fn get_content_type(&self) -> &'static str { @@ -234,10 +354,19 @@ impl ConnectorIntegration<api::PSync, types::PaymentsSyncData, types::PaymentsRe fn get_url( &self, - _req: &types::PaymentsSyncRouterData, - _connectors: &settings::Connectors, + req: &types::PaymentsSyncRouterData, + connectors: &settings::Connectors, ) -> CustomResult<String, errors::ConnectorError> { - Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into()) + let connector_payment_id = req + .request + .connector_transaction_id + .get_connector_transaction_id() + .change_context(errors::ConnectorError::MissingConnectorTransactionID)?; + + Ok(format!( + "{}v2/card-transactions/{connector_payment_id}", + self.base_url(connectors) + )) } fn build_request( @@ -277,6 +406,12 @@ impl ConnectorIntegration<api::PSync, types::PaymentsSyncData, types::PaymentsRe ) -> CustomResult<ErrorResponse, errors::ConnectorError> { self.build_error_response(res) } + + // fn get_multiple_capture_sync_method( + // &self, + // ) -> CustomResult<services::CaptureSyncMethod, errors::ConnectorError> { + // Ok(services::CaptureSyncMethod::Individual) + // } } impl ConnectorIntegration<api::Capture, types::PaymentsCaptureData, types::PaymentsResponseData> @@ -297,16 +432,28 @@ impl ConnectorIntegration<api::Capture, types::PaymentsCaptureData, types::Payme fn get_url( &self, _req: &types::PaymentsCaptureRouterData, - _connectors: &settings::Connectors, + connectors: &settings::Connectors, ) -> CustomResult<String, errors::ConnectorError> { - Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into()) + Ok(format!("{}v2/payment/capture", self.base_url(connectors))) } fn get_request_body( &self, - _req: &types::PaymentsCaptureRouterData, + req: &types::PaymentsCaptureRouterData, ) -> CustomResult<Option<types::RequestBody>, errors::ConnectorError> { - Err(errors::ConnectorError::NotImplemented("get_request_body method".to_string()).into()) + let connector_router_data = helcim::HelcimRouterData::try_from(( + &self.get_currency_unit(), + req.request.currency, + req.request.amount_to_capture, + req, + ))?; + let connector_req = helcim::HelcimCaptureRequest::try_from(&connector_router_data)?; + let helcim_req = types::RequestBody::log_and_get_request_body( + &connector_req, + utils::Encode::<helcim::HelcimCaptureRequest>::encode_to_string_of_json, + ) + .change_context(errors::ConnectorError::RequestEncodingFailed)?; + Ok(Some(helcim_req)) } fn build_request( @@ -354,6 +501,78 @@ impl ConnectorIntegration<api::Capture, types::PaymentsCaptureData, types::Payme impl ConnectorIntegration<api::Void, types::PaymentsCancelData, types::PaymentsResponseData> for Helcim { + fn get_headers( + &self, + req: &types::PaymentsCancelRouterData, + connectors: &settings::Connectors, + ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> { + self.build_headers(req, connectors) + } + + fn get_content_type(&self) -> &'static str { + self.common_get_content_type() + } + + fn get_url( + &self, + _req: &types::PaymentsCancelRouterData, + connectors: &settings::Connectors, + ) -> CustomResult<String, errors::ConnectorError> { + Ok(format!("{}v2/payment/reverse", self.base_url(connectors))) + } + + fn get_request_body( + &self, + req: &types::PaymentsCancelRouterData, + ) -> CustomResult<Option<types::RequestBody>, errors::ConnectorError> { + let req_obj = helcim::HelcimVoidRequest::try_from(req)?; + let helcim_req = types::RequestBody::log_and_get_request_body( + &req_obj, + utils::Encode::<helcim::HelcimVoidRequest>::encode_to_string_of_json, + ) + .change_context(errors::ConnectorError::RequestEncodingFailed)?; + Ok(Some(helcim_req)) + } + + fn build_request( + &self, + req: &types::PaymentsCancelRouterData, + connectors: &settings::Connectors, + ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + Ok(Some( + services::RequestBuilder::new() + .method(services::Method::Post) + .url(&types::PaymentsVoidType::get_url(self, req, connectors)?) + .attach_default_headers() + .headers(types::PaymentsVoidType::get_headers(self, req, connectors)?) + .body(types::PaymentsVoidType::get_request_body(self, req)?) + .build(), + )) + } + + fn handle_response( + &self, + data: &types::PaymentsCancelRouterData, + res: Response, + ) -> CustomResult<types::PaymentsCancelRouterData, errors::ConnectorError> { + let response: helcim::HelcimPaymentsResponse = res + .response + .parse_struct("HelcimPaymentsResponse") + .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; + types::RouterData::try_from(types::ResponseRouterData { + response, + data: data.clone(), + http_code: res.status_code, + }) + .change_context(errors::ConnectorError::ResponseHandlingFailed) + } + + fn get_error_response( + &self, + res: Response, + ) -> CustomResult<ErrorResponse, errors::ConnectorError> { + self.build_error_response(res) + } } impl ConnectorIntegration<api::Execute, types::RefundsData, types::RefundsResponseData> for Helcim { @@ -372,16 +591,22 @@ impl ConnectorIntegration<api::Execute, types::RefundsData, types::RefundsRespon fn get_url( &self, _req: &types::RefundsRouterData<api::Execute>, - _connectors: &settings::Connectors, + connectors: &settings::Connectors, ) -> CustomResult<String, errors::ConnectorError> { - Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into()) + Ok(format!("{}v2/payment/refund", self.base_url(connectors))) } fn get_request_body( &self, req: &types::RefundsRouterData<api::Execute>, ) -> CustomResult<Option<types::RequestBody>, errors::ConnectorError> { - let req_obj = helcim::HelcimRefundRequest::try_from(req)?; + let connector_router_data = helcim::HelcimRouterData::try_from(( + &self.get_currency_unit(), + req.request.currency, + req.request.refund_amount, + req, + ))?; + let req_obj = helcim::HelcimRefundRequest::try_from(&connector_router_data)?; let helcim_req = types::RequestBody::log_and_get_request_body( &req_obj, utils::Encode::<helcim::HelcimRefundRequest>::encode_to_string_of_json, @@ -435,9 +660,17 @@ impl ConnectorIntegration<api::RSync, types::RefundsData, types::RefundsResponse fn get_headers( &self, req: &types::RefundSyncRouterData, - connectors: &settings::Connectors, + _connectors: &settings::Connectors, ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> { - self.build_headers(req, connectors) + let mut header = vec![( + headers::CONTENT_TYPE.to_string(), + types::RefundSyncType::get_content_type(self) + .to_string() + .into(), + )]; + let mut api_key = self.get_auth_header(&req.connector_auth_type)?; + header.append(&mut api_key); + Ok(header) } fn get_content_type(&self) -> &'static str { @@ -446,10 +679,19 @@ impl ConnectorIntegration<api::RSync, types::RefundsData, types::RefundsResponse fn get_url( &self, - _req: &types::RefundSyncRouterData, - _connectors: &settings::Connectors, + req: &types::RefundSyncRouterData, + connectors: &settings::Connectors, ) -> CustomResult<String, errors::ConnectorError> { - Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into()) + let connector_refund_id = req + .request + .connector_refund_id + .clone() + .ok_or(errors::ConnectorError::MissingConnectorRefundID)?; + + Ok(format!( + "{}v2/card-transactions/{connector_refund_id}", + self.base_url(connectors) + )) } fn build_request( diff --git a/crates/router/src/connector/helcim/transformers.rs b/crates/router/src/connector/helcim/transformers.rs index 20a8bef08a2..9510ff6e67a 100644 --- a/crates/router/src/connector/helcim/transformers.rs +++ b/crates/router/src/connector/helcim/transformers.rs @@ -1,53 +1,238 @@ +use common_utils::pii::{Email, IpAddress}; +use error_stack::{IntoReport, ResultExt}; use masking::Secret; use serde::{Deserialize, Serialize}; use crate::{ - connector::utils::PaymentsAuthorizeRequestData, + connector::utils::{ + self, AddressDetailsData, BrowserInformationData, CardData, PaymentsAuthorizeRequestData, + PaymentsCancelRequestData, PaymentsCaptureRequestData, PaymentsSetupMandateRequestData, + RefundsRequestData, RouterData, + }, core::errors, types::{self, api, storage::enums}, }; -//TODO: Fill the struct with respective fields -#[derive(Default, Debug, Serialize, Eq, PartialEq)] +#[derive(Debug, Serialize)] +pub struct HelcimRouterData<T> { + pub amount: f64, + pub router_data: T, +} + +impl<T> + TryFrom<( + &types::api::CurrencyUnit, + types::storage::enums::Currency, + i64, + T, + )> for HelcimRouterData<T> +{ + type Error = error_stack::Report<errors::ConnectorError>; + fn try_from( + (currency_unit, currency, amount, item): ( + &types::api::CurrencyUnit, + types::storage::enums::Currency, + i64, + T, + ), + ) -> Result<Self, Self::Error> { + let amount = utils::get_amount_as_f64(currency_unit, amount, currency)?; + Ok(Self { + amount, + router_data: item, + }) + } +} + +#[derive(Debug, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct HelcimVerifyRequest { + currency: enums::Currency, + ip_address: Secret<String, IpAddress>, + card_data: HelcimCard, + billing_address: HelcimBillingAddress, + #[serde(skip_serializing_if = "Option::is_none")] + ecommerce: Option<bool>, +} + +#[derive(Debug, Serialize)] +#[serde(rename_all = "camelCase")] pub struct HelcimPaymentsRequest { - amount: i64, - card: HelcimCard, + amount: f64, + currency: enums::Currency, + ip_address: Secret<String, IpAddress>, + card_data: HelcimCard, + billing_address: HelcimBillingAddress, + //The ecommerce field is an optional field in Connector Helcim. + //Setting the ecommerce field to true activates the Helcim Fraud Defender. + #[serde(skip_serializing_if = "Option::is_none")] + ecommerce: Option<bool>, } -#[derive(Default, Debug, Serialize, Eq, PartialEq)] -pub struct HelcimCard { +#[derive(Debug, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct HelcimBillingAddress { name: Secret<String>, - number: cards::CardNumber, - expiry_month: Secret<String>, - expiry_year: Secret<String>, - cvc: Secret<String>, - complete: bool, + street1: Secret<String>, + postal_code: Secret<String>, + #[serde(skip_serializing_if = "Option::is_none")] + street2: Option<Secret<String>>, + #[serde(skip_serializing_if = "Option::is_none")] + city: Option<String>, + #[serde(skip_serializing_if = "Option::is_none")] + email: Option<Email>, } -impl TryFrom<&types::PaymentsAuthorizeRouterData> for HelcimPaymentsRequest { +#[derive(Debug, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct HelcimCard { + card_number: cards::CardNumber, + card_expiry: Secret<String>, + card_c_v_v: Secret<String>, +} + +impl TryFrom<(&types::SetupMandateRouterData, &api::Card)> for HelcimVerifyRequest { type Error = error_stack::Report<errors::ConnectorError>; - fn try_from(item: &types::PaymentsAuthorizeRouterData) -> Result<Self, Self::Error> { + fn try_from(value: (&types::SetupMandateRouterData, &api::Card)) -> Result<Self, Self::Error> { + let (item, req_card) = value; + let card_data = HelcimCard { + card_expiry: req_card.get_card_expiry_month_year_2_digit_with_delimiter("".to_string()), + card_number: req_card.card_number.clone(), + card_c_v_v: req_card.card_cvc.clone(), + }; + let req_address = item.get_billing_address()?.to_owned(); + + let billing_address = HelcimBillingAddress { + name: req_address.get_full_name()?, + street1: req_address.get_line1()?.to_owned(), + postal_code: req_address.get_zip()?.to_owned(), + street2: req_address.line2, + city: req_address.city, + email: item.request.email.clone(), + }; + let ip_address = item.request.get_browser_info()?.get_ip_address()?; + + Ok(Self { + currency: item.request.currency, + ip_address, + card_data, + billing_address, + ecommerce: None, + }) + } +} + +impl TryFrom<&types::SetupMandateRouterData> for HelcimVerifyRequest { + type Error = error_stack::Report<errors::ConnectorError>; + fn try_from(item: &types::SetupMandateRouterData) -> Result<Self, Self::Error> { match item.request.payment_method_data.clone() { - api::PaymentMethodData::Card(req_card) => { - let card = HelcimCard { - name: req_card.card_holder_name, - number: req_card.card_number, - expiry_month: req_card.card_exp_month, - expiry_year: req_card.card_exp_year, - cvc: req_card.card_cvc, - complete: item.request.is_auto_capture()?, - }; - Ok(Self { - amount: item.request.amount, - card, - }) + api::PaymentMethodData::Card(req_card) => Self::try_from((item, &req_card)), + api_models::payments::PaymentMethodData::BankTransfer(_) => Err( + errors::ConnectorError::NotImplemented("Payment Method".to_string()), + ) + .into_report(), + api_models::payments::PaymentMethodData::CardRedirect(_) + | api_models::payments::PaymentMethodData::Wallet(_) + | api_models::payments::PaymentMethodData::PayLater(_) + | api_models::payments::PaymentMethodData::BankRedirect(_) + | api_models::payments::PaymentMethodData::BankDebit(_) + | api_models::payments::PaymentMethodData::Crypto(_) + | api_models::payments::PaymentMethodData::MandatePayment + | api_models::payments::PaymentMethodData::Reward + | api_models::payments::PaymentMethodData::Upi(_) + | api_models::payments::PaymentMethodData::Voucher(_) + | api_models::payments::PaymentMethodData::GiftCard(_) => { + Err(errors::ConnectorError::NotSupported { + message: format!("{:?}", item.request.payment_method_data), + connector: "Helcim", + })? + } + } + } +} + +impl + TryFrom<( + &HelcimRouterData<&types::PaymentsAuthorizeRouterData>, + &api::Card, + )> for HelcimPaymentsRequest +{ + type Error = error_stack::Report<errors::ConnectorError>; + fn try_from( + value: ( + &HelcimRouterData<&types::PaymentsAuthorizeRouterData>, + &api::Card, + ), + ) -> Result<Self, Self::Error> { + let (item, req_card) = value; + let card_data = HelcimCard { + card_expiry: req_card.get_card_expiry_month_year_2_digit_with_delimiter("".to_string()), + card_number: req_card.card_number.clone(), + card_c_v_v: req_card.card_cvc.clone(), + }; + let req_address = item + .router_data + .get_billing()? + .to_owned() + .address + .ok_or_else(utils::missing_field_err("billing.address"))?; + + let billing_address = HelcimBillingAddress { + name: req_address.get_full_name()?, + street1: req_address.get_line1()?.to_owned(), + postal_code: req_address.get_zip()?.to_owned(), + street2: req_address.line2, + city: req_address.city, + email: item.router_data.request.email.clone(), + }; + + let ip_address = item + .router_data + .request + .get_browser_info()? + .get_ip_address()?; + Ok(Self { + amount: item.amount.to_owned(), + currency: item.router_data.request.currency, + ip_address, + card_data, + billing_address, + ecommerce: None, + }) + } +} + +impl TryFrom<&HelcimRouterData<&types::PaymentsAuthorizeRouterData>> for HelcimPaymentsRequest { + type Error = error_stack::Report<errors::ConnectorError>; + fn try_from( + item: &HelcimRouterData<&types::PaymentsAuthorizeRouterData>, + ) -> Result<Self, Self::Error> { + match item.router_data.request.payment_method_data.clone() { + api::PaymentMethodData::Card(req_card) => Self::try_from((item, &req_card)), + api_models::payments::PaymentMethodData::BankTransfer(_) => Err( + errors::ConnectorError::NotImplemented("Payment Method".to_string()), + ) + .into_report(), + api_models::payments::PaymentMethodData::CardRedirect(_) + | api_models::payments::PaymentMethodData::Wallet(_) + | api_models::payments::PaymentMethodData::PayLater(_) + | api_models::payments::PaymentMethodData::BankRedirect(_) + | api_models::payments::PaymentMethodData::BankDebit(_) + | api_models::payments::PaymentMethodData::Crypto(_) + | api_models::payments::PaymentMethodData::MandatePayment + | api_models::payments::PaymentMethodData::Reward + | api_models::payments::PaymentMethodData::Upi(_) + | api_models::payments::PaymentMethodData::Voucher(_) + | api_models::payments::PaymentMethodData::GiftCard(_) => { + Err(errors::ConnectorError::NotSupported { + message: format!("{:?}", item.router_data.request.payment_method_data), + connector: "Helcim", + })? } - _ => Err(errors::ConnectorError::NotImplemented("Payment methods".to_string()).into()), } } } -//TODO: Fill the struct with respective fields // Auth Struct pub struct HelcimAuthType { pub(super) api_key: Secret<String>, @@ -65,100 +250,413 @@ impl TryFrom<&types::ConnectorAuthType> for HelcimAuthType { } } // PaymentsResponse -//TODO: Append the remaining status flags -#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq)] -#[serde(rename_all = "lowercase")] +#[derive(Debug, Deserialize)] +#[serde(rename_all = "UPPERCASE")] pub enum HelcimPaymentStatus { - Succeeded, - Failed, - #[default] - Processing, -} - -impl From<HelcimPaymentStatus> for enums::AttemptStatus { - fn from(item: HelcimPaymentStatus) -> Self { - match item { - HelcimPaymentStatus::Succeeded => Self::Charged, - HelcimPaymentStatus::Failed => Self::Failure, - HelcimPaymentStatus::Processing => Self::Authorizing, + Approved, + Declined, +} + +#[derive(Debug, Deserialize)] +#[serde(rename_all = "lowercase")] +pub enum HelcimTransactionType { + Purchase, + PreAuth, + Capture, + Verify, + Reverse, +} + +impl From<HelcimPaymentsResponse> for enums::AttemptStatus { + fn from(item: HelcimPaymentsResponse) -> Self { + match item.transaction_type { + HelcimTransactionType::Purchase | HelcimTransactionType::Verify => match item.status { + HelcimPaymentStatus::Approved => Self::Charged, + HelcimPaymentStatus::Declined => Self::Failure, + }, + HelcimTransactionType::PreAuth => match item.status { + HelcimPaymentStatus::Approved => Self::Authorized, + HelcimPaymentStatus::Declined => Self::AuthorizationFailed, + }, + HelcimTransactionType::Capture => match item.status { + HelcimPaymentStatus::Approved => Self::Charged, + HelcimPaymentStatus::Declined => Self::CaptureFailed, + }, + HelcimTransactionType::Reverse => match item.status { + HelcimPaymentStatus::Approved => Self::Voided, + HelcimPaymentStatus::Declined => Self::VoidFailed, + }, } } } -//TODO: Fill the struct with respective fields -#[derive(Default, Debug, Clone, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Deserialize)] +#[serde(rename_all = "camelCase")] pub struct HelcimPaymentsResponse { status: HelcimPaymentStatus, - id: String, + transaction_id: u64, + #[serde(rename = "type")] + transaction_type: HelcimTransactionType, } -impl<F, T> - TryFrom<types::ResponseRouterData<F, HelcimPaymentsResponse, T, types::PaymentsResponseData>> - for types::RouterData<F, T, types::PaymentsResponseData> +impl<F> + TryFrom< + types::ResponseRouterData< + F, + HelcimPaymentsResponse, + types::SetupMandateRequestData, + types::PaymentsResponseData, + >, + > for types::RouterData<F, types::SetupMandateRequestData, types::PaymentsResponseData> { type Error = error_stack::Report<errors::ConnectorError>; fn try_from( - item: types::ResponseRouterData<F, HelcimPaymentsResponse, T, types::PaymentsResponseData>, + item: types::ResponseRouterData< + F, + HelcimPaymentsResponse, + types::SetupMandateRequestData, + types::PaymentsResponseData, + >, ) -> Result<Self, Self::Error> { Ok(Self { - status: enums::AttemptStatus::from(item.response.status), response: Ok(types::PaymentsResponseData::TransactionResponse { - resource_id: types::ResponseId::ConnectorTransactionId(item.response.id), + resource_id: types::ResponseId::ConnectorTransactionId( + item.response.transaction_id.to_string(), + ), redirection_data: None, mandate_reference: None, connector_metadata: None, network_txn_id: None, connector_response_reference_id: None, }), + status: enums::AttemptStatus::from(item.response), ..item.data }) } } -//TODO: Fill the struct with respective fields -// REFUND : -// Type definition for RefundRequest -#[derive(Default, Debug, Serialize)] -pub struct HelcimRefundRequest { - pub amount: i64, +#[derive(Debug, Deserialize, Serialize)] +pub struct HelcimMetaData { + pub preauth_transaction_id: u64, } -impl<F> TryFrom<&types::RefundsRouterData<F>> for HelcimRefundRequest { +impl<F> + TryFrom< + types::ResponseRouterData< + F, + HelcimPaymentsResponse, + types::PaymentsAuthorizeData, + types::PaymentsResponseData, + >, + > for types::RouterData<F, types::PaymentsAuthorizeData, types::PaymentsResponseData> +{ type Error = error_stack::Report<errors::ConnectorError>; - fn try_from(item: &types::RefundsRouterData<F>) -> Result<Self, Self::Error> { + fn try_from( + item: types::ResponseRouterData< + F, + HelcimPaymentsResponse, + types::PaymentsAuthorizeData, + types::PaymentsResponseData, + >, + ) -> Result<Self, Self::Error> { + //PreAuth Transaction ID is stored in connector metadata + //Initially resource_id is stored as NoResponseID for manual capture + //After Capture Transaction is completed it is updated to store the Capture ID + let resource_id = if item.data.request.is_auto_capture()? { + types::ResponseId::ConnectorTransactionId(item.response.transaction_id.to_string()) + } else { + types::ResponseId::NoResponseId + }; + let connector_metadata = if !item.data.request.is_auto_capture()? { + Some(serde_json::json!(HelcimMetaData { + preauth_transaction_id: item.response.transaction_id, + })) + } else { + None + }; Ok(Self { - amount: item.request.refund_amount, + response: Ok(types::PaymentsResponseData::TransactionResponse { + resource_id, + redirection_data: None, + mandate_reference: None, + connector_metadata, + network_txn_id: None, + connector_response_reference_id: None, + }), + status: enums::AttemptStatus::from(item.response), + ..item.data }) } } -// Type definition for Refund Response +// impl utils::MultipleCaptureSyncResponse for HelcimPaymentsResponse { +// fn get_connector_capture_id(&self) -> String { +// self.transaction_id.to_string() +// } -#[allow(dead_code)] -#[derive(Debug, Serialize, Default, Deserialize, Clone)] -pub enum RefundStatus { - Succeeded, - Failed, - #[default] - Processing, -} +// fn get_capture_attempt_status(&self) -> diesel_models::enums::AttemptStatus { +// enums::AttemptStatus::from(self.to_owned()) +// } + +// fn is_capture_response(&self) -> bool { +// true +// } -impl From<RefundStatus> for enums::RefundStatus { - fn from(item: RefundStatus) -> Self { - match item { - RefundStatus::Succeeded => Self::Success, - RefundStatus::Failed => Self::Failure, - RefundStatus::Processing => Self::Pending, - //TODO: Review mapping +// fn get_amount_captured(&self) -> Option<i64> { +// Some(self.amount) +// } +// fn get_connector_reference_id(&self) -> Option<String> { +// None +// } +// } + +impl<F> + TryFrom< + types::ResponseRouterData< + F, + HelcimPaymentsResponse, + types::PaymentsSyncData, + types::PaymentsResponseData, + >, + > for types::RouterData<F, types::PaymentsSyncData, types::PaymentsResponseData> +{ + type Error = error_stack::Report<errors::ConnectorError>; + fn try_from( + item: types::ResponseRouterData< + F, + HelcimPaymentsResponse, + types::PaymentsSyncData, + types::PaymentsResponseData, + >, + ) -> Result<Self, Self::Error> { + match item.data.request.sync_type { + types::SyncRequestType::SinglePaymentSync => Ok(Self { + response: Ok(types::PaymentsResponseData::TransactionResponse { + resource_id: types::ResponseId::ConnectorTransactionId( + item.response.transaction_id.to_string(), + ), + redirection_data: None, + mandate_reference: None, + connector_metadata: None, + network_txn_id: None, + connector_response_reference_id: None, + }), + status: enums::AttemptStatus::from(item.response), + ..item.data + }), + types::SyncRequestType::MultipleCaptureSync(_) => { + Err(errors::ConnectorError::NotImplemented( + "manual multiple capture sync".to_string(), + ) + .into()) + // let capture_sync_response_list = + // utils::construct_captures_response_hashmap(vec![item.response]); + // Ok(Self { + // response: Ok(types::PaymentsResponseData::MultipleCaptureResponse { + // capture_sync_response_list, + // }), + // ..item.data + // }) + } } } } -//TODO: Fill the struct with respective fields -#[derive(Default, Debug, Clone, Serialize, Deserialize)] +#[derive(Debug, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct HelcimCaptureRequest { + pre_auth_transaction_id: u64, + amount: f64, + ip_address: Secret<String, IpAddress>, + #[serde(skip_serializing_if = "Option::is_none")] + ecommerce: Option<bool>, +} + +impl TryFrom<&HelcimRouterData<&types::PaymentsCaptureRouterData>> for HelcimCaptureRequest { + type Error = error_stack::Report<errors::ConnectorError>; + fn try_from( + item: &HelcimRouterData<&types::PaymentsCaptureRouterData>, + ) -> Result<Self, Self::Error> { + let ip_address = item + .router_data + .request + .get_browser_info()? + .get_ip_address()?; + Ok(Self { + pre_auth_transaction_id: item + .router_data + .request + .connector_transaction_id + .parse::<u64>() + .into_report() + .change_context(errors::ConnectorError::RequestEncodingFailed)?, + amount: item.amount, + ip_address, + ecommerce: None, + }) + } +} + +impl<F> + TryFrom< + types::ResponseRouterData< + F, + HelcimPaymentsResponse, + types::PaymentsCaptureData, + types::PaymentsResponseData, + >, + > for types::RouterData<F, types::PaymentsCaptureData, types::PaymentsResponseData> +{ + type Error = error_stack::Report<errors::ConnectorError>; + fn try_from( + item: types::ResponseRouterData< + F, + HelcimPaymentsResponse, + types::PaymentsCaptureData, + types::PaymentsResponseData, + >, + ) -> Result<Self, Self::Error> { + Ok(Self { + response: Ok(types::PaymentsResponseData::TransactionResponse { + resource_id: types::ResponseId::ConnectorTransactionId( + item.response.transaction_id.to_string(), + ), + redirection_data: None, + mandate_reference: None, + connector_metadata: None, + network_txn_id: None, + connector_response_reference_id: None, + }), + status: enums::AttemptStatus::from(item.response), + ..item.data + }) + } +} + +#[derive(Debug, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct HelcimVoidRequest { + card_transaction_id: u64, + ip_address: Secret<String, IpAddress>, + #[serde(skip_serializing_if = "Option::is_none")] + ecommerce: Option<bool>, +} + +impl TryFrom<&types::PaymentsCancelRouterData> for HelcimVoidRequest { + type Error = error_stack::Report<errors::ConnectorError>; + fn try_from(item: &types::PaymentsCancelRouterData) -> Result<Self, Self::Error> { + let ip_address = item.request.get_browser_info()?.get_ip_address()?; + Ok(Self { + card_transaction_id: item + .request + .connector_transaction_id + .parse::<u64>() + .into_report() + .change_context(errors::ConnectorError::RequestEncodingFailed)?, + ip_address, + ecommerce: None, + }) + } +} + +impl<F> + TryFrom< + types::ResponseRouterData< + F, + HelcimPaymentsResponse, + types::PaymentsCancelData, + types::PaymentsResponseData, + >, + > for types::RouterData<F, types::PaymentsCancelData, types::PaymentsResponseData> +{ + type Error = error_stack::Report<errors::ConnectorError>; + fn try_from( + item: types::ResponseRouterData< + F, + HelcimPaymentsResponse, + types::PaymentsCancelData, + types::PaymentsResponseData, + >, + ) -> Result<Self, Self::Error> { + Ok(Self { + response: Ok(types::PaymentsResponseData::TransactionResponse { + resource_id: types::ResponseId::ConnectorTransactionId( + item.response.transaction_id.to_string(), + ), + redirection_data: None, + mandate_reference: None, + connector_metadata: None, + network_txn_id: None, + connector_response_reference_id: None, + }), + status: enums::AttemptStatus::from(item.response), + ..item.data + }) + } +} + +// REFUND : +// Type definition for RefundRequest +#[derive(Debug, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct HelcimRefundRequest { + amount: f64, + original_transaction_id: u64, + ip_address: Secret<String, IpAddress>, + #[serde(skip_serializing_if = "Option::is_none")] + ecommerce: Option<bool>, +} + +impl<F> TryFrom<&HelcimRouterData<&types::RefundsRouterData<F>>> for HelcimRefundRequest { + type Error = error_stack::Report<errors::ConnectorError>; + fn try_from( + item: &HelcimRouterData<&types::RefundsRouterData<F>>, + ) -> Result<Self, Self::Error> { + let original_transaction_id = item + .router_data + .request + .connector_transaction_id + .parse::<u64>() + .into_report() + .change_context(errors::ConnectorError::RequestEncodingFailed)?; + + let ip_address = item + .router_data + .request + .get_browser_info()? + .get_ip_address()?; + Ok(Self { + amount: item.amount, + original_transaction_id, + ip_address, + ecommerce: None, + }) + } +} + +#[derive(Debug, Deserialize)] +#[serde(rename_all = "lowercase")] +pub enum HelcimRefundTransactionType { + Refund, +} +#[derive(Debug, Deserialize)] +#[serde(rename_all = "camelCase")] pub struct RefundResponse { - id: String, - status: RefundStatus, + status: HelcimPaymentStatus, + transaction_id: u64, + #[serde(rename = "type")] + transaction_type: HelcimRefundTransactionType, +} + +impl From<RefundResponse> for enums::RefundStatus { + fn from(item: RefundResponse) -> Self { + match item.transaction_type { + HelcimRefundTransactionType::Refund => match item.status { + HelcimPaymentStatus::Approved => Self::Success, + HelcimPaymentStatus::Declined => Self::Failure, + }, + } + } } impl TryFrom<types::RefundsResponseRouterData<api::Execute, RefundResponse>> @@ -170,8 +668,8 @@ impl TryFrom<types::RefundsResponseRouterData<api::Execute, RefundResponse>> ) -> Result<Self, Self::Error> { Ok(Self { response: Ok(types::RefundsResponseData { - connector_refund_id: item.response.id.to_string(), - refund_status: enums::RefundStatus::from(item.response.status), + connector_refund_id: item.response.transaction_id.to_string(), + refund_status: enums::RefundStatus::from(item.response), }), ..item.data }) @@ -187,19 +685,22 @@ impl TryFrom<types::RefundsResponseRouterData<api::RSync, RefundResponse>> ) -> Result<Self, Self::Error> { Ok(Self { response: Ok(types::RefundsResponseData { - connector_refund_id: item.response.id.to_string(), - refund_status: enums::RefundStatus::from(item.response.status), + connector_refund_id: item.response.transaction_id.to_string(), + refund_status: enums::RefundStatus::from(item.response), }), ..item.data }) } } -//TODO: Fill the struct with respective fields -#[derive(Default, Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, strum::Display, Deserialize)] +#[serde(untagged)] +pub enum HelcimErrorTypes { + StringType(String), + JsonType(serde_json::Value), +} + +#[derive(Debug, Deserialize)] pub struct HelcimErrorResponse { - pub status_code: u16, - pub code: String, - pub message: String, - pub reason: Option<String>, + pub errors: HelcimErrorTypes, } diff --git a/crates/router/src/connector/utils.rs b/crates/router/src/connector/utils.rs index 455646f619e..3a8cae3a631 100644 --- a/crates/router/src/connector/utils.rs +++ b/crates/router/src/connector/utils.rs @@ -248,19 +248,25 @@ impl PaymentsPreProcessingData for types::PaymentsPreProcessingData { pub trait PaymentsCaptureRequestData { fn is_multiple_capture(&self) -> bool; + fn get_browser_info(&self) -> Result<types::BrowserInformation, Error>; } impl PaymentsCaptureRequestData for types::PaymentsCaptureData { fn is_multiple_capture(&self) -> bool { self.multiple_capture_data.is_some() } + fn get_browser_info(&self) -> Result<types::BrowserInformation, Error> { + self.browser_info + .clone() + .ok_or_else(missing_field_err("browser_info")) + } } -pub trait SetupMandateRequestData { +pub trait PaymentsSetupMandateRequestData { fn get_browser_info(&self) -> Result<types::BrowserInformation, Error>; } -impl SetupMandateRequestData for types::SetupMandateRequestData { +impl PaymentsSetupMandateRequestData for types::SetupMandateRequestData { fn get_browser_info(&self) -> Result<types::BrowserInformation, Error> { self.browser_info .clone() @@ -511,6 +517,7 @@ pub trait PaymentsCancelRequestData { fn get_amount(&self) -> Result<i64, Error>; fn get_currency(&self) -> Result<diesel_models::enums::Currency, Error>; fn get_cancellation_reason(&self) -> Result<String, Error>; + fn get_browser_info(&self) -> Result<types::BrowserInformation, Error>; } impl PaymentsCancelRequestData for PaymentsCancelData { @@ -525,11 +532,17 @@ impl PaymentsCancelRequestData for PaymentsCancelData { .clone() .ok_or_else(missing_field_err("cancellation_reason")) } + fn get_browser_info(&self) -> Result<types::BrowserInformation, Error> { + self.browser_info + .clone() + .ok_or_else(missing_field_err("browser_info")) + } } pub trait RefundsRequestData { fn get_connector_refund_id(&self) -> Result<String, Error>; fn get_webhook_url(&self) -> Result<String, Error>; + fn get_browser_info(&self) -> Result<types::BrowserInformation, Error>; } impl RefundsRequestData for types::RefundsData { @@ -545,6 +558,11 @@ impl RefundsRequestData for types::RefundsData { .clone() .ok_or_else(missing_field_err("webhook_url")) } + fn get_browser_info(&self) -> Result<types::BrowserInformation, Error> { + self.browser_info + .clone() + .ok_or_else(missing_field_err("browser_info")) + } } #[derive(Clone, Debug, serde::Serialize)] diff --git a/crates/router/src/core/admin.rs b/crates/router/src/core/admin.rs index 7da0b73f74d..2fecb57323e 100644 --- a/crates/router/src/core/admin.rs +++ b/crates/router/src/core/admin.rs @@ -1365,6 +1365,10 @@ pub(crate) fn validate_auth_and_metadata_type( gocardless::transformers::GocardlessAuthType::try_from(val)?; Ok(()) } + api_enums::Connector::Helcim => { + helcim::transformers::HelcimAuthType::try_from(val)?; + Ok(()) + } api_enums::Connector::Iatapay => { iatapay::transformers::IatapayAuthType::try_from(val)?; Ok(()) diff --git a/crates/router/src/core/payments/flows.rs b/crates/router/src/core/payments/flows.rs index b54f1c6cd52..3c42049bc45 100644 --- a/crates/router/src/core/payments/flows.rs +++ b/crates/router/src/core/payments/flows.rs @@ -427,7 +427,6 @@ default_imp_for_connector_request_id!( connector::Globalpay, connector::Globepay, connector::Gocardless, - connector::Helcim, connector::Iatapay, connector::Klarna, connector::Mollie, diff --git a/crates/router/src/core/payments/transformers.rs b/crates/router/src/core/payments/transformers.rs index ac15401a334..23fbf1ea424 100644 --- a/crates/router/src/core/payments/transformers.rs +++ b/crates/router/src/core/payments/transformers.rs @@ -9,7 +9,7 @@ use router_env::{instrument, tracing}; use super::{flows::Feature, PaymentData}; use crate::{ configs::settings::{ConnectorRequestReferenceIdConfig, Server}, - connector::Nexinets, + connector::{Helcim, Nexinets}, core::{ errors::{self, RouterResponse, RouterResult}, payments::{self, helpers}, @@ -1059,6 +1059,21 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsSyncData } } +impl api::ConnectorTransactionId for Helcim { + fn connector_transaction_id( + &self, + payment_attempt: storage::PaymentAttempt, + ) -> Result<Option<String>, errors::ApiErrorResponse> { + if payment_attempt.connector_transaction_id.is_none() { + let metadata = + Self::connector_transaction_id(self, &payment_attempt.connector_metadata); + metadata.map_err(|_| errors::ApiErrorResponse::ResourceIdNotFound) + } else { + Ok(payment_attempt.connector_transaction_id) + } + } +} + impl api::ConnectorTransactionId for Nexinets { fn connector_transaction_id( &self, @@ -1083,6 +1098,16 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsCaptureD .payment_attempt .amount_to_capture .map_or(payment_data.amount.into(), |capture_amount| capture_amount); + let browser_info: Option<types::BrowserInformation> = payment_data + .payment_attempt + .browser_info + .clone() + .map(|b| b.parse_value("BrowserInformation")) + .transpose() + .change_context(errors::ApiErrorResponse::InvalidDataValue { + field_name: "browser_info", + })?; + Ok(Self { amount_to_capture, currency: payment_data.currency, @@ -1102,6 +1127,7 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsCaptureD }), None => None, }, + browser_info, }) } } @@ -1116,6 +1142,15 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsCancelDa &additional_data.connector_name, api::GetToken::Connector, )?; + let browser_info: Option<types::BrowserInformation> = payment_data + .payment_attempt + .browser_info + .clone() + .map(|b| b.parse_value("BrowserInformation")) + .transpose() + .change_context(errors::ApiErrorResponse::InvalidDataValue { + field_name: "browser_info", + })?; Ok(Self { amount: Some(payment_data.amount.into()), currency: Some(payment_data.currency), @@ -1125,6 +1160,7 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsCancelDa .ok_or(errors::ApiErrorResponse::ResourceIdNotFound)?, cancellation_reason: payment_data.payment_attempt.cancellation_reason, connector_meta: payment_data.payment_attempt.connector_metadata, + browser_info, }) } } diff --git a/crates/router/src/core/utils.rs b/crates/router/src/core/utils.rs index 7790e2ac5b7..beedfb98bc2 100644 --- a/crates/router/src/core/utils.rs +++ b/crates/router/src/core/utils.rs @@ -269,6 +269,15 @@ pub async fn construct_refund_router_data<'a, F>( None }; + let browser_info: Option<types::BrowserInformation> = payment_attempt + .browser_info + .clone() + .map(|b| b.parse_value("BrowserInformation")) + .transpose() + .change_context(errors::ApiErrorResponse::InvalidDataValue { + field_name: "browser_info", + })?; + let router_data = types::RouterData { flow: PhantomData, merchant_id: merchant_account.merchant_id.clone(), @@ -297,6 +306,7 @@ pub async fn construct_refund_router_data<'a, F>( connector_metadata: payment_attempt.connector_metadata.clone(), reason: refund.refund_reason.clone(), connector_refund_id: refund.connector_refund_id.clone(), + browser_info, }, response: Ok(types::RefundsResponseData { diff --git a/crates/router/src/lib.rs b/crates/router/src/lib.rs index 008991bb45b..5a9e2460326 100644 --- a/crates/router/src/lib.rs +++ b/crates/router/src/lib.rs @@ -47,9 +47,11 @@ pub mod headers { pub const API_KEY: &str = "API-KEY"; pub const APIKEY: &str = "apikey"; pub const X_CC_API_KEY: &str = "X-CC-Api-Key"; + pub const API_TOKEN: &str = "Api-Token"; pub const AUTHORIZATION: &str = "Authorization"; pub const CONTENT_TYPE: &str = "Content-Type"; pub const DATE: &str = "Date"; + pub const IDEMPOTENCY_KEY: &str = "Idempotency-Key"; pub const NONCE: &str = "nonce"; pub const TIMESTAMP: &str = "Timestamp"; pub const TOKEN: &str = "token"; diff --git a/crates/router/src/types.rs b/crates/router/src/types.rs index 48e3697c6ba..298b83faf16 100644 --- a/crates/router/src/types.rs +++ b/crates/router/src/types.rs @@ -390,6 +390,7 @@ pub struct PaymentsCaptureData { pub payment_amount: i64, pub multiple_capture_data: Option<MultipleCaptureRequestData>, pub connector_meta: Option<serde_json::Value>, + pub browser_info: Option<BrowserInformation>, } #[allow(dead_code)] @@ -492,6 +493,7 @@ pub struct PaymentsCancelData { pub connector_transaction_id: String, pub cancellation_reason: Option<String>, pub connector_meta: Option<serde_json::Value>, + pub browser_info: Option<BrowserInformation>, } #[derive(Debug, Default, Clone)] @@ -711,6 +713,7 @@ pub struct RefundsData { pub refund_amount: i64, /// Arbitrary metadata required for refund pub connector_metadata: Option<serde_json::Value>, + pub browser_info: Option<BrowserInformation>, } #[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] diff --git a/crates/router/src/types/api.rs b/crates/router/src/types/api.rs index 6c1790d8484..e56285d05dd 100644 --- a/crates/router/src/types/api.rs +++ b/crates/router/src/types/api.rs @@ -330,7 +330,7 @@ impl ConnectorData { enums::Connector::Globalpay => Ok(Box::new(&connector::Globalpay)), enums::Connector::Globepay => Ok(Box::new(&connector::Globepay)), enums::Connector::Gocardless => Ok(Box::new(&connector::Gocardless)), - //enums::Connector::Helcim => Ok(Box::new(&connector::Helcim)), , it is added as template code for future usage + enums::Connector::Helcim => Ok(Box::new(&connector::Helcim)), enums::Connector::Iatapay => Ok(Box::new(&connector::Iatapay)), enums::Connector::Klarna => Ok(Box::new(&connector::Klarna)), enums::Connector::Mollie => Ok(Box::new(&connector::Mollie)), diff --git a/crates/router/tests/connectors/aci.rs b/crates/router/tests/connectors/aci.rs index cba0640e79a..4fe36f36871 100644 --- a/crates/router/tests/connectors/aci.rs +++ b/crates/router/tests/connectors/aci.rs @@ -126,6 +126,7 @@ fn construct_refund_router_data<F>() -> types::RefundsRouterData<F> { connector_metadata: None, reason: None, connector_refund_id: None, + browser_info: None, }, payment_method_id: None, response: Err(types::ErrorResponse::default()), diff --git a/crates/router/tests/connectors/utils.rs b/crates/router/tests/connectors/utils.rs index 7d600d98d3e..1cb3b48f72d 100644 --- a/crates/router/tests/connectors/utils.rs +++ b/crates/router/tests/connectors/utils.rs @@ -388,6 +388,7 @@ pub trait ConnectorActions: Connector { connector_metadata: None, reason: None, connector_refund_id: Some(refund_id), + browser_info: None, }), payment_info, ); @@ -955,6 +956,7 @@ impl Default for PaymentRefundType { connector_metadata: None, reason: Some("Customer returned product".to_string()), connector_refund_id: None, + browser_info: None, }; Self(data) } diff --git a/openapi/openapi_spec.json b/openapi/openapi_spec.json index 3f1f1680337..d46f55efb0f 100644 --- a/openapi/openapi_spec.json +++ b/openapi/openapi_spec.json @@ -3940,6 +3940,7 @@ "globalpay", "globepay", "gocardless", + "helcim", "iatapay", "klarna", "mollie",
feat
[HELCIM] Implement Cards for Helcim (#2210)
80b74e096d56e08685ad52fb3049f6b611d587b3
2023-08-03 17:51:44
DEEPANSHU BANSAL
feat(connector): [Square] Add template code for connector Square (#1834)
false
diff --git a/config/config.example.toml b/config/config.example.toml index 14a306f1bb5..7f3177d0aa7 100644 --- a/config/config.example.toml +++ b/config/config.example.toml @@ -188,6 +188,7 @@ payu.base_url = "https://secure.snd.payu.com/" powertranz.base_url = "https://staging.ptranz.com/api/" rapyd.base_url = "https://sandboxapi.rapyd.net" shift4.base_url = "https://api.shift4.com/" +square.base_url = "https://connect.squareupsandbox.com/" stax.base_url = "https://apiprod.fattlabs.com/" stripe.base_url = "https://api.stripe.com/" stripe.base_url_file_upload = "https://files.stripe.com/" @@ -237,6 +238,7 @@ cards = [ "mollie", "paypal", "shift4", + "square", "stax", "stripe", "worldpay", diff --git a/config/development.toml b/config/development.toml index 457627e067d..0f556650131 100644 --- a/config/development.toml +++ b/config/development.toml @@ -94,6 +94,7 @@ cards = [ "payu", "powertranz", "shift4", + "square", "stax", "stripe", "trustpay", @@ -158,6 +159,7 @@ payu.base_url = "https://secure.snd.payu.com/" powertranz.base_url = "https://staging.ptranz.com/api/" rapyd.base_url = "https://sandboxapi.rapyd.net" shift4.base_url = "https://api.shift4.com/" +square.base_url = "https://connect.squareupsandbox.com/" stax.base_url = "https://apiprod.fattlabs.com/" stripe.base_url = "https://api.stripe.com/" stripe.base_url_file_upload = "https://files.stripe.com/" diff --git a/config/docker_compose.toml b/config/docker_compose.toml index 97cbf896391..9e6dc440aa7 100644 --- a/config/docker_compose.toml +++ b/config/docker_compose.toml @@ -111,6 +111,7 @@ payu.base_url = "https://secure.snd.payu.com/" powertranz.base_url = "https://staging.ptranz.com/api/" rapyd.base_url = "https://sandboxapi.rapyd.net" shift4.base_url = "https://api.shift4.com/" +square.base_url = "https://connect.squareupsandbox.com/" stax.base_url = "https://apiprod.fattlabs.com/" stripe.base_url = "https://api.stripe.com/" stripe.base_url_file_upload = "https://files.stripe.com/" @@ -165,6 +166,7 @@ cards = [ "payu", "powertranz", "shift4", + "square", "stax", "stripe", "trustpay", diff --git a/crates/api_models/src/enums.rs b/crates/api_models/src/enums.rs index 53303a2230b..d3d83d18bf1 100644 --- a/crates/api_models/src/enums.rs +++ b/crates/api_models/src/enums.rs @@ -107,6 +107,7 @@ pub enum Connector { Powertranz, Rapyd, Shift4, + // Square, added as template code for future usage, Stax, Stripe, Trustpay, @@ -156,7 +157,6 @@ impl Connector { #[serde(rename_all = "snake_case")] #[strum(serialize_all = "snake_case")] pub enum RoutableConnectors { - Stax, #[cfg(feature = "dummy_connector")] #[serde(rename = "phonypay")] #[strum(serialize = "phonypay")] @@ -221,6 +221,8 @@ pub enum RoutableConnectors { Powertranz, Rapyd, Shift4, + //Square, added as template code for future usage + Stax, Stripe, Trustpay, // Tsys, diff --git a/crates/router/src/configs/settings.rs b/crates/router/src/configs/settings.rs index 32d126b514f..57766ff10f5 100644 --- a/crates/router/src/configs/settings.rs +++ b/crates/router/src/configs/settings.rs @@ -477,6 +477,7 @@ pub struct Connectors { pub powertranz: ConnectorParams, pub rapyd: ConnectorParams, pub shift4: ConnectorParams, + pub square: ConnectorParams, pub stax: ConnectorParams, pub stripe: ConnectorParamsWithFileUploadUrl, pub trustpay: ConnectorParamsWithMoreUrls, diff --git a/crates/router/src/connector.rs b/crates/router/src/connector.rs index 5c8179a71df..e6fd352f375 100644 --- a/crates/router/src/connector.rs +++ b/crates/router/src/connector.rs @@ -36,6 +36,7 @@ pub mod payu; pub mod powertranz; pub mod rapyd; pub mod shift4; +pub mod square; pub mod stax; pub mod stripe; pub mod trustpay; @@ -56,6 +57,7 @@ pub use self::{ globepay::Globepay, iatapay::Iatapay, klarna::Klarna, mollie::Mollie, multisafepay::Multisafepay, nexinets::Nexinets, nmi::Nmi, noon::Noon, nuvei::Nuvei, opayo::Opayo, opennode::Opennode, payeezy::Payeezy, payme::Payme, paypal::Paypal, payu::Payu, - powertranz::Powertranz, rapyd::Rapyd, shift4::Shift4, stax::Stax, stripe::Stripe, - trustpay::Trustpay, tsys::Tsys, wise::Wise, worldline::Worldline, worldpay::Worldpay, zen::Zen, + powertranz::Powertranz, rapyd::Rapyd, shift4::Shift4, square::Square, stax::Stax, + stripe::Stripe, trustpay::Trustpay, tsys::Tsys, wise::Wise, worldline::Worldline, + worldpay::Worldpay, zen::Zen, }; diff --git a/crates/router/src/connector/square.rs b/crates/router/src/connector/square.rs new file mode 100644 index 00000000000..0bc41decc0b --- /dev/null +++ b/crates/router/src/connector/square.rs @@ -0,0 +1,517 @@ +mod transformers; + +use std::fmt::Debug; + +use error_stack::{IntoReport, ResultExt}; +use masking::ExposeInterface; +use transformers as square; + +use crate::{ + configs::settings, + core::errors::{self, CustomResult}, + headers, + services::{ + self, + request::{self, Mask}, + ConnectorIntegration, + }, + types::{ + self, + api::{self, ConnectorCommon, ConnectorCommonExt}, + ErrorResponse, Response, + }, + utils::{self, BytesExt}, +}; + +#[derive(Debug, Clone)] +pub struct Square; + +impl api::Payment for Square {} +impl api::PaymentSession for Square {} +impl api::ConnectorAccessToken for Square {} +impl api::PreVerify for Square {} +impl api::PaymentAuthorize for Square {} +impl api::PaymentSync for Square {} +impl api::PaymentCapture for Square {} +impl api::PaymentVoid for Square {} +impl api::Refund for Square {} +impl api::RefundExecute for Square {} +impl api::RefundSync for Square {} +impl api::PaymentToken for Square {} + +impl + ConnectorIntegration< + api::PaymentMethodToken, + types::PaymentMethodTokenizationData, + types::PaymentsResponseData, + > for Square +{ + // Not Implemented (R) +} + +impl<Flow, Request, Response> ConnectorCommonExt<Flow, Request, Response> for Square +where + Self: ConnectorIntegration<Flow, Request, Response>, +{ + fn build_headers( + &self, + req: &types::RouterData<Flow, Request, Response>, + _connectors: &settings::Connectors, + ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> { + let mut header = vec![( + headers::CONTENT_TYPE.to_string(), + types::PaymentsAuthorizeType::get_content_type(self) + .to_string() + .into(), + )]; + let mut api_key = self.get_auth_header(&req.connector_auth_type)?; + header.append(&mut api_key); + Ok(header) + } +} + +impl ConnectorCommon for Square { + fn id(&self) -> &'static str { + "square" + } + + fn common_get_content_type(&self) -> &'static str { + "application/json" + } + + fn base_url<'a>(&self, connectors: &'a settings::Connectors) -> &'a str { + connectors.square.base_url.as_ref() + } + + fn validate_auth_type( + &self, + val: &types::ConnectorAuthType, + ) -> Result<(), error_stack::Report<errors::ConnectorError>> { + square::SquareAuthType::try_from(val)?; + Ok(()) + } + + fn get_auth_header( + &self, + auth_type: &types::ConnectorAuthType, + ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> { + let auth = square::SquareAuthType::try_from(auth_type) + .change_context(errors::ConnectorError::FailedToObtainAuthType)?; + Ok(vec![( + headers::AUTHORIZATION.to_string(), + auth.api_key.expose().into_masked(), + )]) + } + + fn build_error_response( + &self, + res: Response, + ) -> CustomResult<ErrorResponse, errors::ConnectorError> { + let response: square::SquareErrorResponse = res + .response + .parse_struct("SquareErrorResponse") + .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; + + Ok(ErrorResponse { + status_code: res.status_code, + code: response.code, + message: response.message, + reason: response.reason, + }) + } +} + +impl ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData> + for Square +{ + //TODO: implement sessions flow +} + +impl ConnectorIntegration<api::AccessTokenAuth, types::AccessTokenRequestData, types::AccessToken> + for Square +{ +} + +impl ConnectorIntegration<api::Verify, types::VerifyRequestData, types::PaymentsResponseData> + for Square +{ +} + +impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::PaymentsResponseData> + for Square +{ + fn get_headers( + &self, + req: &types::PaymentsAuthorizeRouterData, + connectors: &settings::Connectors, + ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> { + self.build_headers(req, connectors) + } + + fn get_content_type(&self) -> &'static str { + self.common_get_content_type() + } + + fn get_url( + &self, + _req: &types::PaymentsAuthorizeRouterData, + _connectors: &settings::Connectors, + ) -> CustomResult<String, errors::ConnectorError> { + Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into()) + } + + fn get_request_body( + &self, + req: &types::PaymentsAuthorizeRouterData, + ) -> CustomResult<Option<types::RequestBody>, errors::ConnectorError> { + let req_obj = square::SquarePaymentsRequest::try_from(req)?; + let square_req = types::RequestBody::log_and_get_request_body( + &req_obj, + utils::Encode::<square::SquarePaymentsRequest>::encode_to_string_of_json, + ) + .change_context(errors::ConnectorError::RequestEncodingFailed)?; + Ok(Some(square_req)) + } + + fn build_request( + &self, + req: &types::PaymentsAuthorizeRouterData, + connectors: &settings::Connectors, + ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + Ok(Some( + services::RequestBuilder::new() + .method(services::Method::Post) + .url(&types::PaymentsAuthorizeType::get_url( + self, req, connectors, + )?) + .attach_default_headers() + .headers(types::PaymentsAuthorizeType::get_headers( + self, req, connectors, + )?) + .body(types::PaymentsAuthorizeType::get_request_body(self, req)?) + .build(), + )) + } + + fn handle_response( + &self, + data: &types::PaymentsAuthorizeRouterData, + res: Response, + ) -> CustomResult<types::PaymentsAuthorizeRouterData, errors::ConnectorError> { + let response: square::SquarePaymentsResponse = res + .response + .parse_struct("Square PaymentsAuthorizeResponse") + .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; + types::RouterData::try_from(types::ResponseRouterData { + response, + data: data.clone(), + http_code: res.status_code, + }) + } + + fn get_error_response( + &self, + res: Response, + ) -> CustomResult<ErrorResponse, errors::ConnectorError> { + self.build_error_response(res) + } +} + +impl ConnectorIntegration<api::PSync, types::PaymentsSyncData, types::PaymentsResponseData> + for Square +{ + fn get_headers( + &self, + req: &types::PaymentsSyncRouterData, + connectors: &settings::Connectors, + ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> { + self.build_headers(req, connectors) + } + + fn get_content_type(&self) -> &'static str { + self.common_get_content_type() + } + + fn get_url( + &self, + _req: &types::PaymentsSyncRouterData, + _connectors: &settings::Connectors, + ) -> CustomResult<String, errors::ConnectorError> { + Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into()) + } + + fn build_request( + &self, + req: &types::PaymentsSyncRouterData, + connectors: &settings::Connectors, + ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + Ok(Some( + services::RequestBuilder::new() + .method(services::Method::Get) + .url(&types::PaymentsSyncType::get_url(self, req, connectors)?) + .attach_default_headers() + .headers(types::PaymentsSyncType::get_headers(self, req, connectors)?) + .build(), + )) + } + + fn handle_response( + &self, + data: &types::PaymentsSyncRouterData, + res: Response, + ) -> CustomResult<types::PaymentsSyncRouterData, errors::ConnectorError> { + let response: square::SquarePaymentsResponse = res + .response + .parse_struct("square PaymentsSyncResponse") + .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; + types::RouterData::try_from(types::ResponseRouterData { + response, + data: data.clone(), + http_code: res.status_code, + }) + } + + fn get_error_response( + &self, + res: Response, + ) -> CustomResult<ErrorResponse, errors::ConnectorError> { + self.build_error_response(res) + } +} + +impl ConnectorIntegration<api::Capture, types::PaymentsCaptureData, types::PaymentsResponseData> + for Square +{ + fn get_headers( + &self, + req: &types::PaymentsCaptureRouterData, + connectors: &settings::Connectors, + ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> { + self.build_headers(req, connectors) + } + + fn get_content_type(&self) -> &'static str { + self.common_get_content_type() + } + + fn get_url( + &self, + _req: &types::PaymentsCaptureRouterData, + _connectors: &settings::Connectors, + ) -> CustomResult<String, errors::ConnectorError> { + Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into()) + } + + fn get_request_body( + &self, + _req: &types::PaymentsCaptureRouterData, + ) -> CustomResult<Option<types::RequestBody>, errors::ConnectorError> { + Err(errors::ConnectorError::NotImplemented("get_request_body method".to_string()).into()) + } + + fn build_request( + &self, + req: &types::PaymentsCaptureRouterData, + connectors: &settings::Connectors, + ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + Ok(Some( + services::RequestBuilder::new() + .method(services::Method::Post) + .url(&types::PaymentsCaptureType::get_url(self, req, connectors)?) + .attach_default_headers() + .headers(types::PaymentsCaptureType::get_headers( + self, req, connectors, + )?) + .body(types::PaymentsCaptureType::get_request_body(self, req)?) + .build(), + )) + } + + fn handle_response( + &self, + data: &types::PaymentsCaptureRouterData, + res: Response, + ) -> CustomResult<types::PaymentsCaptureRouterData, errors::ConnectorError> { + let response: square::SquarePaymentsResponse = res + .response + .parse_struct("Square PaymentsCaptureResponse") + .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; + types::RouterData::try_from(types::ResponseRouterData { + response, + data: data.clone(), + http_code: res.status_code, + }) + } + + fn get_error_response( + &self, + res: Response, + ) -> CustomResult<ErrorResponse, errors::ConnectorError> { + self.build_error_response(res) + } +} + +impl ConnectorIntegration<api::Void, types::PaymentsCancelData, types::PaymentsResponseData> + for Square +{ +} + +impl ConnectorIntegration<api::Execute, types::RefundsData, types::RefundsResponseData> for Square { + fn get_headers( + &self, + req: &types::RefundsRouterData<api::Execute>, + connectors: &settings::Connectors, + ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> { + self.build_headers(req, connectors) + } + + fn get_content_type(&self) -> &'static str { + self.common_get_content_type() + } + + fn get_url( + &self, + _req: &types::RefundsRouterData<api::Execute>, + _connectors: &settings::Connectors, + ) -> CustomResult<String, errors::ConnectorError> { + Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into()) + } + + fn get_request_body( + &self, + req: &types::RefundsRouterData<api::Execute>, + ) -> CustomResult<Option<types::RequestBody>, errors::ConnectorError> { + let req_obj = square::SquareRefundRequest::try_from(req)?; + let square_req = types::RequestBody::log_and_get_request_body( + &req_obj, + utils::Encode::<square::SquareRefundRequest>::encode_to_string_of_json, + ) + .change_context(errors::ConnectorError::RequestEncodingFailed)?; + Ok(Some(square_req)) + } + + fn build_request( + &self, + req: &types::RefundsRouterData<api::Execute>, + connectors: &settings::Connectors, + ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + let request = services::RequestBuilder::new() + .method(services::Method::Post) + .url(&types::RefundExecuteType::get_url(self, req, connectors)?) + .attach_default_headers() + .headers(types::RefundExecuteType::get_headers( + self, req, connectors, + )?) + .body(types::RefundExecuteType::get_request_body(self, req)?) + .build(); + Ok(Some(request)) + } + + fn handle_response( + &self, + data: &types::RefundsRouterData<api::Execute>, + res: Response, + ) -> CustomResult<types::RefundsRouterData<api::Execute>, errors::ConnectorError> { + let response: square::RefundResponse = + res.response + .parse_struct("square RefundResponse") + .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; + types::RouterData::try_from(types::ResponseRouterData { + response, + data: data.clone(), + http_code: res.status_code, + }) + } + + fn get_error_response( + &self, + res: Response, + ) -> CustomResult<ErrorResponse, errors::ConnectorError> { + self.build_error_response(res) + } +} + +impl ConnectorIntegration<api::RSync, types::RefundsData, types::RefundsResponseData> for Square { + fn get_headers( + &self, + req: &types::RefundSyncRouterData, + connectors: &settings::Connectors, + ) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> { + self.build_headers(req, connectors) + } + + fn get_content_type(&self) -> &'static str { + self.common_get_content_type() + } + + fn get_url( + &self, + _req: &types::RefundSyncRouterData, + _connectors: &settings::Connectors, + ) -> CustomResult<String, errors::ConnectorError> { + Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into()) + } + + fn build_request( + &self, + req: &types::RefundSyncRouterData, + connectors: &settings::Connectors, + ) -> CustomResult<Option<services::Request>, errors::ConnectorError> { + Ok(Some( + services::RequestBuilder::new() + .method(services::Method::Get) + .url(&types::RefundSyncType::get_url(self, req, connectors)?) + .attach_default_headers() + .headers(types::RefundSyncType::get_headers(self, req, connectors)?) + .body(types::RefundSyncType::get_request_body(self, req)?) + .build(), + )) + } + + fn handle_response( + &self, + data: &types::RefundSyncRouterData, + res: Response, + ) -> CustomResult<types::RefundSyncRouterData, errors::ConnectorError> { + let response: square::RefundResponse = res + .response + .parse_struct("square RefundSyncResponse") + .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; + types::RouterData::try_from(types::ResponseRouterData { + response, + data: data.clone(), + http_code: res.status_code, + }) + } + + fn get_error_response( + &self, + res: Response, + ) -> CustomResult<ErrorResponse, errors::ConnectorError> { + self.build_error_response(res) + } +} + +#[async_trait::async_trait] +impl api::IncomingWebhook for Square { + fn get_webhook_object_reference_id( + &self, + _request: &api::IncomingWebhookRequestDetails<'_>, + ) -> CustomResult<api::webhooks::ObjectReferenceId, errors::ConnectorError> { + Err(errors::ConnectorError::WebhooksNotImplemented).into_report() + } + + fn get_webhook_event_type( + &self, + _request: &api::IncomingWebhookRequestDetails<'_>, + ) -> CustomResult<api::IncomingWebhookEvent, errors::ConnectorError> { + Err(errors::ConnectorError::WebhooksNotImplemented).into_report() + } + + fn get_webhook_resource_object( + &self, + _request: &api::IncomingWebhookRequestDetails<'_>, + ) -> CustomResult<serde_json::Value, errors::ConnectorError> { + Err(errors::ConnectorError::WebhooksNotImplemented).into_report() + } +} diff --git a/crates/router/src/connector/square/transformers.rs b/crates/router/src/connector/square/transformers.rs new file mode 100644 index 00000000000..d2fa508f6f1 --- /dev/null +++ b/crates/router/src/connector/square/transformers.rs @@ -0,0 +1,205 @@ +use masking::Secret; +use serde::{Deserialize, Serialize}; + +use crate::{ + connector::utils::PaymentsAuthorizeRequestData, + core::errors, + types::{self, api, storage::enums}, +}; + +//TODO: Fill the struct with respective fields +#[derive(Default, Debug, Serialize, Eq, PartialEq)] +pub struct SquarePaymentsRequest { + amount: i64, + card: SquareCard, +} + +#[derive(Default, Debug, Serialize, Eq, PartialEq)] +pub struct SquareCard { + name: Secret<String>, + number: cards::CardNumber, + expiry_month: Secret<String>, + expiry_year: Secret<String>, + cvc: Secret<String>, + complete: bool, +} + +impl TryFrom<&types::PaymentsAuthorizeRouterData> for SquarePaymentsRequest { + type Error = error_stack::Report<errors::ConnectorError>; + fn try_from(item: &types::PaymentsAuthorizeRouterData) -> Result<Self, Self::Error> { + match item.request.payment_method_data.clone() { + api::PaymentMethodData::Card(req_card) => { + let card = SquareCard { + name: req_card.card_holder_name, + number: req_card.card_number, + expiry_month: req_card.card_exp_month, + expiry_year: req_card.card_exp_year, + cvc: req_card.card_cvc, + complete: item.request.is_auto_capture()?, + }; + Ok(Self { + amount: item.request.amount, + card, + }) + } + _ => Err(errors::ConnectorError::NotImplemented("Payment methods".to_string()).into()), + } + } +} + +//TODO: Fill the struct with respective fields +// Auth Struct +pub struct SquareAuthType { + pub(super) api_key: Secret<String>, +} + +impl TryFrom<&types::ConnectorAuthType> for SquareAuthType { + type Error = error_stack::Report<errors::ConnectorError>; + fn try_from(auth_type: &types::ConnectorAuthType) -> Result<Self, Self::Error> { + match auth_type { + types::ConnectorAuthType::HeaderKey { api_key } => Ok(Self { + api_key: api_key.to_owned(), + }), + _ => Err(errors::ConnectorError::FailedToObtainAuthType.into()), + } + } +} +// PaymentsResponse +//TODO: Append the remaining status flags +#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq)] +#[serde(rename_all = "lowercase")] +pub enum SquarePaymentStatus { + Succeeded, + Failed, + #[default] + Processing, +} + +impl From<SquarePaymentStatus> for enums::AttemptStatus { + fn from(item: SquarePaymentStatus) -> Self { + match item { + SquarePaymentStatus::Succeeded => Self::Charged, + SquarePaymentStatus::Failed => Self::Failure, + SquarePaymentStatus::Processing => Self::Authorizing, + } + } +} + +//TODO: Fill the struct with respective fields +#[derive(Default, Debug, Clone, Serialize, Deserialize, PartialEq)] +pub struct SquarePaymentsResponse { + status: SquarePaymentStatus, + id: String, +} + +impl<F, T> + TryFrom<types::ResponseRouterData<F, SquarePaymentsResponse, T, types::PaymentsResponseData>> + for types::RouterData<F, T, types::PaymentsResponseData> +{ + type Error = error_stack::Report<errors::ConnectorError>; + fn try_from( + item: types::ResponseRouterData<F, SquarePaymentsResponse, T, types::PaymentsResponseData>, + ) -> Result<Self, Self::Error> { + Ok(Self { + status: enums::AttemptStatus::from(item.response.status), + response: Ok(types::PaymentsResponseData::TransactionResponse { + resource_id: types::ResponseId::ConnectorTransactionId(item.response.id), + redirection_data: None, + mandate_reference: None, + connector_metadata: None, + network_txn_id: None, + connector_response_reference_id: None, + }), + ..item.data + }) + } +} + +//TODO: Fill the struct with respective fields +// REFUND : +// Type definition for RefundRequest +#[derive(Default, Debug, Serialize)] +pub struct SquareRefundRequest { + pub amount: i64, +} + +impl<F> TryFrom<&types::RefundsRouterData<F>> for SquareRefundRequest { + type Error = error_stack::Report<errors::ConnectorError>; + fn try_from(item: &types::RefundsRouterData<F>) -> Result<Self, Self::Error> { + Ok(Self { + amount: item.request.refund_amount, + }) + } +} + +// Type definition for Refund Response + +#[allow(dead_code)] +#[derive(Debug, Serialize, Default, Deserialize, Clone)] +pub enum RefundStatus { + Succeeded, + Failed, + #[default] + Processing, +} + +impl From<RefundStatus> for enums::RefundStatus { + fn from(item: RefundStatus) -> Self { + match item { + RefundStatus::Succeeded => Self::Success, + RefundStatus::Failed => Self::Failure, + RefundStatus::Processing => Self::Pending, + //TODO: Review mapping + } + } +} + +//TODO: Fill the struct with respective fields +#[derive(Default, Debug, Clone, Serialize, Deserialize)] +pub struct RefundResponse { + id: String, + status: RefundStatus, +} + +impl TryFrom<types::RefundsResponseRouterData<api::Execute, RefundResponse>> + for types::RefundsRouterData<api::Execute> +{ + type Error = error_stack::Report<errors::ConnectorError>; + fn try_from( + item: types::RefundsResponseRouterData<api::Execute, RefundResponse>, + ) -> Result<Self, Self::Error> { + Ok(Self { + response: Ok(types::RefundsResponseData { + connector_refund_id: item.response.id.to_string(), + refund_status: enums::RefundStatus::from(item.response.status), + }), + ..item.data + }) + } +} + +impl TryFrom<types::RefundsResponseRouterData<api::RSync, RefundResponse>> + for types::RefundsRouterData<api::RSync> +{ + type Error = error_stack::Report<errors::ConnectorError>; + fn try_from( + item: types::RefundsResponseRouterData<api::RSync, RefundResponse>, + ) -> Result<Self, Self::Error> { + Ok(Self { + response: Ok(types::RefundsResponseData { + connector_refund_id: item.response.id.to_string(), + refund_status: enums::RefundStatus::from(item.response.status), + }), + ..item.data + }) + } +} + +//TODO: Fill the struct with respective fields +#[derive(Default, Debug, Serialize, Deserialize, PartialEq)] +pub struct SquareErrorResponse { + pub status_code: u16, + pub code: String, + pub message: String, + pub reason: Option<String>, +} diff --git a/crates/router/src/core/payments/flows.rs b/crates/router/src/core/payments/flows.rs index feaba9a708f..51992b9f7af 100644 --- a/crates/router/src/core/payments/flows.rs +++ b/crates/router/src/core/payments/flows.rs @@ -163,6 +163,7 @@ default_imp_for_complete_authorize!( connector::Payme, connector::Payu, connector::Rapyd, + connector::Square, connector::Stax, connector::Stripe, connector::Trustpay, @@ -236,6 +237,7 @@ default_imp_for_create_customer!( connector::Powertranz, connector::Rapyd, connector::Shift4, + connector::Square, connector::Trustpay, connector::Tsys, connector::Wise, @@ -300,6 +302,7 @@ default_imp_for_connector_redirect_response!( connector::Powertranz, connector::Rapyd, connector::Shift4, + connector::Square, connector::Stax, connector::Tsys, connector::Wise, @@ -353,6 +356,7 @@ default_imp_for_connector_request_id!( connector::Powertranz, connector::Rapyd, connector::Shift4, + connector::Square, connector::Stax, connector::Stripe, connector::Trustpay, @@ -428,6 +432,7 @@ default_imp_for_accept_dispute!( connector::Powertranz, connector::Rapyd, connector::Shift4, + connector::Square, connector::Stax, connector::Stripe, connector::Trustpay, @@ -523,6 +528,7 @@ default_imp_for_file_upload!( connector::Powertranz, connector::Rapyd, connector::Shift4, + connector::Square, connector::Stax, connector::Trustpay, connector::Tsys, @@ -595,6 +601,7 @@ default_imp_for_submit_evidence!( connector::Powertranz, connector::Rapyd, connector::Shift4, + connector::Square, connector::Stax, connector::Trustpay, connector::Tsys, @@ -667,6 +674,7 @@ default_imp_for_defend_dispute!( connector::Powertranz, connector::Rapyd, connector::Shift4, + connector::Square, connector::Stax, connector::Stripe, connector::Trustpay, @@ -742,6 +750,7 @@ default_imp_for_pre_processing_steps!( connector::Powertranz, connector::Rapyd, connector::Shift4, + connector::Square, connector::Stax, connector::Tsys, connector::Wise, @@ -796,6 +805,7 @@ default_imp_for_payouts!( connector::Payu, connector::Powertranz, connector::Rapyd, + connector::Square, connector::Stax, connector::Stripe, connector::Shift4, @@ -869,6 +879,7 @@ default_imp_for_payouts_create!( connector::Payu, connector::Powertranz, connector::Rapyd, + connector::Square, connector::Stax, connector::Stripe, connector::Shift4, @@ -945,6 +956,7 @@ default_imp_for_payouts_eligibility!( connector::Payu, connector::Powertranz, connector::Rapyd, + connector::Square, connector::Stax, connector::Stripe, connector::Shift4, @@ -1018,6 +1030,7 @@ default_imp_for_payouts_fulfill!( connector::Payu, connector::Powertranz, connector::Rapyd, + connector::Square, connector::Stax, connector::Stripe, connector::Shift4, @@ -1091,6 +1104,7 @@ default_imp_for_payouts_cancel!( connector::Payu, connector::Powertranz, connector::Rapyd, + connector::Square, connector::Stax, connector::Stripe, connector::Shift4, @@ -1165,6 +1179,7 @@ default_imp_for_payouts_quote!( connector::Payu, connector::Powertranz, connector::Rapyd, + connector::Square, connector::Stax, connector::Stripe, connector::Shift4, @@ -1239,6 +1254,7 @@ default_imp_for_payouts_recipient!( connector::Payu, connector::Powertranz, connector::Rapyd, + connector::Square, connector::Stax, connector::Stripe, connector::Shift4, diff --git a/crates/router/src/types/api.rs b/crates/router/src/types/api.rs index d7d8897eeb5..4882d7a1297 100644 --- a/crates/router/src/types/api.rs +++ b/crates/router/src/types/api.rs @@ -323,6 +323,7 @@ impl ConnectorData { enums::Connector::Powertranz => Ok(Box::new(&connector::Powertranz)), enums::Connector::Rapyd => Ok(Box::new(&connector::Rapyd)), enums::Connector::Shift4 => Ok(Box::new(&connector::Shift4)), + //enums::Connector::Square => Ok(Box::new(&connector::Square)), it is added as template code for future usage enums::Connector::Stax => Ok(Box::new(&connector::Stax)), enums::Connector::Stripe => Ok(Box::new(&connector::Stripe)), enums::Connector::Wise => Ok(Box::new(&connector::Wise)), diff --git a/crates/router/tests/connectors/main.rs b/crates/router/tests/connectors/main.rs index 5fa7ebdb2cd..bbb1b14bd13 100644 --- a/crates/router/tests/connectors/main.rs +++ b/crates/router/tests/connectors/main.rs @@ -42,6 +42,7 @@ mod payu; mod powertranz; mod rapyd; mod shift4; +mod square; mod stax; mod stripe; mod trustpay; diff --git a/crates/router/tests/connectors/sample_auth.toml b/crates/router/tests/connectors/sample_auth.toml index 22223275af2..981d5b4a5c7 100644 --- a/crates/router/tests/connectors/sample_auth.toml +++ b/crates/router/tests/connectors/sample_auth.toml @@ -167,4 +167,7 @@ api_key="API Key" [boku] api_key="API Key" -key1 = "MERCHANT ID" \ No newline at end of file +key1 = "transaction key" + +[square] +api_key="API Key" diff --git a/crates/router/tests/connectors/square.rs b/crates/router/tests/connectors/square.rs new file mode 100644 index 00000000000..8dbccd13120 --- /dev/null +++ b/crates/router/tests/connectors/square.rs @@ -0,0 +1,419 @@ +use masking::Secret; +use router::types::{self, api, storage::enums}; +use test_utils::connector_auth::ConnectorAuthentication; + +use crate::utils::{self, ConnectorActions}; + +#[derive(Clone, Copy)] +struct SquareTest; +impl ConnectorActions for SquareTest {} +impl utils::Connector for SquareTest { + fn get_data(&self) -> types::api::ConnectorData { + use router::connector::Square; + types::api::ConnectorData { + connector: Box::new(&Square), + connector_name: types::Connector::DummyConnector1, + get_token: types::api::GetToken::Connector, + } + } + + fn get_auth_token(&self) -> types::ConnectorAuthType { + utils::to_connector_auth_type( + ConnectorAuthentication::new() + .square + .expect("Missing connector authentication configuration") + .into(), + ) + } + + fn get_name(&self) -> String { + "square".to_string() + } +} + +static CONNECTOR: SquareTest = SquareTest {}; + +fn get_default_payment_info() -> Option<utils::PaymentInfo> { + None +} + +fn payment_method_details() -> Option<types::PaymentsAuthorizeData> { + None +} + +// Cards Positive Tests +// Creates a payment using the manual capture flow (Non 3DS). +#[actix_web::test] +async fn should_only_authorize_payment() { + let response = CONNECTOR + .authorize_payment(payment_method_details(), get_default_payment_info()) + .await + .expect("Authorize payment response"); + assert_eq!(response.status, enums::AttemptStatus::Authorized); +} + +// Captures a payment using the manual capture flow (Non 3DS). +#[actix_web::test] +async fn should_capture_authorized_payment() { + let response = CONNECTOR + .authorize_and_capture_payment(payment_method_details(), None, get_default_payment_info()) + .await + .expect("Capture payment response"); + assert_eq!(response.status, enums::AttemptStatus::Charged); +} + +// Partially captures a payment using the manual capture flow (Non 3DS). +#[actix_web::test] +async fn should_partially_capture_authorized_payment() { + let response = CONNECTOR + .authorize_and_capture_payment( + payment_method_details(), + Some(types::PaymentsCaptureData { + amount_to_capture: 50, + ..utils::PaymentCaptureType::default().0 + }), + get_default_payment_info(), + ) + .await + .expect("Capture payment response"); + assert_eq!(response.status, enums::AttemptStatus::Charged); +} + +// Synchronizes a payment using the manual capture flow (Non 3DS). +#[actix_web::test] +async fn should_sync_authorized_payment() { + let authorize_response = CONNECTOR + .authorize_payment(payment_method_details(), get_default_payment_info()) + .await + .expect("Authorize payment response"); + let txn_id = utils::get_connector_transaction_id(authorize_response.response); + let response = CONNECTOR + .psync_retry_till_status_matches( + enums::AttemptStatus::Authorized, + Some(types::PaymentsSyncData { + connector_transaction_id: router::types::ResponseId::ConnectorTransactionId( + txn_id.unwrap(), + ), + ..Default::default() + }), + get_default_payment_info(), + ) + .await + .expect("PSync response"); + assert_eq!(response.status, enums::AttemptStatus::Authorized,); +} + +// Voids a payment using the manual capture flow (Non 3DS). +#[actix_web::test] +async fn should_void_authorized_payment() { + let response = CONNECTOR + .authorize_and_void_payment( + payment_method_details(), + Some(types::PaymentsCancelData { + connector_transaction_id: String::from(""), + cancellation_reason: Some("requested_by_customer".to_string()), + ..Default::default() + }), + get_default_payment_info(), + ) + .await + .expect("Void payment response"); + assert_eq!(response.status, enums::AttemptStatus::Voided); +} + +// Refunds a payment using the manual capture flow (Non 3DS). +#[actix_web::test] +async fn should_refund_manually_captured_payment() { + let response = CONNECTOR + .capture_payment_and_refund( + payment_method_details(), + None, + None, + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!( + response.response.unwrap().refund_status, + enums::RefundStatus::Success, + ); +} + +// Partially refunds a payment using the manual capture flow (Non 3DS). +#[actix_web::test] +async fn should_partially_refund_manually_captured_payment() { + let response = CONNECTOR + .capture_payment_and_refund( + payment_method_details(), + None, + Some(types::RefundsData { + refund_amount: 50, + ..utils::PaymentRefundType::default().0 + }), + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!( + response.response.unwrap().refund_status, + enums::RefundStatus::Success, + ); +} + +// Synchronizes a refund using the manual capture flow (Non 3DS). +#[actix_web::test] +async fn should_sync_manually_captured_refund() { + let refund_response = CONNECTOR + .capture_payment_and_refund( + payment_method_details(), + None, + None, + get_default_payment_info(), + ) + .await + .unwrap(); + let response = CONNECTOR + .rsync_retry_till_status_matches( + enums::RefundStatus::Success, + refund_response.response.unwrap().connector_refund_id, + None, + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!( + response.response.unwrap().refund_status, + enums::RefundStatus::Success, + ); +} + +// Creates a payment using the automatic capture flow (Non 3DS). +#[actix_web::test] +async fn should_make_payment() { + let authorize_response = CONNECTOR + .make_payment(payment_method_details(), get_default_payment_info()) + .await + .unwrap(); + assert_eq!(authorize_response.status, enums::AttemptStatus::Charged); +} + +// Synchronizes a payment using the automatic capture flow (Non 3DS). +#[actix_web::test] +async fn should_sync_auto_captured_payment() { + let authorize_response = CONNECTOR + .make_payment(payment_method_details(), get_default_payment_info()) + .await + .unwrap(); + assert_eq!(authorize_response.status, enums::AttemptStatus::Charged); + let txn_id = utils::get_connector_transaction_id(authorize_response.response); + assert_ne!(txn_id, None, "Empty connector transaction id"); + let response = CONNECTOR + .psync_retry_till_status_matches( + enums::AttemptStatus::Charged, + Some(types::PaymentsSyncData { + connector_transaction_id: router::types::ResponseId::ConnectorTransactionId( + txn_id.unwrap(), + ), + capture_method: Some(enums::CaptureMethod::Automatic), + ..Default::default() + }), + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!(response.status, enums::AttemptStatus::Charged,); +} + +// Refunds a payment using the automatic capture flow (Non 3DS). +#[actix_web::test] +async fn should_refund_auto_captured_payment() { + let response = CONNECTOR + .make_payment_and_refund(payment_method_details(), None, get_default_payment_info()) + .await + .unwrap(); + assert_eq!( + response.response.unwrap().refund_status, + enums::RefundStatus::Success, + ); +} + +// Partially refunds a payment using the automatic capture flow (Non 3DS). +#[actix_web::test] +async fn should_partially_refund_succeeded_payment() { + let refund_response = CONNECTOR + .make_payment_and_refund( + payment_method_details(), + Some(types::RefundsData { + refund_amount: 50, + ..utils::PaymentRefundType::default().0 + }), + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!( + refund_response.response.unwrap().refund_status, + enums::RefundStatus::Success, + ); +} + +// Creates multiple refunds against a payment using the automatic capture flow (Non 3DS). +#[actix_web::test] +async fn should_refund_succeeded_payment_multiple_times() { + CONNECTOR + .make_payment_and_multiple_refund( + payment_method_details(), + Some(types::RefundsData { + refund_amount: 50, + ..utils::PaymentRefundType::default().0 + }), + get_default_payment_info(), + ) + .await; +} + +// Synchronizes a refund using the automatic capture flow (Non 3DS). +#[actix_web::test] +async fn should_sync_refund() { + let refund_response = CONNECTOR + .make_payment_and_refund(payment_method_details(), None, get_default_payment_info()) + .await + .unwrap(); + let response = CONNECTOR + .rsync_retry_till_status_matches( + enums::RefundStatus::Success, + refund_response.response.unwrap().connector_refund_id, + None, + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!( + response.response.unwrap().refund_status, + enums::RefundStatus::Success, + ); +} + +// Cards Negative scenerios +// Creates a payment with incorrect CVC. +#[actix_web::test] +async fn should_fail_payment_for_incorrect_cvc() { + let response = CONNECTOR + .make_payment( + Some(types::PaymentsAuthorizeData { + payment_method_data: types::api::PaymentMethodData::Card(api::Card { + card_cvc: Secret::new("12345".to_string()), + ..utils::CCardType::default().0 + }), + ..utils::PaymentAuthorizeType::default().0 + }), + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!( + response.response.unwrap_err().message, + "Your card's security code is invalid.".to_string(), + ); +} + +// Creates a payment with incorrect expiry month. +#[actix_web::test] +async fn should_fail_payment_for_invalid_exp_month() { + let response = CONNECTOR + .make_payment( + Some(types::PaymentsAuthorizeData { + payment_method_data: types::api::PaymentMethodData::Card(api::Card { + card_exp_month: Secret::new("20".to_string()), + ..utils::CCardType::default().0 + }), + ..utils::PaymentAuthorizeType::default().0 + }), + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!( + response.response.unwrap_err().message, + "Your card's expiration month is invalid.".to_string(), + ); +} + +// Creates a payment with incorrect expiry year. +#[actix_web::test] +async fn should_fail_payment_for_incorrect_expiry_year() { + let response = CONNECTOR + .make_payment( + Some(types::PaymentsAuthorizeData { + payment_method_data: types::api::PaymentMethodData::Card(api::Card { + card_exp_year: Secret::new("2000".to_string()), + ..utils::CCardType::default().0 + }), + ..utils::PaymentAuthorizeType::default().0 + }), + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!( + response.response.unwrap_err().message, + "Your card's expiration year is invalid.".to_string(), + ); +} + +// Voids a payment using automatic capture flow (Non 3DS). +#[actix_web::test] +async fn should_fail_void_payment_for_auto_capture() { + let authorize_response = CONNECTOR + .make_payment(payment_method_details(), get_default_payment_info()) + .await + .unwrap(); + assert_eq!(authorize_response.status, enums::AttemptStatus::Charged); + let txn_id = utils::get_connector_transaction_id(authorize_response.response); + assert_ne!(txn_id, None, "Empty connector transaction id"); + let void_response = CONNECTOR + .void_payment(txn_id.unwrap(), None, get_default_payment_info()) + .await + .unwrap(); + assert_eq!( + void_response.response.unwrap_err().message, + "You cannot cancel this PaymentIntent because it has a status of succeeded." + ); +} + +// Captures a payment using invalid connector payment id. +#[actix_web::test] +async fn should_fail_capture_for_invalid_payment() { + let capture_response = CONNECTOR + .capture_payment("123456789".to_string(), None, get_default_payment_info()) + .await + .unwrap(); + assert_eq!( + capture_response.response.unwrap_err().message, + String::from("No such payment_intent: '123456789'") + ); +} + +// Refunds a payment with refund amount higher than payment amount. +#[actix_web::test] +async fn should_fail_for_refund_amount_higher_than_payment_amount() { + let response = CONNECTOR + .make_payment_and_refund( + payment_method_details(), + Some(types::RefundsData { + refund_amount: 150, + ..utils::PaymentRefundType::default().0 + }), + get_default_payment_info(), + ) + .await + .unwrap(); + assert_eq!( + response.response.unwrap_err().message, + "Refund amount (₹1.50) is greater than charge amount (₹1.00)", + ); +} + +// Connector dependent test cases goes here + +// [#478]: add unit tests for non 3DS, wallets & webhooks in connector tests diff --git a/crates/test_utils/src/connector_auth.rs b/crates/test_utils/src/connector_auth.rs index c19c1ffea86..75992593777 100644 --- a/crates/test_utils/src/connector_auth.rs +++ b/crates/test_utils/src/connector_auth.rs @@ -48,6 +48,7 @@ pub struct ConnectorAuthentication { pub powertranz: Option<BodyKey>, pub rapyd: Option<BodyKey>, pub shift4: Option<HeaderKey>, + pub square: Option<HeaderKey>, pub stax: Option<HeaderKey>, pub stripe: Option<HeaderKey>, pub stripe_au: Option<HeaderKey>, diff --git a/loadtest/config/development.toml b/loadtest/config/development.toml index b37be72d6c1..8bf0f1d985a 100644 --- a/loadtest/config/development.toml +++ b/loadtest/config/development.toml @@ -97,6 +97,7 @@ payu.base_url = "https://secure.snd.payu.com/" powertranz.base_url = "https://staging.ptranz.com/api/" rapyd.base_url = "https://sandboxapi.rapyd.net" shift4.base_url = "https://api.shift4.com/" +square.base_url = "https://connect.squareupsandbox.com/" stax.base_url = "https://apiprod.fattlabs.com/" stripe.base_url = "https://api.stripe.com/" stripe.base_url_file_upload = "https://files.stripe.com/" @@ -150,6 +151,7 @@ cards = [ "payu", "powertranz", "shift4", + "square", "stax", "stripe", "trustpay", diff --git a/scripts/add_connector.sh b/scripts/add_connector.sh index 15f27f8c957..4302e535ce0 100755 --- a/scripts/add_connector.sh +++ b/scripts/add_connector.sh @@ -6,7 +6,7 @@ function find_prev_connector() { git checkout $self cp $self $self.tmp # Add new connector to existing list and sort it - connectors=(aci adyen airwallex applepay authorizedotnet bambora bitpay bluesnap boku braintree cashtocode checkout coinbase cryptopay cybersource dlocal dummyconnector fiserv forte globalpay globepay iatapay klarna mollie multisafepay nexinets noon nuvei opayo opennode payeezy payme paypal payu powertranz rapyd shift4 stax stripe trustpay tsys wise worldline worldpay "$1") + connectors=(aci adyen airwallex applepay authorizedotnet bambora bitpay bluesnap boku braintree cashtocode checkout coinbase cryptopay cybersource dlocal dummyconnector fiserv forte globalpay globepay iatapay klarna mollie multisafepay nexinets noon nuvei opayo opennode payeezy payme paypal payu powertranz rapyd shift4 square stax stripe trustpay tsys wise worldline worldpay "$1") IFS=$'\n' sorted=($(sort <<<"${connectors[*]}")); unset IFS res=`echo ${sorted[@]}` sed -i'' -e "s/^ connectors=.*/ connectors=($res \"\$1\")/" $self.tmp
feat
[Square] Add template code for connector Square (#1834)
1f0d60e64fc9379d8a07a0c72970afc7b491dafa
2024-04-02 15:43:30
Sanchith Hegde
build(deps): update dependencies (#4268)
false
diff --git a/Cargo.lock b/Cargo.lock index 8f571b3b922..f17cd059480 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,26 +4,26 @@ version = 3 [[package]] name = "actix-codec" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "617a8268e3537fe1d8c9ead925fca49ef6400927ee7bc26750e90ecee14ce4b8" +checksum = "5f7b0a21988c1bf877cf4759ef5ddaac04c1c9fe808c9142ecb78ba97d97a28a" dependencies = [ - "bitflags 1.3.2", - "bytes 1.5.0", + "bitflags 2.5.0", + "bytes 1.6.0", "futures-core", "futures-sink", "memchr", "pin-project-lite", - "tokio 1.36.0", + "tokio 1.37.0", "tokio-util", "tracing", ] [[package]] name = "actix-cors" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b340e9cfa5b08690aae90fb61beb44e9b06f44fe3d0f93781aaa58cfba86245e" +checksum = "0346d8c1f762b41b458ed3145eea914966bb9ad20b9be0d6d463b20d45586370" dependencies = [ "actix-utils", "actix-web", @@ -31,31 +31,31 @@ dependencies = [ "futures-util", "log", "once_cell", - "smallvec 1.11.1", + "smallvec 1.13.2", ] [[package]] name = "actix-http" -version = "3.3.1" +version = "3.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2079246596c18b4a33e274ae10c0e50613f4d32a4198e09c7b93771013fed74" +checksum = "d223b13fd481fc0d1f83bb12659ae774d9e3601814c68a0bc539731698cca743" dependencies = [ "actix-codec", "actix-rt", "actix-service", "actix-utils", - "ahash 0.8.6", - "base64 0.21.5", - "bitflags 1.3.2", + "ahash 0.8.11", + "base64 0.21.7", + "bitflags 2.5.0", "brotli", - "bytes 1.5.0", + "bytes 1.6.0", "bytestring", "derive_more", "encoding_rs", "flate2", "futures-core", - "h2", - "http 0.2.9", + "h2 0.3.25", + "http 0.2.12", "httparse", "httpdate", "itoa", @@ -64,10 +64,10 @@ dependencies = [ "mime", "percent-encoding", "pin-project-lite", - "rand 0.8.5", + "rand", "sha1", - "smallvec 1.11.1", - "tokio 1.36.0", + "smallvec 1.13.2", + "tokio 1.37.0", "tokio-util", "tracing", "zstd", @@ -80,7 +80,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" dependencies = [ "quote", - "syn 2.0.55", + "syn 2.0.57", ] [[package]] @@ -92,7 +92,7 @@ dependencies = [ "actix-multipart-derive", "actix-utils", "actix-web", - "bytes 1.5.0", + "bytes 1.6.0", "derive_more", "futures-core", "futures-util", @@ -105,7 +105,7 @@ dependencies = [ "serde_json", "serde_plain", "tempfile", - "tokio 1.36.0", + "tokio 1.37.0", ] [[package]] @@ -114,21 +114,21 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a0a77f836d869f700e5b47ac7c3c8b9c8bc82e4aec861954c6198abee3ebd4d" dependencies = [ - "darling 0.20.3", + "darling 0.20.8", "parse-size", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.57", ] [[package]] name = "actix-router" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d66ff4d247d2b160861fa2866457e85706833527840e4133f8f49aa423a38799" +checksum = "d22475596539443685426b6bdadb926ad0ecaefdfc5fb05e5e3441f15463c511" dependencies = [ "bytestring", - "http 0.2.9", + "http 0.2.12", "regex", "serde", "tracing", @@ -142,7 +142,7 @@ checksum = "28f32d40287d3f402ae0028a9d54bef51af15c8769492826a69d28f81893151d" dependencies = [ "actix-macros", "futures-core", - "tokio 1.36.0", + "tokio 1.37.0", ] [[package]] @@ -156,9 +156,9 @@ dependencies = [ "actix-utils", "futures-core", "futures-util", - "mio 0.8.10", - "socket2 0.5.5", - "tokio 1.36.0", + "mio 0.8.11", + "socket2", + "tokio 1.37.0", "tracing", ] @@ -175,20 +175,19 @@ dependencies = [ [[package]] name = "actix-tls" -version = "3.1.1" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72616e7fbec0aa99c6f3164677fa48ff5a60036d0799c98cab894a44f3e0efc3" +checksum = "d4cce60a2f2b477bc72e5cde0af1812a6e82d8fd85b5570a5dcf2a5bf2c5be5f" dependencies = [ "actix-rt", "actix-service", "actix-utils", "futures-core", - "http 0.2.9", + "http 0.2.12", + "http 1.1.0", "impl-more", "pin-project-lite", - "rustls 0.21.10", - "rustls-webpki", - "tokio 1.36.0", + "tokio 1.37.0", "tokio-rustls 0.23.4", "tokio-util", "tracing", @@ -207,9 +206,9 @@ dependencies = [ [[package]] name = "actix-web" -version = "4.3.1" +version = "4.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd3cb42f9566ab176e1ef0b8b3a896529062b4efc6be0123046095914c4c1c96" +checksum = "43a6556ddebb638c2358714d853257ed226ece6023ef9364f23f0c70737ea984" dependencies = [ "actix-codec", "actix-http", @@ -220,8 +219,8 @@ dependencies = [ "actix-service", "actix-utils", "actix-web-codegen", - "ahash 0.7.7", - "bytes 1.5.0", + "ahash 0.8.11", + "bytes 1.6.0", "bytestring", "cfg-if 1.0.0", "cookie 0.16.2", @@ -229,7 +228,6 @@ dependencies = [ "encoding_rs", "futures-core", "futures-util", - "http 0.2.9", "itoa", "language-tags", "log", @@ -240,8 +238,8 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", - "smallvec 1.11.1", - "socket2 0.4.9", + "smallvec 1.13.2", + "socket2", "time", "url", ] @@ -255,7 +253,7 @@ dependencies = [ "actix-router", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.57", ] [[package]] @@ -273,31 +271,25 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "adler32" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" - [[package]] name = "ahash" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ - "getrandom 0.2.11", + "getrandom", "once_cell", "version_check", ] [[package]] name = "ahash" -version = "0.8.6" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if 1.0.0", - "getrandom 0.2.11", + "getrandom", "once_cell", "version_check", "zerocopy", @@ -305,9 +297,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.1" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -340,7 +332,7 @@ dependencies = [ "actix-web", "api_models", "async-trait", - "aws-config 1.1.8", + "aws-config 1.1.9", "aws-sdk-lambda", "aws-smithy-types 1.1.8", "bigdecimal", @@ -348,7 +340,7 @@ dependencies = [ "diesel_models", "error-stack", "external_services", - "futures 0.3.28", + "futures 0.3.30", "hyperswitch_interfaces", "masking", "once_cell", @@ -359,10 +351,10 @@ dependencies = [ "serde_json", "sqlx", "storage_impl", - "strum 0.25.0", + "strum 0.26.2", "thiserror", "time", - "tokio 1.36.0", + "tokio 1.37.0", ] [[package]] @@ -388,9 +380,9 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstyle" -version = "1.0.0" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" [[package]] name = "anyhow" @@ -416,7 +408,7 @@ dependencies = [ "router_derive", "serde", "serde_json", - "strum 0.25.0", + "strum 0.26.2", "time", "url", "utoipa", @@ -424,15 +416,15 @@ dependencies = [ [[package]] name = "arc-swap" -version = "1.6.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" +checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" [[package]] name = "argon2" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ba4cac0a46bc1d2912652a751c47f2a9f3a7fe89bcae2275d418f5270402f9" +checksum = "3c3610892ee6e0cbce8ae2700349fcf8f98adb0dbfbee85aec3c9179d29cc072" dependencies = [ "base64ct", "blake2", @@ -454,9 +446,9 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "asn1-rs" -version = "0.5.2" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" +checksum = "22ad1373757efa0f70ec53939aabc7152e1591cb485208052993070ac8d2429d" dependencies = [ "asn1-rs-derive", "asn1-rs-impl", @@ -470,25 +462,25 @@ dependencies = [ [[package]] name = "asn1-rs-derive" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" +checksum = "7378575ff571966e99a744addeff0bff98b8ada0dedf1956d59e634db95eaac1" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", - "synstructure", + "syn 2.0.57", + "synstructure 0.13.1", ] [[package]] name = "asn1-rs-impl" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" +checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.57", ] [[package]] @@ -510,32 +502,21 @@ dependencies = [ "bb8", "diesel", "thiserror", - "tokio 1.36.0", + "tokio 1.37.0", "tracing", ] -[[package]] -name = "async-channel" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" -dependencies = [ - "concurrent-queue", - "event-listener", - "futures-core", -] - [[package]] name = "async-compression" -version = "0.4.3" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb42b2197bf15ccb092b62c74515dbd8b86d0effd934795f6687c93b6e679a2c" +checksum = "a116f46a969224200a0a97f29cfd4c50e7534e4b4826bd23ea2c3c533039c82c" dependencies = [ "flate2", "futures-core", "memchr", "pin-project-lite", - "tokio 1.36.0", + "tokio 1.37.0", ] [[package]] @@ -566,25 +547,25 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.57", ] [[package]] name = "async-trait" -version = "0.1.77" +version = "0.1.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.57", ] [[package]] name = "atoi" -version = "1.0.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7c57d12312ff59c811c0643f4d80830505833c9ffaebd193d819392b265be8e" +checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528" dependencies = [ "num-traits", ] @@ -595,17 +576,27 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba" +[[package]] +name = "atomic-write-file" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8204db279bf648d64fe845bd8840f78b39c8132ed4d6a4194c3b10d4b4cfb0b" +dependencies = [ + "nix", + "rand", +] + [[package]] name = "autocfg" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" [[package]] name = "awc" -version = "3.1.1" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ef547a81796eb2dfe9b345aba34c2e08391a0502493711395b36dd64052b69" +checksum = "68c09cc97310b926f01621faee652f3d1b0962545a3cec6c9ac07def9ea36c2c" dependencies = [ "actix-codec", "actix-http", @@ -613,27 +604,26 @@ dependencies = [ "actix-service", "actix-tls", "actix-utils", - "ahash 0.7.7", - "base64 0.21.5", - "bytes 1.5.0", + "base64 0.21.7", + "bytes 1.6.0", "cfg-if 1.0.0", "cookie 0.16.2", "derive_more", "futures-core", "futures-util", - "h2", - "http 0.2.9", + "h2 0.3.25", + "http 0.2.12", "itoa", "log", "mime", "percent-encoding", "pin-project-lite", - "rand 0.8.5", + "rand", "rustls 0.20.9", "serde", "serde_json", "serde_urlencoded", - "tokio 1.36.0", + "tokio 1.37.0", ] [[package]] @@ -653,14 +643,14 @@ dependencies = [ "aws-smithy-json 0.55.3", "aws-smithy-types 0.55.3", "aws-types 0.55.3", - "bytes 1.5.0", + "bytes 1.6.0", "fastrand 1.9.0", "hex", - "http 0.2.9", - "hyper", + "http 0.2.12", + "hyper 0.14.28", "ring 0.16.20", "time", - "tokio 1.36.0", + "tokio 1.37.0", "tower", "tracing", "zeroize", @@ -668,31 +658,32 @@ dependencies = [ [[package]] name = "aws-config" -version = "1.1.8" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f4084d18094aec9f79d509f4cb6ccf6b613c5037e32f32e74312e52b836e366" +checksum = "297b64446175a73987cedc3c438d79b2a654d0fff96f65ff530fbe039347644c" dependencies = [ "aws-credential-types 1.1.8", "aws-runtime", - "aws-sdk-sso 1.17.0", + "aws-sdk-sso 1.18.0", "aws-sdk-ssooidc", - "aws-sdk-sts 1.17.0", - "aws-smithy-async 1.1.8", + "aws-sdk-sts 1.18.0", + "aws-smithy-async 1.2.0", "aws-smithy-http 0.60.7", "aws-smithy-json 0.60.7", "aws-smithy-runtime", "aws-smithy-runtime-api", "aws-smithy-types 1.1.8", "aws-types 1.1.8", - "bytes 1.5.0", - "fastrand 2.0.1", + "bytes 1.6.0", + "fastrand 2.0.2", "hex", - "http 0.2.9", - "hyper", + "http 0.2.12", + "hyper 0.14.28", "ring 0.17.8", "time", - "tokio 1.36.0", + "tokio 1.37.0", "tracing", + "url", "zeroize", ] @@ -705,7 +696,7 @@ dependencies = [ "aws-smithy-async 0.55.3", "aws-smithy-types 0.55.3", "fastrand 1.9.0", - "tokio 1.36.0", + "tokio 1.37.0", "tracing", "zeroize", ] @@ -716,7 +707,7 @@ version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa8587ae17c8e967e4b05a62d495be2fb7701bec52a97f7acfe8a29f938384c8" dependencies = [ - "aws-smithy-async 1.1.8", + "aws-smithy-async 1.2.0", "aws-smithy-runtime-api", "aws-smithy-types 1.1.8", "zeroize", @@ -731,7 +722,7 @@ dependencies = [ "aws-smithy-http 0.55.3", "aws-smithy-types 0.55.3", "aws-types 0.55.3", - "http 0.2.9", + "http 0.2.12", "regex", "tracing", ] @@ -746,9 +737,9 @@ dependencies = [ "aws-smithy-http 0.55.3", "aws-smithy-types 0.55.3", "aws-types 0.55.3", - "bytes 1.5.0", - "http 0.2.9", - "http-body", + "bytes 1.6.0", + "http 0.2.12", + "http-body 0.4.6", "lazy_static", "percent-encoding", "pin-project-lite", @@ -763,16 +754,16 @@ checksum = "b13dc54b4b49f8288532334bba8f87386a40571c47c37b1304979b556dc613c8" dependencies = [ "aws-credential-types 1.1.8", "aws-sigv4 1.2.0", - "aws-smithy-async 1.1.8", + "aws-smithy-async 1.2.0", "aws-smithy-eventstream 0.60.4", "aws-smithy-http 0.60.7", "aws-smithy-runtime-api", "aws-smithy-types 1.1.8", "aws-types 1.1.8", - "bytes 1.5.0", - "fastrand 2.0.1", - "http 0.2.9", - "http-body", + "bytes 1.6.0", + "fastrand 2.0.2", + "http 0.2.12", + "http-body 0.4.6", "percent-encoding", "pin-project-lite", "tracing", @@ -796,8 +787,8 @@ dependencies = [ "aws-smithy-json 0.55.3", "aws-smithy-types 0.55.3", "aws-types 0.55.3", - "bytes 1.5.0", - "http 0.2.9", + "bytes 1.6.0", + "http 0.2.12", "regex", "tokio-stream", "tower", @@ -806,13 +797,13 @@ dependencies = [ [[package]] name = "aws-sdk-lambda" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2e4c45d7ce6e957489b9be24963c7fb04a6b0d2e8c7dfcbca032f9bf25b0d4d" +checksum = "a0c5446405655a27f8f98974668f6e10b6740902afd5ab56045b464b9b9a845a" dependencies = [ "aws-credential-types 1.1.8", "aws-runtime", - "aws-smithy-async 1.1.8", + "aws-smithy-async 1.2.0", "aws-smithy-eventstream 0.60.4", "aws-smithy-http 0.60.7", "aws-smithy-json 0.60.7", @@ -820,8 +811,8 @@ dependencies = [ "aws-smithy-runtime-api", "aws-smithy-types 1.1.8", "aws-types 1.1.8", - "bytes 1.5.0", - "http 0.2.9", + "bytes 1.6.0", + "http 0.2.12", "once_cell", "regex-lite", "tracing", @@ -848,9 +839,9 @@ dependencies = [ "aws-smithy-types 0.55.3", "aws-smithy-xml 0.55.3", "aws-types 0.55.3", - "bytes 1.5.0", - "http 0.2.9", - "http-body", + "bytes 1.6.0", + "http 0.2.12", + "http-body 0.4.6", "once_cell", "percent-encoding", "regex", @@ -877,8 +868,8 @@ dependencies = [ "aws-smithy-json 0.55.3", "aws-smithy-types 0.55.3", "aws-types 0.55.3", - "bytes 1.5.0", - "http 0.2.9", + "bytes 1.6.0", + "http 0.2.12", "regex", "tokio-stream", "tower", @@ -902,8 +893,8 @@ dependencies = [ "aws-smithy-json 0.55.3", "aws-smithy-types 0.55.3", "aws-types 0.55.3", - "bytes 1.5.0", - "http 0.2.9", + "bytes 1.6.0", + "http 0.2.12", "regex", "tokio-stream", "tower", @@ -912,21 +903,21 @@ dependencies = [ [[package]] name = "aws-sdk-sso" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5cc34f5925899739a3f125bd3f7d37d081234a3df218feb9c9d337fd4c70e72" +checksum = "019a07902c43b03167ea5df0182f0cb63fae89f9a9682c44d18cf2e4a042cb34" dependencies = [ "aws-credential-types 1.1.8", "aws-runtime", - "aws-smithy-async 1.1.8", + "aws-smithy-async 1.2.0", "aws-smithy-http 0.60.7", "aws-smithy-json 0.60.7", "aws-smithy-runtime", "aws-smithy-runtime-api", "aws-smithy-types 1.1.8", "aws-types 1.1.8", - "bytes 1.5.0", - "http 0.2.9", + "bytes 1.6.0", + "http 0.2.12", "once_cell", "regex-lite", "tracing", @@ -934,21 +925,21 @@ dependencies = [ [[package]] name = "aws-sdk-ssooidc" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7327cddd32b1a6f2aaeaadb1336b671a7975e96a999d3b1bcf5aa47932dc6ddb" +checksum = "04c46ee08a48a7f4eaa4ad201dcc1dd537b49c50859d14d4510e00ad9d3f9af2" dependencies = [ "aws-credential-types 1.1.8", "aws-runtime", - "aws-smithy-async 1.1.8", + "aws-smithy-async 1.2.0", "aws-smithy-http 0.60.7", "aws-smithy-json 0.60.7", "aws-smithy-runtime", "aws-smithy-runtime-api", "aws-smithy-types 1.1.8", "aws-types 1.1.8", - "bytes 1.5.0", - "http 0.2.9", + "bytes 1.6.0", + "http 0.2.12", "once_cell", "regex-lite", "tracing", @@ -973,8 +964,8 @@ dependencies = [ "aws-smithy-types 0.55.3", "aws-smithy-xml 0.55.3", "aws-types 0.55.3", - "bytes 1.5.0", - "http 0.2.9", + "bytes 1.6.0", + "http 0.2.12", "regex", "tower", "tracing", @@ -982,13 +973,13 @@ dependencies = [ [[package]] name = "aws-sdk-sts" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c11981cdb80e8e205e22beb6630a8bdec380a1256bd29efaab34aaebd07cfb9" +checksum = "f752ac730125ca6017f72f9db5ec1772c9ecc664f87aa7507a7d81b023c23713" dependencies = [ "aws-credential-types 1.1.8", "aws-runtime", - "aws-smithy-async 1.1.8", + "aws-smithy-async 1.2.0", "aws-smithy-http 0.60.7", "aws-smithy-json 0.60.7", "aws-smithy-query 0.60.7", @@ -997,7 +988,7 @@ dependencies = [ "aws-smithy-types 1.1.8", "aws-smithy-xml 0.60.7", "aws-types 1.1.8", - "http 0.2.9", + "http 0.2.12", "once_cell", "regex-lite", "tracing", @@ -1014,7 +1005,7 @@ dependencies = [ "aws-smithy-eventstream 0.55.3", "aws-smithy-http 0.55.3", "aws-types 0.55.3", - "http 0.2.9", + "http 0.2.12", "tracing", ] @@ -1026,11 +1017,11 @@ checksum = "9d2ce6f507be68e968a33485ced670111d1cbad161ddbbab1e313c03d37d8f4c" dependencies = [ "aws-smithy-eventstream 0.55.3", "aws-smithy-http 0.55.3", - "bytes 1.5.0", + "bytes 1.6.0", "form_urlencoded", "hex", "hmac", - "http 0.2.9", + "http 0.2.12", "once_cell", "percent-encoding", "regex", @@ -1050,11 +1041,11 @@ dependencies = [ "aws-smithy-http 0.60.7", "aws-smithy-runtime-api", "aws-smithy-types 1.1.8", - "bytes 1.5.0", + "bytes 1.6.0", "form_urlencoded", "hex", "hmac", - "http 0.2.9", + "http 0.2.12", "http 1.1.0", "once_cell", "percent-encoding", @@ -1071,19 +1062,19 @@ checksum = "13bda3996044c202d75b91afeb11a9afae9db9a721c6a7a427410018e286b880" dependencies = [ "futures-util", "pin-project-lite", - "tokio 1.36.0", + "tokio 1.37.0", "tokio-stream", ] [[package]] name = "aws-smithy-async" -version = "1.1.8" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26ea8fa03025b2face2b3038a63525a10891e3d8829901d502e5384a0d8cd46" +checksum = "f7a41ccd6b74401a49ca828617049e5c23d83163d330a4f90a8081aadee0ac45" dependencies = [ "futures-util", "pin-project-lite", - "tokio 1.36.0", + "tokio 1.37.0", ] [[package]] @@ -1094,12 +1085,12 @@ checksum = "07ed8b96d95402f3f6b8b57eb4e0e45ee365f78b1a924faf20ff6e97abf1eae6" dependencies = [ "aws-smithy-http 0.55.3", "aws-smithy-types 0.55.3", - "bytes 1.5.0", + "bytes 1.6.0", "crc32c", "crc32fast", "hex", - "http 0.2.9", - "http-body", + "http 0.2.12", + "http-body 0.4.6", "md-5", "pin-project-lite", "sha1", @@ -1117,16 +1108,16 @@ dependencies = [ "aws-smithy-http 0.55.3", "aws-smithy-http-tower", "aws-smithy-types 0.55.3", - "bytes 1.5.0", + "bytes 1.6.0", "fastrand 1.9.0", - "http 0.2.9", - "http-body", - "hyper", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.28", "hyper-rustls 0.23.2", "lazy_static", "pin-project-lite", "rustls 0.20.9", - "tokio 1.36.0", + "tokio 1.37.0", "tower", "tracing", ] @@ -1138,7 +1129,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "460c8da5110835e3d9a717c61f5556b20d03c32a1dec57f8fc559b360f733bb8" dependencies = [ "aws-smithy-types 0.55.3", - "bytes 1.5.0", + "bytes 1.6.0", "crc32fast", ] @@ -1149,7 +1140,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6363078f927f612b970edf9d1903ef5cef9a64d1e8423525ebb1f0a1633c858" dependencies = [ "aws-smithy-types 1.1.8", - "bytes 1.5.0", + "bytes 1.6.0", "crc32fast", ] @@ -1161,17 +1152,17 @@ checksum = "2b3b693869133551f135e1f2c77cb0b8277d9e3e17feaf2213f735857c4f0d28" dependencies = [ "aws-smithy-eventstream 0.55.3", "aws-smithy-types 0.55.3", - "bytes 1.5.0", + "bytes 1.6.0", "bytes-utils", "futures-core", - "http 0.2.9", - "http-body", - "hyper", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.28", "once_cell", "percent-encoding", "pin-project-lite", "pin-utils", - "tokio 1.36.0", + "tokio 1.37.0", "tokio-util", "tracing", ] @@ -1185,11 +1176,11 @@ dependencies = [ "aws-smithy-eventstream 0.60.4", "aws-smithy-runtime-api", "aws-smithy-types 1.1.8", - "bytes 1.5.0", + "bytes 1.6.0", "bytes-utils", "futures-core", - "http 0.2.9", - "http-body", + "http 0.2.12", + "http-body 0.4.6", "once_cell", "percent-encoding", "pin-project-lite", @@ -1205,9 +1196,9 @@ checksum = "3ae4f6c5798a247fac98a867698197d9ac22643596dc3777f0c76b91917616b9" dependencies = [ "aws-smithy-http 0.55.3", "aws-smithy-types 0.55.3", - "bytes 1.5.0", - "http 0.2.9", - "http-body", + "bytes 1.6.0", + "http 0.2.12", + "http-body 0.4.6", "pin-project-lite", "tower", "tracing", @@ -1257,22 +1248,22 @@ version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec81002d883e5a7fd2bb063d6fb51c4999eb55d404f4fff3dd878bf4733b9f01" dependencies = [ - "aws-smithy-async 1.1.8", + "aws-smithy-async 1.2.0", "aws-smithy-http 0.60.7", "aws-smithy-runtime-api", "aws-smithy-types 1.1.8", - "bytes 1.5.0", - "fastrand 2.0.1", - "h2", - "http 0.2.9", - "http-body", - "hyper", + "bytes 1.6.0", + "fastrand 2.0.2", + "h2 0.3.25", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.28", "hyper-rustls 0.24.2", "once_cell", "pin-project-lite", "pin-utils", "rustls 0.21.10", - "tokio 1.36.0", + "tokio 1.37.0", "tracing", ] @@ -1282,13 +1273,13 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9acb931e0adaf5132de878f1398d83f8677f90ba70f01f65ff87f6d7244be1c5" dependencies = [ - "aws-smithy-async 1.1.8", + "aws-smithy-async 1.2.0", "aws-smithy-types 1.1.8", - "bytes 1.5.0", - "http 0.2.9", + "bytes 1.6.0", + "http 0.2.12", "http 1.1.0", "pin-project-lite", - "tokio 1.36.0", + "tokio 1.37.0", "tracing", "zeroize", ] @@ -1313,11 +1304,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abe14dceea1e70101d38fbf2a99e6a34159477c0fb95e68e05c66bd7ae4c3729" dependencies = [ "base64-simd", - "bytes 1.5.0", + "bytes 1.6.0", "bytes-utils", "futures-core", - "http 0.2.9", - "http-body", + "http 0.2.12", + "http-body 0.4.6", "itoa", "num-integer", "pin-project-lite", @@ -1325,7 +1316,7 @@ dependencies = [ "ryu", "serde", "time", - "tokio 1.36.0", + "tokio 1.37.0", "tokio-util", ] @@ -1358,7 +1349,7 @@ dependencies = [ "aws-smithy-client", "aws-smithy-http 0.55.3", "aws-smithy-types 0.55.3", - "http 0.2.9", + "http 0.2.12", "rustc_version 0.4.0", "tracing", ] @@ -1370,10 +1361,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dbf2f3da841a8930f159163175cf6a3d16ddde517c1b0fba7aa776822800f40" dependencies = [ "aws-credential-types 1.1.8", - "aws-smithy-async 1.1.8", + "aws-smithy-async 1.2.0", "aws-smithy-runtime-api", "aws-smithy-types 1.1.8", - "http 0.2.9", + "http 0.2.12", "rustc_version 0.4.0", "tracing", ] @@ -1387,11 +1378,11 @@ dependencies = [ "async-trait", "axum-core", "bitflags 1.3.2", - "bytes 1.5.0", + "bytes 1.6.0", "futures-util", - "http 0.2.9", - "http-body", - "hyper", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.28", "itoa", "matchit", "memchr", @@ -1413,10 +1404,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" dependencies = [ "async-trait", - "bytes 1.5.0", + "bytes 1.6.0", "futures-util", - "http 0.2.9", - "http-body", + "http 0.2.12", + "http-body 0.4.6", "mime", "rustversion", "tower-layer", @@ -1425,15 +1416,15 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" dependencies = [ "addr2line", "cc", "cfg-if 1.0.0", "libc", - "miniz_oxide 0.7.1", + "miniz_oxide", "object", "rustc-demangle", ] @@ -1446,9 +1437,15 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.5" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" [[package]] name = "base64-simd" @@ -1468,15 +1465,15 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "bb8" -version = "0.8.1" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98b4b0f25f18bcdc3ac72bdb486ed0acf7e185221fd4dc985bc15db5800b0ba2" +checksum = "df7c2093d15d6a1d33b1f972e1c5ea3177748742b97a5f392aa83a65262c6780" dependencies = [ "async-trait", "futures-channel", "futures-util", "parking_lot 0.12.1", - "tokio 1.36.0", + "tokio 1.37.0", ] [[package]] @@ -1523,9 +1520,12 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +dependencies = [ + "serde", +] [[package]] name = "bitvec" @@ -1545,30 +1545,20 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" dependencies = [ - "digest 0.10.7", + "digest", ] [[package]] name = "blake3" -version = "1.4.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "729b71f35bd3fa1a4c86b85d32c8b9069ea7fe14f7a53cfabb65f62d4265b888" +checksum = "30cca6d3674597c30ddf2c587bf8d9d65c9a84d2326d941cc79c9842dfe0ef52" dependencies = [ "arrayref", "arrayvec", "cc", "cfg-if 1.0.0", "constant_time_eq", - "digest 0.10.7", -] - -[[package]] -name = "block-buffer" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" -dependencies = [ - "generic-array", ] [[package]] @@ -1582,9 +1572,9 @@ dependencies = [ [[package]] name = "borsh" -version = "1.2.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf617fabf5cdbdc92f774bfe5062d870f228b80056d41180797abf48bed4056e" +checksum = "f58b559fd6448c6e2fd0adb5720cd98a2506594cafa4737ff98c396f3e82f667" dependencies = [ "borsh-derive", "cfg_aliases", @@ -1592,23 +1582,23 @@ dependencies = [ [[package]] name = "borsh-derive" -version = "1.2.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f404657a7ea7b5249e36808dff544bc88a28f26e0ac40009f674b7a009d14be3" +checksum = "7aadb5b6ccbd078890f6d7003694e33816e6b784358f18e15e7e6d9f065a57cd" dependencies = [ "once_cell", - "proc-macro-crate 2.0.0", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.57", "syn_derive", ] [[package]] name = "brotli" -version = "3.4.0" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "516074a47ef4bce09577a3b379392300159ce5b1ba2e501ff1c819950066100f" +checksum = "d640d25bc63c50fb1f0b545ffd80207d2e10a4c965530809b40ba3386825c391" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -1617,9 +1607,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "2.5.0" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da74e2b81409b1b743f8f0c62cc6254afefb8b8e50bbfe3735550f7aeefa3448" +checksum = "4e2e4afe60d7dd600fdd3de8d0f08c2b7ec039712e3b6137ff98b7004e82de4f" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -1627,9 +1617,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.6.0" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05" +checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706" dependencies = [ "memchr", "serde", @@ -1643,9 +1633,9 @@ checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "bytecheck" -version = "0.6.11" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6372023ac861f6e6dc89c8344a8f398fb42aaba2b5dbc649ca0c0e9dbcb627" +checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" dependencies = [ "bytecheck_derive", "ptr_meta", @@ -1654,9 +1644,9 @@ dependencies = [ [[package]] name = "bytecheck_derive" -version = "0.6.11" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7ec4c6f261935ad534c0c22dbef2201b45918860eb1c574b972bd213a76af61" +checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" dependencies = [ "proc-macro2", "quote", @@ -1665,15 +1655,15 @@ dependencies = [ [[package]] name = "bytecount" -version = "0.6.4" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad152d03a2c813c80bb94fedbf3a3f02b28f793e39e7c214c8a0bcc196343de7" +checksum = "e1e5f035d16fc623ae5f74981db80a439803888314e3a555fd6f04acd51a3205" [[package]] name = "bytemuck" -version = "1.14.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" +checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15" [[package]] name = "byteorder" @@ -1693,27 +1683,27 @@ dependencies = [ [[package]] name = "bytes" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "bytes-utils" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e47d3a8076e283f3acd27400535992edb3ba4b5bb72f8891ad8fbe7932a7d4b9" +checksum = "7dafe3a8757b027e2be6e4e5601ed563c55989fcf1546e933c66c8eb3a058d35" dependencies = [ - "bytes 1.5.0", + "bytes 1.6.0", "either", ] [[package]] name = "bytestring" -version = "1.3.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "238e4886760d98c4f899360c834fa93e62cf7f721ac3c2da375cbdf4b8679aae" +checksum = "74d80203ea6b29df88012294f62733de21cfeab47f17b41af3a38bc30a03ee72" dependencies = [ - "bytes 1.5.0", + "bytes 1.6.0", ] [[package]] @@ -1742,9 +1732,9 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.3" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cfa25e60aea747ec7e1124f238816749faa93759c6ff5b31f1ccdda137f4479" +checksum = "694c8807f2ae16faecc43dc17d74b3eb042482789fd0eb64b39a2e04e087053f" dependencies = [ "serde", ] @@ -1784,9 +1774,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.0.83" +version = "1.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" dependencies = [ "jobserver", "libc", @@ -1821,17 +1811,11 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" -[[package]] -name = "checked_int_cast" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17cc5e6b5ab06331c33589842070416baa137e8b0eb912b008cfd4a78ada7919" - [[package]] name = "chrono" -version = "0.4.31" +version = "0.4.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +checksum = "8eaf5903dcbc0a39312feb77df2ff4c76387d591b9fc7b04a238dcf8bb62639a" dependencies = [ "android-tzdata", "iana-time-zone", @@ -1839,14 +1823,14 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.48.5", + "windows-targets 0.52.4", ] [[package]] name = "chrono-tz" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1369bc6b9e9a7dfdae2055f6ec151fe9c554a9d23d357c0237cee2e25eaabb7" +checksum = "d59ae0466b83e838b81a54256c39d5d7c20b9d7daa10510a242d9b75abd5936e" dependencies = [ "chrono", "chrono-tz-build", @@ -1855,9 +1839,9 @@ dependencies = [ [[package]] name = "chrono-tz-build" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2f5ebdc942f57ed96d560a6d1a459bae5851102a25d5bf89dc04ae453e31ecf" +checksum = "433e39f13c9a060046954e0592a8d0a4bcb1040125cbf91cb8ee58964cfb350f" dependencies = [ "parse-zoneinfo", "phf", @@ -1866,9 +1850,9 @@ dependencies = [ [[package]] name = "ciborium" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "effd91f6c78e5a4ace8a5d3c0b6bfaec9e2baaef55f3efc00e45fb2e477ee926" +checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" dependencies = [ "ciborium-io", "ciborium-ll", @@ -1877,15 +1861,15 @@ dependencies = [ [[package]] name = "ciborium-io" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf919175532b369853f5d5e20b26b43112613fd6fe7aee757e35f7a44642656" +checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" [[package]] name = "ciborium-ll" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defaa24ecc093c77630e6c15e17c51f5e187bf35ee514f4e2d67baaa96dae22b" +checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" dependencies = [ "ciborium-io", "half", @@ -1893,43 +1877,41 @@ dependencies = [ [[package]] name = "clap" -version = "4.3.2" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "401a4694d2bf92537b6867d94de48c4842089645fdcdf6c71865b175d836e9c2" +checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" dependencies = [ "clap_builder", "clap_derive", - "once_cell", ] [[package]] name = "clap_builder" -version = "4.3.1" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72394f3339a76daf211e57d4bcb374410f3965dcc606dd0e03738c7888766980" +checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" dependencies = [ "anstyle", - "bitflags 1.3.2", "clap_lex", ] [[package]] name = "clap_derive" -version = "4.3.2" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8cd2b2a819ad6eec39e8f1d6b53001af1e5469f8c177579cdaeb313115b825f" +checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.57", ] [[package]] name = "clap_lex" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" [[package]] name = "cloudabi" @@ -1940,12 +1922,6 @@ dependencies = [ "bitflags 1.3.2", ] -[[package]] -name = "color_quant" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" - [[package]] name = "common_enums" version = "0.1.0" @@ -1954,7 +1930,7 @@ dependencies = [ "router_derive", "serde", "serde_json", - "strum 0.25.0", + "strum 0.26.2", "utoipa", ] @@ -1963,25 +1939,25 @@ name = "common_utils" version = "0.1.0" dependencies = [ "async-trait", - "bytes 1.5.0", + "bytes 1.6.0", "common_enums", "diesel", "error-stack", "fake", - "futures 0.3.28", + "futures 0.3.30", "hex", - "http 0.2.9", + "http 0.2.12", "masking", "md5", "nanoid", "once_cell", "phonenumber", "proptest", - "quick-xml 0.28.2", - "rand 0.8.5", + "quick-xml 0.31.0", + "rand", "regex", "reqwest", - "ring 0.16.20", + "ring 0.17.8", "router_env", "rustc-hash", "semver 1.0.22", @@ -1990,30 +1966,22 @@ dependencies = [ "serde_urlencoded", "signal-hook", "signal-hook-tokio", - "strum 0.24.1", + "strum 0.26.2", "test-case", "thiserror", "time", - "tokio 1.36.0", + "tokio 1.37.0", "uuid", ] -[[package]] -name = "concurrent-queue" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f057a694a54f12365049b0958a1685bb52d567f5593b355fbf685838e873d400" -dependencies = [ - "crossbeam-utils 0.8.16", -] - [[package]] name = "config" -version = "0.13.3" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d379af7f68bfc21714c6c7dea883544201741d2ce8274bb12fa54f89507f52a7" +checksum = "7328b20597b53c2454f0b1919720c25c7339051c02b72b7e05409e00b14132be" dependencies = [ "async-trait", + "convert_case 0.6.0", "json5", "lazy_static", "nom", @@ -2022,7 +1990,7 @@ dependencies = [ "rust-ini", "serde", "serde_json", - "toml 0.5.11", + "toml", "yaml-rust", ] @@ -2032,10 +2000,10 @@ version = "0.1.0" dependencies = [ "anyhow", "clap", - "indexmap 2.1.0", + "indexmap 2.2.6", "serde", "serde_json", - "toml 0.7.4", + "toml", ] [[package]] @@ -2045,15 +2013,41 @@ dependencies = [ "api_models", "serde", "serde_with", - "toml 0.7.4", + "toml", "utoipa", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "const-random" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359" +dependencies = [ + "const-random-macro", +] + +[[package]] +name = "const-random-macro" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" +dependencies = [ + "getrandom", + "once_cell", + "tiny-keccak", +] + [[package]] name = "constant_time_eq" -version = "0.2.6" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21a53c0a4d288377e7415b53dcfc3c04da5cdc2cc95c8d5ac178b58f0b861ad6" +checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" [[package]] name = "convert_case" @@ -2061,6 +2055,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" +[[package]] +name = "convert_case" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +dependencies = [ + "unicode-segmentation", +] + [[package]] name = "cookie" version = "0.16.2" @@ -2074,9 +2077,9 @@ dependencies = [ [[package]] name = "cookie" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cd91cf61412820176e137621345ee43b3f4423e589e7ae4e50d601d93e35ef8" +checksum = "4ddef33a339a91ea89fb53151bd0a4689cfce27055c291dfa69945475d22c747" dependencies = [ "time", "version_check", @@ -2084,15 +2087,18 @@ dependencies = [ [[package]] name = "cookie-factory" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "396de984970346b0d9e93d1415082923c679e5ae5c3ee3dcbd104f5610af126b" +checksum = "9885fa71e26b8ab7855e2ec7cae6e9b380edff76cd052e07c683a0319d51b3a2" +dependencies = [ + "futures 0.3.30", +] [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -2100,15 +2106,15 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpufeatures" -version = "0.2.9" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] @@ -2136,18 +2142,18 @@ checksum = "338089f42c427b86394a5ee60ff321da23a5c89c9d89514c829687b26359fcff" [[package]] name = "crc32c" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8f48d60e5b4d2c53d5c2b1d8a58c849a70ae5e5509b08a48d047e3b65714a74" +checksum = "89254598aa9b9fa608de44b3ae54c810f0f06d755e24c50177f1f8f31ff50ce2" dependencies = [ "rustc_version 0.4.0", ] [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" dependencies = [ "cfg-if 1.0.0", ] @@ -2190,12 +2196,11 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.8" +version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" dependencies = [ - "cfg-if 1.0.0", - "crossbeam-utils 0.8.16", + "crossbeam-utils 0.8.19", ] [[package]] @@ -2211,13 +2216,12 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if 1.0.0", - "crossbeam-epoch 0.9.15", - "crossbeam-utils 0.8.16", + "crossbeam-epoch 0.9.18", + "crossbeam-utils 0.8.19", ] [[package]] @@ -2231,21 +2235,17 @@ dependencies = [ "crossbeam-utils 0.7.2", "lazy_static", "maybe-uninit", - "memoffset 0.5.6", + "memoffset", "scopeguard", ] [[package]] name = "crossbeam-epoch" -version = "0.9.15" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if 1.0.0", - "crossbeam-utils 0.8.16", - "memoffset 0.9.0", - "scopeguard", + "crossbeam-utils 0.8.19", ] [[package]] @@ -2261,12 +2261,11 @@ dependencies = [ [[package]] name = "crossbeam-queue" -version = "0.3.8" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" dependencies = [ - "cfg-if 1.0.0", - "crossbeam-utils 0.8.16", + "crossbeam-utils 0.8.19", ] [[package]] @@ -2282,12 +2281,15 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if 1.0.0", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "crypto-common" @@ -2322,12 +2324,12 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.3" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" dependencies = [ - "darling_core 0.20.3", - "darling_macro 0.20.3", + "darling_core 0.20.8", + "darling_macro 0.20.8", ] [[package]] @@ -2346,16 +2348,16 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.3" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn 2.0.55", + "syn 2.0.57", ] [[package]] @@ -2371,13 +2373,13 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.3" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" +checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" dependencies = [ - "darling_core 0.20.3", + "darling_core 0.20.8", "quote", - "syn 2.0.55", + "syn 2.0.57", ] [[package]] @@ -2388,16 +2390,16 @@ checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if 1.0.0", "hashbrown 0.14.3", - "lock_api 0.4.10", + "lock_api 0.4.11", "once_cell", - "parking_lot_core 0.9.8", + "parking_lot_core 0.9.9", ] [[package]] name = "data-encoding" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "data_models" @@ -2418,15 +2420,14 @@ dependencies = [ [[package]] name = "deadpool" -version = "0.9.5" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "421fe0f90f2ab22016f32a9881be5134fdd71c65298917084b0c7477cbc3856e" +checksum = "fb84100978c1c7b37f09ed3ce3e5f843af02c2a2c431bae5b19230dad2c1b490" dependencies = [ "async-trait", "deadpool-runtime", "num_cpus", - "retain_mut", - "tokio 1.36.0", + "tokio 1.37.0", ] [[package]] @@ -2436,20 +2437,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63dfa964fe2a66f3fde91fc70b267fe193d822c7e603e2a675a49a7f46ad3f49" [[package]] -name = "deflate" -version = "0.8.6" +name = "der" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73770f8e1fe7d64df17ca66ad28994a0a623ea497fa69486e14984e715c5d174" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" dependencies = [ - "adler32", - "byteorder", + "const-oid", + "pem-rfc7468", + "zeroize", ] [[package]] name = "der-parser" -version = "8.2.0" +version = "9.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" +checksum = "5cd0a5c643689626bec213c4d8bd4d96acc8ffdb4ad4bb6bc16abf27d5f4b553" dependencies = [ "asn1-rs", "displaydoc", @@ -2459,6 +2461,16 @@ dependencies = [ "rusticata-macros", ] +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", + "serde", +] + [[package]] name = "derive_builder" version = "0.12.0" @@ -2507,7 +2519,7 @@ version = "0.99.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ - "convert_case", + "convert_case 0.4.0", "proc-macro2", "quote", "rustc_version 0.4.0", @@ -2516,17 +2528,17 @@ dependencies = [ [[package]] name = "deunicode" -version = "0.4.4" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95203a6a50906215a502507c0f879a0ce7ff205a6111e2db2a5ef8e4bb92e43" +checksum = "b6e854126756c496b8c81dec88f9a706b15b875c5849d4097a3854476b9fdf94" [[package]] name = "diesel" -version = "2.1.3" +version = "2.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2268a214a6f118fce1838edba3d1561cf0e78d8de785475957a580a7f8c69d33" +checksum = "03fc05c17098f21b89bc7d98fe1dd3cce2c11c2ad8e145f2a44fe08ed28eb559" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.5.0", "byteorder", "diesel_derives", "itoa", @@ -2538,14 +2550,14 @@ dependencies = [ [[package]] name = "diesel_derives" -version = "2.1.2" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef8337737574f55a468005a83499da720f20c65586241ffea339db9ecdfd2b44" +checksum = "5d02eecb814ae714ffe61ddc2db2dd03e6c49a42e269b5001355500d431cce0c" dependencies = [ "diesel_table_macro_syntax", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.57", ] [[package]] @@ -2564,7 +2576,7 @@ dependencies = [ "router_env", "serde", "serde_json", - "strum 0.24.1", + "strum 0.26.2", "thiserror", "time", ] @@ -2575,16 +2587,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5" dependencies = [ - "syn 2.0.55", -] - -[[package]] -name = "digest" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array", + "syn 2.0.57", ] [[package]] @@ -2593,7 +2596,8 @@ version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.4", + "block-buffer", + "const-oid", "crypto-common", "subtle", ] @@ -2604,26 +2608,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af83450b771231745d43edf36dc9b7813ab83be5e8cbea344ccced1a09dfebcd" -[[package]] -name = "dirs" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-sys" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" -dependencies = [ - "libc", - "redox_users", - "winapi 0.3.9", -] - [[package]] name = "displaydoc" version = "0.2.4" @@ -2632,14 +2616,17 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.57", ] [[package]] name = "dlv-list" -version = "0.3.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0688c2a7f92e427f44895cd63841bff7b29f8d7a1648b9e7e07a4a365b2e1257" +checksum = "442039f5147480ba31067cb00ada1adae6892028e40e45fc5de7b7df6dcc1b5f" +dependencies = [ + "const-random", +] [[package]] name = "dotenvy" @@ -2673,20 +2660,23 @@ dependencies = [ "serde_json", "serde_path_to_error", "thiserror", - "tokio 1.36.0", + "tokio 1.37.0", ] [[package]] name = "dyn-clone" -version = "1.0.14" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d2f3407d9a573d666de4b5bdf10569d73ca9478087346697dcbae6244bfbcd" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "either" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +dependencies = [ + "serde", +] [[package]] name = "encoding_rs" @@ -2705,9 +2695,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "erased-serde" -version = "0.3.31" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c138974f9d5e7fe373eb04df7cae98833802ae4b11c24ac7039a21d5af4b26c" +checksum = "2b73807008a3c7f171cc40312f37d95ef0396e048b5848d775f54b1a4dd4a0d3" dependencies = [ "serde", ] @@ -2742,6 +2732,17 @@ dependencies = [ "serde", ] +[[package]] +name = "etcetera" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943" +dependencies = [ + "cfg-if 1.0.0", + "home", + "windows-sys 0.48.0", +] + [[package]] name = "euclid" version = "0.1.0" @@ -2757,7 +2758,7 @@ dependencies = [ "rustc-hash", "serde", "serde_json", - "strum 0.25.0", + "strum 0.26.2", "thiserror", "utoipa", ] @@ -2769,8 +2770,8 @@ dependencies = [ "proc-macro2", "quote", "rustc-hash", - "strum 0.24.1", - "syn 1.0.109", + "strum 0.26.2", + "syn 2.0.57", ] [[package]] @@ -2782,13 +2783,13 @@ dependencies = [ "connector_configs", "currency_conversion", "euclid", - "getrandom 0.2.11", + "getrandom", "kgraph_utils", "once_cell", "ron-parser", "serde", - "serde-wasm-bindgen", - "strum 0.25.0", + "serde-wasm-bindgen 0.6.5", + "strum 0.26.2", "wasm-bindgen", ] @@ -2809,12 +2810,12 @@ dependencies = [ "aws-sdk-sesv2", "aws-sdk-sts 0.28.0", "aws-smithy-client", - "base64 0.21.5", + "base64 0.22.0", "common_utils", "dyn-clone", "error-stack", "hex", - "hyper", + "hyper 0.14.28", "hyper-proxy", "hyperswitch_interfaces", "masking", @@ -2822,18 +2823,18 @@ dependencies = [ "router_env", "serde", "thiserror", - "tokio 1.36.0", + "tokio 1.37.0", "vaultrs", ] [[package]] name = "fake" -version = "2.8.0" +version = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9af7b0c58ac9d03169e27f080616ce9f64004edca3d2ef4147a811c21b23b319" +checksum = "1c25829bde82205da46e1823b2259db6273379f626fc211f126f65654a2669be" dependencies = [ - "rand 0.8.5", - "unidecode", + "deunicode", + "rand", ] [[package]] @@ -2846,14 +2847,14 @@ dependencies = [ "cookie 0.16.2", "futures-core", "futures-util", - "http 0.2.9", - "hyper", + "http 0.2.12", + "hyper 0.14.28", "hyper-rustls 0.23.2", "mime", "serde", "serde_json", "time", - "tokio 1.36.0", + "tokio 1.37.0", "url", "webdriver", ] @@ -2869,9 +2870,18 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.1" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" + +[[package]] +name = "fdeflate" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "4f9bfee30e4dedf0ab8b422f03af778d9612b63f502710fc500a334ebe2de645" +dependencies = [ + "simd-adler32", +] [[package]] name = "finl_unicode" @@ -2881,12 +2891,12 @@ checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" [[package]] name = "flate2" -version = "1.0.27" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", - "miniz_oxide 0.7.1", + "miniz_oxide", ] [[package]] @@ -2899,8 +2909,19 @@ dependencies = [ ] [[package]] -name = "fnv" -version = "1.0.7" +name = "flume" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" +dependencies = [ + "futures-core", + "futures-sink", + "spin 0.9.8", +] + +[[package]] +name = "fnv" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" @@ -2921,9 +2942,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -2936,18 +2957,18 @@ checksum = "b99c2b48934cd02a81032dd7428b7ae831a27794275bc94eba367418db8a9e55" dependencies = [ "arc-swap", "async-trait", - "bytes 1.5.0", + "bytes 1.6.0", "bytes-utils", "float-cmp", - "futures 0.3.28", + "futures 0.3.30", "lazy_static", "log", "parking_lot 0.12.1", - "rand 0.8.5", + "rand", "redis-protocol", "semver 1.0.22", - "socket2 0.5.5", - "tokio 1.36.0", + "socket2", + "tokio 1.37.0", "tokio-stream", "tokio-util", "tracing", @@ -2981,7 +3002,7 @@ checksum = "b0fa992f1656e1707946bbba340ad244f0814009ef8c0118eb7b658395f19a2e" dependencies = [ "frunk_proc_macro_helpers", "quote", - "syn 2.0.55", + "syn 2.0.57", ] [[package]] @@ -2993,7 +3014,7 @@ dependencies = [ "frunk_core", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.57", ] [[package]] @@ -3005,7 +3026,7 @@ dependencies = [ "frunk_core", "frunk_proc_macro_helpers", "quote", - "syn 2.0.55", + "syn 2.0.57", ] [[package]] @@ -3038,9 +3059,9 @@ checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" [[package]] name = "futures" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -3069,9 +3090,9 @@ checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -3080,13 +3101,13 @@ dependencies = [ [[package]] name = "futures-intrusive" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a604f7a68fbf8103337523b1fadc8ade7361ee3f112f7c680ad179651616aed5" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" dependencies = [ "futures-core", - "lock_api 0.4.10", - "parking_lot 0.11.2", + "lock_api 0.4.11", + "parking_lot 0.12.1", ] [[package]] @@ -3095,21 +3116,6 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" -[[package]] -name = "futures-lite" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" -dependencies = [ - "fastrand 1.9.0", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite", - "waker-fn", -] - [[package]] name = "futures-macro" version = "0.3.30" @@ -3118,7 +3124,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.57", ] [[package]] @@ -3133,12 +3139,6 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" -[[package]] -name = "futures-timer" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" - [[package]] name = "futures-util" version = "0.3.30" @@ -3179,51 +3179,30 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.1.16" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "wasi 0.9.0+wasi-snapshot-preview1", -] - -[[package]] -name = "getrandom" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if 1.0.0", "js-sys", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "wasm-bindgen", ] -[[package]] -name = "gif" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3edd93c6756b4dfaf2709eafcc345ba2636565295c198a9cfbf75fa5e3e00b06" -dependencies = [ - "color_quant", - "weezl", -] - [[package]] name = "gimli" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "git2" -version = "0.17.2" +version = "0.18.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b989d6a7ca95a362cf2cfc5ad688b3a467be1f87e480b8dad07fee8c79b0044" +checksum = "232e6a7bfe35766bf715e55a88b39a700596c0ccfd88cd3680b4cdb40d66ef70" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", "libc", "libgit2-sys", "log", @@ -3238,15 +3217,15 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "globset" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759c97c1e17c55525b57192c06a267cda0ac5210b222d6b82189a2338fa1c13d" +checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" dependencies = [ "aho-corasick", "bstr", - "fnv", "log", - "regex", + "regex-automata 0.4.6", + "regex-syntax 0.8.3", ] [[package]] @@ -3262,28 +3241,51 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.24" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fbd2820c5e49886948654ab546d0688ff24530286bdcf8fca3cefb16d4618eb" +dependencies = [ + "bytes 1.6.0", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http 0.2.12", + "indexmap 2.2.6", + "slab", + "tokio 1.37.0", + "tokio-util", + "tracing", +] + +[[package]] +name = "h2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" +checksum = "51ee2dd2e4f378392eeff5d51618cd9a63166a2513846bbc55f21cfacd9199d4" dependencies = [ - "bytes 1.5.0", + "bytes 1.6.0", "fnv", "futures-core", "futures-sink", "futures-util", - "http 0.2.9", - "indexmap 2.1.0", + "http 1.1.0", + "indexmap 2.2.6", "slab", - "tokio 1.36.0", + "tokio 1.37.0", "tokio-util", "tracing", ] [[package]] name = "half" -version = "1.8.2" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" +checksum = "b5eceaaeec696539ddaf7b333340f1af35a5aa87ae3e4f3ead0532f72affab2e" +dependencies = [ + "cfg-if 1.0.0", + "crunchy", +] [[package]] name = "hashbrown" @@ -3291,16 +3293,22 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash 0.7.7", + "ahash 0.7.8", ] +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" + [[package]] name = "hashbrown" version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.11", "allocator-api2", ] @@ -3319,10 +3327,10 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" dependencies = [ - "base64 0.21.5", - "bytes 1.5.0", + "base64 0.21.7", + "bytes 1.6.0", "headers-core", - "http 0.2.9", + "http 0.2.12", "httpdate", "mime", "sha1", @@ -3334,7 +3342,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" dependencies = [ - "http 0.2.9", + "http 0.2.12", ] [[package]] @@ -3348,9 +3356,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hex" @@ -3360,9 +3368,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hkdf" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" dependencies = [ "hmac", ] @@ -3373,16 +3381,25 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.7", + "digest", +] + +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", ] [[package]] name = "http" -version = "0.2.9" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ - "bytes 1.5.0", + "bytes 1.6.0", "fnv", "itoa", ] @@ -3393,41 +3410,43 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ - "bytes 1.5.0", + "bytes 1.6.0", "fnv", "itoa", ] [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ - "bytes 1.5.0", - "http 0.2.9", + "bytes 1.6.0", + "http 0.2.12", "pin-project-lite", ] [[package]] -name = "http-types" -version = "2.12.0" +name = "http-body" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e9b187a72d63adbfba487f48095306ac823049cb504ee195541e91c7775f5ad" +checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" dependencies = [ - "anyhow", - "async-channel", - "base64 0.13.1", - "futures-lite", - "http 0.2.9", - "infer 0.2.3", + "bytes 1.6.0", + "http 1.1.0", +] + +[[package]] +name = "http-body-util" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" +dependencies = [ + "bytes 1.6.0", + "futures-core", + "http 1.1.0", + "http-body 1.0.0", "pin-project-lite", - "rand 0.7.3", - "serde", - "serde_json", - "serde_qs 0.8.5", - "serde_urlencoded", - "url", ] [[package]] @@ -3453,42 +3472,63 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.27" +version = "0.14.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" dependencies = [ - "bytes 1.5.0", + "bytes 1.6.0", "futures-channel", "futures-core", "futures-util", - "h2", - "http 0.2.9", - "http-body", + "h2 0.3.25", + "http 0.2.12", + "http-body 0.4.6", "httparse", "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.9", - "tokio 1.36.0", + "socket2", + "tokio 1.37.0", "tower-service", "tracing", "want", ] +[[package]] +name = "hyper" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "186548d73ac615b32a73aafe38fb4f56c0d340e110e5a200bcadbaf2e199263a" +dependencies = [ + "bytes 1.6.0", + "futures-channel", + "futures-util", + "h2 0.4.3", + "http 1.1.0", + "http-body 1.0.0", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "smallvec 1.13.2", + "tokio 1.37.0", + "want", +] + [[package]] name = "hyper-proxy" version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca815a891b24fdfb243fa3239c86154392b0953ee584aa1a2a1f66d20cbe75cc" dependencies = [ - "bytes 1.5.0", - "futures 0.3.28", + "bytes 1.6.0", + "futures 0.3.30", "headers", - "http 0.2.9", - "hyper", + "http 0.2.12", + "hyper 0.14.28", "hyper-tls", "native-tls", - "tokio 1.36.0", + "tokio 1.37.0", "tokio-native-tls", "tower-service", ] @@ -3499,12 +3539,12 @@ version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" dependencies = [ - "http 0.2.9", - "hyper", + "http 0.2.12", + "hyper 0.14.28", "log", "rustls 0.20.9", "rustls-native-certs", - "tokio 1.36.0", + "tokio 1.37.0", "tokio-rustls 0.23.4", ] @@ -3515,12 +3555,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", - "http 0.2.9", - "hyper", + "http 0.2.12", + "hyper 0.14.28", "log", "rustls 0.21.10", "rustls-native-certs", - "tokio 1.36.0", + "tokio 1.37.0", "tokio-rustls 0.24.1", ] @@ -3530,9 +3570,9 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" dependencies = [ - "hyper", + "hyper 0.14.28", "pin-project-lite", - "tokio 1.36.0", + "tokio 1.37.0", "tokio-io-timeout", ] @@ -3542,13 +3582,29 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ - "bytes 1.5.0", - "hyper", + "bytes 1.6.0", + "hyper 0.14.28", "native-tls", - "tokio 1.36.0", + "tokio 1.37.0", "tokio-native-tls", ] +[[package]] +name = "hyper-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" +dependencies = [ + "bytes 1.6.0", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "hyper 1.2.0", + "pin-project-lite", + "socket2", + "tokio 1.37.0", +] + [[package]] name = "hyperswitch_interfaces" version = "0.1.0" @@ -3563,9 +3619,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.58" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -3592,9 +3648,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -3602,38 +3658,30 @@ dependencies = [ [[package]] name = "ignore" -version = "0.4.20" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbe7873dab538a9a44ad79ede1faf5f30d49f9a5c883ddbab48bce81b64b7492" +checksum = "b46810df39e66e925525d6e38ce1e7f6e1d208f72dc39757880fcb66e2c58af1" dependencies = [ + "crossbeam-deque 0.8.5", "globset", - "lazy_static", "log", "memchr", - "regex", + "regex-automata 0.4.6", "same-file", - "thread_local", "walkdir", "winapi-util", ] [[package]] name = "image" -version = "0.23.14" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24ffcb7e7244a9bf19d35bf2883b9c080c4ced3c07a9895572178cdb8f13f6a1" +checksum = "fd54d660e773627692c524beaad361aca785a4f9f5730ce91f42aabe5bce3d11" dependencies = [ "bytemuck", "byteorder", - "color_quant", - "gif", - "jpeg-decoder", - "num-iter", - "num-rational", "num-traits", "png", - "scoped_threadpool", - "tiff", ] [[package]] @@ -3655,9 +3703,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.1.0" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", "hashbrown 0.14.3", @@ -3666,15 +3714,9 @@ dependencies = [ [[package]] name = "infer" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e9829a50b42bb782c1df523f78d332fe371b10c661e78b7a3c34b0198e9fac" - -[[package]] -name = "infer" -version = "0.13.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f551f8c3a39f68f986517db0d1759de85881894fdc7db798bd2a9df9cb04b7fc" +checksum = "cb33622da908807a06f9513c19b3c1ad50fab3e4137d82a78107d502075aa199" dependencies = [ "cfb", ] @@ -3699,19 +3741,19 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-terminal" -version = "0.4.9" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ "hermit-abi", - "rustix", - "windows-sys 0.48.0", + "libc", + "windows-sys 0.52.0", ] [[package]] @@ -3760,29 +3802,38 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jobserver" -version = "0.1.26" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" dependencies = [ "libc", ] [[package]] name = "josekit" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33a96c4f2128a6f44ecf7c36df2b03dddf5a07b060a4d5ebc0a81e9821f7c60e" +checksum = "0953340cf63354cec4a385f1fbcb3f409a5823778cae236078892f6030ed4565" dependencies = [ "anyhow", - "base64 0.21.5", + "base64 0.21.7", "flate2", "once_cell", "openssl", @@ -3793,20 +3844,11 @@ dependencies = [ "time", ] -[[package]] -name = "jpeg-decoder" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "229d53d58899083193af11e15917b5640cd40b29ff475a1fe4ef725deb02d0f2" -dependencies = [ - "rayon", -] - [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -3824,13 +3866,14 @@ dependencies = [ [[package]] name = "jsonwebtoken" -version = "8.3.0" +version = "9.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378" +checksum = "5c7ea04a7c5c055c175f189b6dc6ba036fd62306b58c66c9f6389036c503a3f4" dependencies = [ - "base64 0.21.5", + "base64 0.21.7", + "js-sys", "pem", - "ring 0.16.20", + "ring 0.17.8", "serde", "serde_json", "simple_asn1", @@ -3871,18 +3914,21 @@ name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +dependencies = [ + "spin 0.5.2", +] [[package]] name = "libc" -version = "0.2.150" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libgit2-sys" -version = "0.15.2+1.6.4" +version = "0.16.2+1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a80df2e11fb4a61f4ba2ab42dbe7f74468da143f1a75c74e11dee7c813f694fa" +checksum = "ee4126d8b4ee5c9d9ea891dd875cfdc1e9d0950437179104b183d7d8a74d24e8" dependencies = [ "cc", "libc", @@ -3906,11 +3952,22 @@ dependencies = [ "libc", ] +[[package]] +name = "libsqlite3-sys" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4e226dcd58b4be396f7bd3c20da8fdee2911400705297ba7d2d7cc2c30f716" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] + [[package]] name = "libz-sys" -version = "1.1.12" +version = "1.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97137b25e321a73eef1418d1d5d2eda4d77e12813f8e6dead84bc52c5870a7b" +checksum = "5e143b5e666b2695d28f6bca6497720813f699c9602dd7f5cac91008b8ada7f9" dependencies = [ "cc", "libc", @@ -3932,9 +3989,9 @@ checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "local-channel" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a493488de5f18c8ffcba89eebb8532ffc562dc400490eb65b84893fae0b178" +checksum = "b6cbc85e69b8df4b8bb8b89ec634e7189099cea8927a276b7384ce5488e53ec8" dependencies = [ "futures-core", "futures-sink", @@ -3943,9 +4000,9 @@ dependencies = [ [[package]] name = "local-waker" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e34f76eb3611940e0e7d53a9aaa4e6a3151f69541a282fd0dad5571420c53ff1" +checksum = "4d873d7c67ce09b42110d801813efbc9364414e356be9935700d368351657487" [[package]] name = "lock_api" @@ -3958,9 +4015,9 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", @@ -3968,9 +4025,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "lru-cache" @@ -3990,20 +4047,11 @@ dependencies = [ "digits_iterator", ] -[[package]] -name = "mach2" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d0d1830bcd151a6fc4aea1369af235b36c1528fe976b8ff678683c9995eade8" -dependencies = [ - "libc", -] - [[package]] name = "masking" version = "0.1.0" dependencies = [ - "bytes 1.5.0", + "bytes 1.6.0", "diesel", "erased-serde", "serde", @@ -4029,9 +4077,9 @@ checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" [[package]] name = "maud" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0bab19cef8a7fe1c18a43e881793bfc9d4ea984befec3ae5bd0415abf3ecf00" +checksum = "df518b75016b4289cdddffa1b01f2122f4a49802c93191f3133f6dc2472ebcaa" dependencies = [ "actix-web", "futures-util", @@ -4041,14 +4089,14 @@ dependencies = [ [[package]] name = "maud_macros" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0be95d66c3024ffce639216058e5bae17a83ecaf266ffc6e4d060ad447c9eed2" +checksum = "fa453238ec218da0af6b11fc5978d3b5c3a45ed97b722391a2a11f3306274e18" dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.57", ] [[package]] @@ -4064,7 +4112,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" dependencies = [ "cfg-if 1.0.0", - "digest 0.10.7", + "digest", ] [[package]] @@ -4075,9 +4123,9 @@ checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "memoffset" @@ -4088,15 +4136,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "memoffset" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] - [[package]] name = "mimalloc" version = "0.1.39" @@ -4130,30 +4169,12 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791daaae1ed6889560f8c4359194f56648355540573244a5448a83ba1ecc7435" -dependencies = [ - "adler32", -] - -[[package]] -name = "miniz_oxide" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" -dependencies = [ - "adler", - "autocfg", -] - -[[package]] -name = "miniz_oxide" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", + "simd-adler32", ] [[package]] @@ -4177,13 +4198,13 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "log", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "windows-sys 0.48.0", ] @@ -4212,22 +4233,22 @@ dependencies = [ [[package]] name = "moka" -version = "0.12.1" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8017ec3548ffe7d4cef7ac0e12b044c01164a74c0f3119420faeaf13490ad8b" +checksum = "b1911e88d5831f748a4097a43862d129e3c6fca831eecac9b8db6d01d93c9de2" dependencies = [ "async-lock", "async-trait", "crossbeam-channel", - "crossbeam-epoch 0.9.15", - "crossbeam-utils 0.8.16", + "crossbeam-epoch 0.9.18", + "crossbeam-utils 0.8.19", "futures-util", "once_cell", "parking_lot 0.12.1", "quanta", "rustc_version 0.4.0", "skeptic", - "smallvec 1.11.1", + "smallvec 1.13.2", "tagptr", "thiserror", "triomphe", @@ -4246,7 +4267,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ffa00dec017b5b1a8b7cf5e2c008bfda1aa7e0697ac1508b491fdf2622fb4d8" dependencies = [ - "rand 0.8.5", + "rand", ] [[package]] @@ -4278,6 +4299,18 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "nix" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" +dependencies = [ + "bitflags 2.5.0", + "cfg-if 1.0.0", + "cfg_aliases", + "libc", +] + [[package]] name = "nom" version = "7.1.3" @@ -4310,31 +4343,42 @@ dependencies = [ ] [[package]] -name = "num-integer" -version = "0.1.45" +name = "num-bigint-dig" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" dependencies = [ - "autocfg", + "byteorder", + "lazy_static", + "libm", + "num-integer", + "num-iter", "num-traits", + "rand", + "smallvec 1.13.2", + "zeroize", ] [[package]] -name = "num-iter" -version = "0.1.43" +name = "num-conv" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", - "num-integer", "num-traits", ] [[package]] -name = "num-rational" -version = "0.3.2" +name = "num-iter" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" +checksum = "d869c01cc0c455284163fd0092f1f93835385ccab5a98a0dcc497b2f8bf055a9" dependencies = [ "autocfg", "num-integer", @@ -4343,9 +4387,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", "libm", @@ -4382,29 +4426,38 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "num_threads" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" +dependencies = [ + "libc", +] + [[package]] name = "object" -version = "0.32.1" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] [[package]] name = "oid-registry" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" +checksum = "1c958dd45046245b9c3c2547369bb634eb461670b2e7e0de552905801a648d1d" dependencies = [ "asn1-rs", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "oncemutex" @@ -4418,12 +4471,6 @@ version = "11.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" -[[package]] -name = "opaque-debug" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" - [[package]] name = "openapi" version = "0.1.0" @@ -4443,8 +4490,8 @@ dependencies = [ "aws-sigv4 1.2.0", "aws-smithy-runtime-api", "aws-types 1.1.8", - "base64 0.21.5", - "bytes 1.5.0", + "base64 0.21.7", + "bytes 1.6.0", "dyn-clone", "lazy_static", "percent-encoding", @@ -4459,11 +4506,11 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.60" +version = "0.10.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79a4c6c3a2b158f7f8f2a2fc5a969fa3a068df6fc9dbb4a43845436e3af7c800" +checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.5.0", "cfg-if 1.0.0", "foreign-types", "libc", @@ -4480,7 +4527,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.57", ] [[package]] @@ -4491,9 +4538,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.96" +version = "0.9.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3812c071ba60da8b5677cc12bcb1d42989a65553772897a7e0355545a819838f" +checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" dependencies = [ "cc", "libc", @@ -4518,14 +4565,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8af72d59a4484654ea8eb183fea5ae4eb6a41d7ac3e3bae5f4d2a282a3a7d3ca" dependencies = [ "async-trait", - "futures 0.3.28", + "futures 0.3.30", "futures-util", - "http 0.2.9", + "http 0.2.12", "opentelemetry", "opentelemetry-proto", "prost", "thiserror", - "tokio 1.36.0", + "tokio 1.37.0", "tonic", ] @@ -4535,7 +4582,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "045f8eea8c0fa19f7d48e7bc3128a39c2e5c533d5c61298c548dfefc1064474c" dependencies = [ - "futures 0.3.28", + "futures 0.3.30", "futures-util", "opentelemetry", "prost", @@ -4574,20 +4621,20 @@ dependencies = [ "once_cell", "opentelemetry_api", "percent-encoding", - "rand 0.8.5", + "rand", "thiserror", - "tokio 1.36.0", + "tokio 1.37.0", "tokio-stream", ] [[package]] name = "ordered-multimap" -version = "0.4.3" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccd746e37177e1711c20dd619a1620f34f5c8b569c53590a72dedd5344d8924a" +checksum = "4ed8acf08e98e744e5384c8bc63ceb0364e68a6854187221c18df61c4797690e" dependencies = [ "dlv-list", - "hashbrown 0.12.3", + "hashbrown 0.13.2", ] [[package]] @@ -4602,12 +4649,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" -[[package]] -name = "parking" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e52c774a4c39359c1d1c52e43f73dd91a75a614652c825408eec30c95a9b2067" - [[package]] name = "parking_lot" version = "0.9.0" @@ -4619,25 +4660,14 @@ dependencies = [ "rustc_version 0.2.3", ] -[[package]] -name = "parking_lot" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" -dependencies = [ - "instant", - "lock_api 0.4.10", - "parking_lot_core 0.8.6", -] - [[package]] name = "parking_lot" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ - "lock_api 0.4.10", - "parking_lot_core 0.9.8", + "lock_api 0.4.11", + "parking_lot_core 0.9.9", ] [[package]] @@ -4657,28 +4687,14 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" -dependencies = [ - "cfg-if 1.0.0", - "instant", - "libc", - "redox_syscall 0.2.16", - "smallvec 1.11.1", - "winapi 0.3.9", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.8" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if 1.0.0", "libc", - "redox_syscall 0.3.5", - "smallvec 1.11.1", + "redox_syscall 0.4.1", + "smallvec 1.13.2", "windows-targets 0.48.5", ] @@ -4704,7 +4720,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" dependencies = [ "base64ct", - "rand_core 0.6.4", + "rand_core", "subtle", ] @@ -4721,25 +4737,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" [[package]] -name = "pem" -version = "1.1.1" +name = "pem" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b8fcc794035347fb64beda2d3b462595dd2753e3f268d89c5aae77e8cf2c310" +dependencies = [ + "base64 0.21.7", + "serde", +] + +[[package]] +name = "pem-rfc7468" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" dependencies = [ - "base64 0.13.1", + "base64ct", ] [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.4" +version = "2.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c022f1e7b65d6a24c0dbbd5fb344c66881bc01f3e5ae74a1c8100f2f985d98a4" +checksum = "56f8023d0fb78c8e03784ea1c7f3fa36e68a723138990b8d5a47d916b651e7a8" dependencies = [ "memchr", "thiserror", @@ -4748,9 +4774,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.4" +version = "2.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35513f630d46400a977c4cb58f78e1bfbe01434316e60c37d27b9ad6139c66d8" +checksum = "b0d24f72393fd16ab6ac5738bc33cdb6a9aa73f8b902e8fe29cf4e67d7dd1026" dependencies = [ "pest", "pest_generator", @@ -4758,22 +4784,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.4" +version = "2.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc9fc1b9e7057baba189b5c626e2d6f40681ae5b6eb064dc7c7834101ec8123a" +checksum = "fdc17e2a6c7d0a492f0158d7a4bd66cc17280308bbaff78d5bef566dca35ab80" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.57", ] [[package]] name = "pest_meta" -version = "2.7.4" +version = "2.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df74e9e7ec4053ceb980e7c0c8bd3594e977fde1af91daba9c928e8e8c6708d" +checksum = "934cd7631c050f4674352a6e835d5f6711ffbfb9345c2fc0107155ac495ae293" dependencies = [ "once_cell", "pest", @@ -4806,7 +4832,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" dependencies = [ "phf_shared", - "rand 0.8.5", + "rand", ] [[package]] @@ -4841,29 +4867,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.3" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.3" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.57", ] [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -4871,11 +4897,32 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "pkcs1" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" +dependencies = [ + "der", + "pkcs8", + "spki", +] + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "plotters" @@ -4911,33 +4958,40 @@ version = "0.1.0" dependencies = [ "api_models", "async-trait", - "bytes 1.5.0", + "bytes 1.6.0", "common_enums", "common_utils", "error-stack", - "http 0.2.9", + "http 0.2.12", "masking", "mime", "router_derive", "router_env", "serde", "serde_json", - "strum 0.24.1", + "strum 0.26.2", "thiserror", ] [[package]] name = "png" -version = "0.16.8" +version = "0.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c3287920cb847dee3de33d301c463fba14dda99db24214ddf93f83d3021f4c6" +checksum = "06e4b0d3d1312775e782c86c91a111aa1f910cbb65e1337f9975b5f9a554b5e1" dependencies = [ "bitflags 1.3.2", "crc32fast", - "deflate", - "miniz_oxide 0.3.7", + "fdeflate", + "flate2", + "miniz_oxide", ] +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -4960,16 +5014,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ "once_cell", - "toml_edit 0.19.14", + "toml_edit 0.19.15", ] [[package]] name = "proc-macro-crate" -version = "2.0.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" dependencies = [ - "toml_edit 0.20.2", + "toml_edit 0.21.1", ] [[package]] @@ -5007,19 +5061,19 @@ dependencies = [ [[package]] name = "proptest" -version = "1.3.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c003ac8c77cb07bb74f5f198bce836a689bcd5a42574612bf14d17bfd08c20e" +checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" dependencies = [ "bit-set", "bit-vec", - "bitflags 2.4.0", + "bitflags 2.5.0", "lazy_static", "num-traits", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand", + "rand_chacha", "rand_xorshift", - "regex-syntax 0.7.5", + "regex-syntax 0.8.3", "rusty-fork", "tempfile", "unarray", @@ -5031,7 +5085,7 @@ version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" dependencies = [ - "bytes 1.5.0", + "bytes 1.6.0", "prost-derive", ] @@ -5070,37 +5124,35 @@ dependencies = [ [[package]] name = "pulldown-cmark" -version = "0.9.3" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a1a2f1f0a7ecff9c31abbe177637be0e97a0aef46cf8738ece09327985d998" +checksum = "57206b407293d2bcd3af849ce869d52068623f19e1b5ff8e8778e3309439682b" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", "memchr", "unicase", ] [[package]] name = "qrcode" -version = "0.12.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16d2f1455f3630c6e5107b4f2b94e74d76dea80736de0981fd27644216cff57f" +checksum = "23e719ca51966ff9f5a8436edb00d6115b3c606a0bb27c8f8ca74a38ff2b036d" dependencies = [ - "checked_int_cast", "image", ] [[package]] name = "quanta" -version = "0.11.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17e662a7a8291a865152364c20c7abc5e60486ab2001e8ec10b24862de0b9ab" +checksum = "9ca0b7bac0b97248c40bb77288fc52029cf1459c0461ea1b05ee32ccf011de2c" dependencies = [ - "crossbeam-utils 0.8.16", + "crossbeam-utils 0.8.19", "libc", - "mach2", "once_cell", "raw-cpuid", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "web-sys", "winapi 0.3.9", ] @@ -5118,7 +5170,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ce5e73202a820a31f8a0ee32ada5e21029c81fd9e3ebf668a40832e4219d9d1" dependencies = [ "memchr", - "serde", ] [[package]] @@ -5157,19 +5208,6 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom 0.1.16", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc", -] - [[package]] name = "rand" version = "0.8.5" @@ -5177,18 +5215,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", + "rand_chacha", + "rand_core", ] [[package]] @@ -5198,16 +5226,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -dependencies = [ - "getrandom 0.1.16", + "rand_core", ] [[package]] @@ -5216,16 +5235,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.11", -] - -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core 0.5.1", + "getrandom", ] [[package]] @@ -5234,23 +5244,23 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" dependencies = [ - "rand_core 0.6.4", + "rand_core", ] [[package]] name = "raw-cpuid" -version = "10.7.0" +version = "11.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c297679cb867470fa8c9f67dbba74a78d78e3e98d7cf2b08d6d71540f797332" +checksum = "9d86a7c4638d42c44551f4791a20e687dbb4c3de1f33c43dd71e355cd429def1" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", ] [[package]] name = "rayon" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ "either", "rayon-core", @@ -5258,19 +5268,19 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.12.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ - "crossbeam-deque 0.8.3", - "crossbeam-utils 0.8.16", + "crossbeam-deque 0.8.5", + "crossbeam-utils 0.8.19", ] [[package]] name = "rdkafka" -version = "0.36.0" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54f02a5a40220f8a2dfa47ddb38ba9064475a5807a69504b6f91711df2eea63" +checksum = "1beea247b9a7600a81d4cc33f659ce1a77e1988323d7d2809c7ed1c21f4c316d" dependencies = [ "futures-channel", "futures-util", @@ -5281,7 +5291,7 @@ dependencies = [ "serde_derive", "serde_json", "slab", - "tokio 1.36.0", + "tokio 1.37.0", ] [[package]] @@ -5302,7 +5312,7 @@ version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c31deddf734dc0a39d3112e73490e88b61a05e83e074d211f348404cee4d2c6" dependencies = [ - "bytes 1.5.0", + "bytes 1.6.0", "bytes-utils", "cookie-factory", "crc16", @@ -5317,11 +5327,11 @@ dependencies = [ "common_utils", "error-stack", "fred", - "futures 0.3.28", + "futures 0.3.30", "router_env", "serde", "thiserror", - "tokio 1.36.0", + "tokio 1.37.0", "tokio-stream", ] @@ -5333,43 +5343,23 @@ checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" [[package]] name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.3.5" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ "bitflags 1.3.2", ] -[[package]] -name = "redox_users" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" -dependencies = [ - "getrandom 0.2.11", - "redox_syscall 0.2.16", - "thiserror", -] - [[package]] name = "regex" -version = "1.10.3" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.5", - "regex-syntax 0.8.2", + "regex-automata 0.4.6", + "regex-syntax 0.8.3", ] [[package]] @@ -5383,13 +5373,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.2", + "regex-syntax 0.8.3", ] [[package]] @@ -5418,41 +5408,35 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" - -[[package]] -name = "regex-syntax" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "rend" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2571463863a6bd50c32f94402933f03457a3fbaf697a707c5be741e459f08fd" +checksum = "71fe3824f5629716b1589be05dacd749f6aa084c87e00e016714a8cdfccc997c" dependencies = [ "bytecheck", ] [[package]] name = "reqwest" -version = "0.11.22" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ "async-compression", - "base64 0.21.5", - "bytes 1.5.0", + "base64 0.21.7", + "bytes 1.6.0", "encoding_rs", "futures-core", "futures-util", - "h2", - "http 0.2.9", - "http-body", - "hyper", + "h2 0.3.25", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.28", "hyper-rustls 0.24.2", "hyper-tls", "ipnet", @@ -5469,8 +5453,9 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", "system-configuration", - "tokio 1.36.0", + "tokio 1.37.0", "tokio-native-tls", "tokio-rustls 0.24.1", "tokio-util", @@ -5479,16 +5464,10 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots 0.25.3", + "webpki-roots 0.25.4", "winreg", ] -[[package]] -name = "retain_mut" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4389f1d5789befaf6029ebd9f7dac4af7f7e3d61b69d4f30e2ac02b57e7712b0" - [[package]] name = "ring" version = "0.16.20" @@ -5512,7 +5491,7 @@ checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", "cfg-if 1.0.0", - "getrandom 0.2.11", + "getrandom", "libc", "spin 0.9.8", "untrusted 0.9.0", @@ -5521,12 +5500,13 @@ dependencies = [ [[package]] name = "rkyv" -version = "0.7.42" +version = "0.7.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0200c8230b013893c0b2d6213d6ec64ed2b9be2e0e016682b7224ff82cff5c58" +checksum = "5cba464629b3394fc4dbc6f940ff8f5b4ff5c7aef40f29166fd4ad12acbc99c0" dependencies = [ "bitvec", "bytecheck", + "bytes 1.6.0", "hashbrown 0.12.3", "ptr_meta", "rend", @@ -5538,9 +5518,9 @@ dependencies = [ [[package]] name = "rkyv_derive" -version = "0.7.42" +version = "0.7.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2e06b915b5c230a17d7a736d1e2e63ee753c256a8614ef3f5147b13a4f5541d" +checksum = "a7dddfff8de25e6f62b9d64e6e432bf1c6736c57d20323e15ee10435fbda7c65" dependencies = [ "proc-macro2", "quote", @@ -5549,13 +5529,14 @@ dependencies = [ [[package]] name = "ron" -version = "0.7.1" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88073939a61e5b7680558e6be56b419e208420c2adb92be54921fa6b72283f1a" +checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94" dependencies = [ - "base64 0.13.1", - "bitflags 1.3.2", + "base64 0.21.7", + "bitflags 2.5.0", "serde", + "serde_derive", ] [[package]] @@ -5566,7 +5547,7 @@ checksum = "1c7280c46017fafbe4275179689e446a9b0db3bd91ea61aaee22841ef618405a" dependencies = [ "nom", "serde", - "serde-wasm-bindgen", + "serde-wasm-bindgen 0.5.0", "serde_json", "wasm-bindgen", ] @@ -5586,36 +5567,36 @@ dependencies = [ "async-bb8-diesel", "async-trait", "awc", - "base64 0.21.5", + "base64 0.22.0", "bb8", "bigdecimal", "blake3", - "bytes 1.5.0", + "bytes 1.6.0", "cards", "clap", "common_enums", "common_utils", "config", - "cookie 0.18.0", + "cookie 0.18.1", "currency_conversion", "data_models", "derive_deref", "diesel", "diesel_models", - "digest 0.9.0", + "digest", "dyn-clone", "encoding_rs", "erased-serde", "error-stack", "euclid", "external_services", - "futures 0.3.28", + "futures 0.3.30", "hex", - "http 0.2.9", - "hyper", + "http 0.2.12", + "hyper 0.14.28", "hyperswitch_interfaces", "image", - "infer 0.13.0", + "infer", "iso_currency", "isocountry", "josekit", @@ -5633,13 +5614,13 @@ dependencies = [ "pm_auth", "qrcode", "quick-xml 0.31.0", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand", + "rand_chacha", "rdkafka", "redis_interface", "regex", "reqwest", - "ring 0.16.20", + "ring 0.17.8", "router_derive", "router_env", "roxmltree", @@ -5649,19 +5630,19 @@ dependencies = [ "serde", "serde_json", "serde_path_to_error", - "serde_qs 0.12.0", + "serde_qs", "serde_urlencoded", "serde_with", "serial_test", - "sha-1", + "sha1", "sqlx", "storage_impl", - "strum 0.25.0", + "strum 0.26.2", "tera", "test_utils", "thiserror", "time", - "tokio 1.36.0", + "tokio 1.37.0", "tracing-futures", "unicode-segmentation", "url", @@ -5677,13 +5658,13 @@ name = "router_derive" version = "0.1.0" dependencies = [ "diesel", - "indexmap 2.1.0", + "indexmap 2.2.6", "proc-macro2", "quote", "serde", "serde_json", - "strum 0.24.1", - "syn 2.0.55", + "strum 0.26.2", + "syn 2.0.57", ] [[package]] @@ -5701,9 +5682,9 @@ dependencies = [ "serde", "serde_json", "serde_path_to_error", - "strum 0.24.1", + "strum 0.26.2", "time", - "tokio 1.36.0", + "tokio 1.37.0", "tracing", "tracing-actix-web", "tracing-appender", @@ -5715,18 +5696,35 @@ dependencies = [ [[package]] name = "roxmltree" -version = "0.18.1" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "862340e351ce1b271a378ec53f304a5558f7db87f3769dc655a8f6ecbb68b302" +checksum = "3cd14fd5e3b777a7422cca79358c57a8f6e3a703d9ac187448d0daf220c2407f" + +[[package]] +name = "rsa" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0e5124fcb30e76a7e79bfee683a2746db83784b86289f6251b54b7950a0dfc" dependencies = [ - "xmlparser", + "const-oid", + "digest", + "num-bigint-dig", + "num-integer", + "num-traits", + "pkcs1", + "pkcs8", + "rand_core", + "signature", + "spki", + "subtle", + "zeroize", ] [[package]] name = "rust-ini" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6d5f2436026b4f6e79dc829837d467cc7e9a55ee40e750d716713540715a2df" +checksum = "7e2a3bcec1f113553ef1c88aae6c020a369d03d55b58de9869a0908930385091" dependencies = [ "cfg-if 1.0.0", "ordered-multimap", @@ -5734,15 +5732,15 @@ dependencies = [ [[package]] name = "rust_decimal" -version = "1.33.1" +version = "1.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06676aec5ccb8fc1da723cc8c0f9a46549f21ebb8753d3915c6c41db1e7f1dc4" +checksum = "1790d1c4c0ca81211399e0e0af16333276f375209e71a37b67698a373db5b47a" dependencies = [ "arrayvec", "borsh", - "bytes 1.5.0", + "bytes 1.6.0", "num-traits", - "rand 0.8.5", + "rand", "rkyv", "serde", "serde_json", @@ -5795,8 +5793,8 @@ checksum = "e9c02e25271068de581e03ac3bb44db60165ff1a10d92b9530192ccb898bc706" dependencies = [ "anyhow", "async-trait", - "bytes 1.5.0", - "http 0.2.9", + "bytes 1.6.0", + "http 0.2.12", "reqwest", "rustify_derive", "serde", @@ -5818,16 +5816,16 @@ dependencies = [ "regex", "serde_urlencoded", "syn 1.0.109", - "synstructure", + "synstructure 0.12.6", ] [[package]] name = "rustix" -version = "0.38.28" +version = "0.38.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" +checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.5.0", "errno", "libc", "linux-raw-sys", @@ -5872,11 +5870,11 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64 0.21.5", + "base64 0.21.7", ] [[package]] @@ -5917,9 +5915,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "same-file" @@ -5932,11 +5930,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -5957,29 +5955,23 @@ dependencies = [ "diesel_models", "error-stack", "external_services", - "futures 0.3.28", + "futures 0.3.30", "masking", "num_cpus", "once_cell", - "rand 0.8.5", + "rand", "redis_interface", "router_env", "serde", "serde_json", "storage_impl", - "strum 0.24.1", + "strum 0.26.2", "thiserror", "time", - "tokio 1.36.0", + "tokio 1.37.0", "uuid", ] -[[package]] -name = "scoped_threadpool" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8" - [[package]] name = "scopeguard" version = "1.2.0" @@ -5988,12 +5980,12 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sct" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", + "ring 0.17.8", + "untrusted 0.9.0", ] [[package]] @@ -6069,6 +6061,17 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "serde-wasm-bindgen" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8302e169f0eddcc139c70f139d19d6467353af16f9fce27e8c30158036a1e16b" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + [[package]] name = "serde_derive" version = "1.0.197" @@ -6077,16 +6080,16 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.57", ] [[package]] name = "serde_json" -version = "1.0.108" +version = "1.0.115" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" dependencies = [ - "indexmap 2.1.0", + "indexmap 2.2.6", "itoa", "ryu", "serde", @@ -6094,9 +6097,9 @@ dependencies = [ [[package]] name = "serde_path_to_error" -version = "0.1.14" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4beec8bce849d58d06238cb50db2e1c417cfeafa4c63f692b15c82b7c80f8335" +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" dependencies = [ "itoa", "serde", @@ -6111,17 +6114,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_qs" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7715380eec75f029a4ef7de39a9200e0a63823176b759d055b613f5a87df6a6" -dependencies = [ - "percent-encoding", - "serde", - "thiserror", -] - [[package]] name = "serde_qs" version = "0.12.0" @@ -6135,20 +6127,20 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.16" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00" +checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.57", ] [[package]] name = "serde_spanned" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" dependencies = [ "serde", ] @@ -6167,16 +6159,17 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.4.0" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64cd236ccc1b7a29e7e2739f27c0b2dd199804abc4290e32f59f3b68d6405c23" +checksum = "ee80b0e361bbf88fd2f6e242ccd19cfda072cb0faa6ae694ecee08199938569a" dependencies = [ - "base64 0.21.5", + "base64 0.21.7", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.1.0", + "indexmap 2.2.6", "serde", + "serde_derive", "serde_json", "serde_with_macros", "time", @@ -6184,24 +6177,24 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.4.0" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93634eb5f75a2323b16de4748022ac4297f9e76b6dced2be287a099f41b5e788" +checksum = "6561dc161a9224638a31d876ccdfefbc1df91d3f3a8342eddb35f055d48c7655" dependencies = [ - "darling 0.20.3", + "darling 0.20.8", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.57", ] [[package]] name = "serial_test" -version = "2.0.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e56dd856803e253c8f298af3f4d7eb0ae5e23a737252cd90bb4f3b435033b2d" +checksum = "953ad9342b3aaca7cb43c45c097dd008d4907070394bd0751a0aa8817e5a018d" dependencies = [ "dashmap", - "futures 0.3.28", + "futures 0.3.30", "lazy_static", "log", "parking_lot 0.12.1", @@ -6210,26 +6203,13 @@ dependencies = [ [[package]] name = "serial_test_derive" -version = "2.0.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f" +checksum = "b93fb4adc70021ac1b47f7d45e8cc4169baaa7ea58483bc5b721d19a26202212" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", -] - -[[package]] -name = "sha-1" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if 1.0.0", - "cpufeatures", - "digest 0.9.0", - "opaque-debug", + "syn 2.0.57", ] [[package]] @@ -6240,7 +6220,7 @@ checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if 1.0.0", "cpufeatures", - "digest 0.10.7", + "digest", ] [[package]] @@ -6251,7 +6231,7 @@ checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if 1.0.0", "cpufeatures", - "digest 0.10.7", + "digest", ] [[package]] @@ -6291,9 +6271,25 @@ dependencies = [ "futures-core", "libc", "signal-hook", - "tokio 1.36.0", + "tokio 1.37.0", +] + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core", ] +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + [[package]] name = "simdutf8" version = "0.1.4" @@ -6344,11 +6340,12 @@ dependencies = [ [[package]] name = "slug" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3bc762e6a4b6c6fcaade73e77f9ebc6991b676f88bb2358bddb56560f073373" +checksum = "3bd94acec9c8da640005f8e135a39fc0372e74535e6b368b7a04b875f784c8c4" dependencies = [ "deunicode", + "wasm-bindgen", ] [[package]] @@ -6362,145 +6359,260 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.4.9" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" dependencies = [ "libc", - "winapi 0.3.9", + "windows-sys 0.52.0", ] [[package]] -name = "socket2" -version = "0.5.5" +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spin" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" dependencies = [ - "libc", - "windows-sys 0.48.0", + "lock_api 0.4.11", +] + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "sqlformat" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce81b7bd7c4493975347ef60d8c7e8b742d4694f4c49f93e0a12ea263938176c" +dependencies = [ + "itertools 0.12.1", + "nom", + "unicode_categories", +] + +[[package]] +name = "sqlx" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dba03c279da73694ef99763320dea58b51095dfe87d001b1d4b5fe78ba8763cf" +dependencies = [ + "sqlx-core", + "sqlx-macros", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", +] + +[[package]] +name = "sqlx-core" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d84b0a3c3739e220d94b3239fd69fb1f74bc36e16643423bd99de3b43c21bfbd" +dependencies = [ + "ahash 0.8.11", + "atoi", + "bigdecimal", + "byteorder", + "bytes 1.6.0", + "crc", + "crossbeam-queue 0.3.11", + "dotenvy", + "either", + "event-listener", + "futures-channel", + "futures-core", + "futures-intrusive", + "futures-io", + "futures-util", + "hashlink", + "hex", + "indexmap 2.2.6", + "log", + "memchr", + "native-tls", + "once_cell", + "paste", + "percent-encoding", + "serde", + "serde_json", + "sha2", + "smallvec 1.13.2", + "sqlformat", + "thiserror", + "time", + "tokio 1.37.0", + "tokio-stream", + "tracing", + "url", ] [[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - -[[package]] -name = "sqlformat" -version = "0.2.2" +name = "sqlx-macros" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b7b278788e7be4d0d29c0f39497a0eef3fba6bbc8e70d8bf7fde46edeaa9e85" +checksum = "89961c00dc4d7dffb7aee214964b065072bff69e36ddb9e2c107541f75e4f2a5" dependencies = [ - "itertools 0.11.0", - "nom", - "unicode_categories", + "proc-macro2", + "quote", + "sqlx-core", + "sqlx-macros-core", + "syn 1.0.109", ] [[package]] -name = "sqlx" -version = "0.6.3" +name = "sqlx-macros-core" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8de3b03a925878ed54a954f621e64bf55a3c1bd29652d0d1a17830405350188" +checksum = "d0bd4519486723648186a08785143599760f7cc81c52334a55d6a83ea1e20841" dependencies = [ + "atomic-write-file", + "dotenvy", + "either", + "heck", + "hex", + "once_cell", + "proc-macro2", + "quote", + "serde", + "serde_json", + "sha2", "sqlx-core", - "sqlx-macros", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", + "syn 1.0.109", + "tempfile", + "tokio 1.37.0", + "url", ] [[package]] -name = "sqlx-core" -version = "0.6.3" +name = "sqlx-mysql" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa8241483a83a3f33aa5fff7e7d9def398ff9990b2752b6c6112b83c6d246029" +checksum = "e37195395df71fd068f6e2082247891bc11e3289624bbc776a0cdfa1ca7f1ea4" dependencies = [ - "ahash 0.7.7", "atoi", - "base64 0.13.1", + "base64 0.21.7", "bigdecimal", - "bitflags 1.3.2", + "bitflags 2.5.0", "byteorder", - "bytes 1.5.0", + "bytes 1.6.0", "crc", - "crossbeam-queue 0.3.8", - "dirs", + "digest", "dotenvy", "either", - "event-listener", "futures-channel", "futures-core", - "futures-intrusive", + "futures-io", "futures-util", - "hashlink", + "generic-array", "hex", "hkdf", "hmac", - "indexmap 1.9.3", "itoa", - "libc", "log", "md-5", "memchr", - "num-bigint", "once_cell", - "paste", "percent-encoding", - "rand 0.8.5", + "rand", + "rsa", "serde", - "serde_json", "sha1", "sha2", - "smallvec 1.11.1", - "sqlformat", - "sqlx-rt", + "smallvec 1.13.2", + "sqlx-core", "stringprep", "thiserror", "time", - "tokio-stream", - "url", + "tracing", "whoami", ] [[package]] -name = "sqlx-macros" -version = "0.6.3" +name = "sqlx-postgres" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9966e64ae989e7e575b19d7265cb79d7fc3cbbdf179835cb0d716f294c2049c9" +checksum = "d6ac0ac3b7ccd10cc96c7ab29791a7dd236bd94021f31eec7ba3d46a74aa1c24" dependencies = [ + "atoi", + "base64 0.21.7", + "bigdecimal", + "bitflags 2.5.0", + "byteorder", + "crc", "dotenvy", - "either", - "heck", + "etcetera", + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "hex", + "hkdf", + "hmac", + "home", + "itoa", + "log", + "md-5", + "memchr", + "num-bigint", "once_cell", - "proc-macro2", - "quote", + "rand", + "serde", + "serde_json", + "sha1", "sha2", + "smallvec 1.13.2", "sqlx-core", - "sqlx-rt", - "syn 1.0.109", - "url", + "stringprep", + "thiserror", + "time", + "tracing", + "whoami", ] [[package]] -name = "sqlx-rt" -version = "0.6.3" +name = "sqlx-sqlite" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "804d3f245f894e61b1e6263c84b23ca675d96753b5abfd5cc8597d86806e8024" +checksum = "210976b7d948c7ba9fced8ca835b11cbb2d677c59c79de41ac0d397e14547490" dependencies = [ - "native-tls", - "once_cell", - "tokio 1.36.0", - "tokio-native-tls", + "atoi", + "flume", + "futures-channel", + "futures-core", + "futures-executor", + "futures-intrusive", + "futures-util", + "libsqlite3-sys", + "log", + "percent-encoding", + "serde", + "sqlx-core", + "time", + "tracing", + "url", + "urlencoding", ] [[package]] @@ -6512,7 +6624,7 @@ dependencies = [ "async-bb8-diesel", "async-trait", "bb8", - "bytes 1.5.0", + "bytes 1.6.0", "common_utils", "config", "crc32fast", @@ -6521,20 +6633,19 @@ dependencies = [ "diesel_models", "dyn-clone", "error-stack", - "futures 0.3.28", - "http 0.2.9", + "futures 0.3.30", + "http 0.2.12", "masking", "mime", "moka", "once_cell", "redis_interface", - "ring 0.16.20", "router_derive", "router_env", "serde", "serde_json", "thiserror", - "tokio 1.36.0", + "tokio 1.37.0", ] [[package]] @@ -6574,11 +6685,11 @@ dependencies = [ [[package]] name = "strum" -version = "0.25.0" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" +checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" dependencies = [ - "strum_macros 0.25.2", + "strum_macros 0.26.2", ] [[package]] @@ -6596,22 +6707,22 @@ dependencies = [ [[package]] name = "strum_macros" -version = "0.25.2" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad8d03b598d3d0fff69bf533ee3ef19b8eeb342729596df84bcc7e1f96ec4059" +checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" dependencies = [ "heck", "proc-macro2", "quote", "rustversion", - "syn 2.0.55", + "syn 2.0.57", ] [[package]] name = "subtle" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" @@ -6626,9 +6737,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.55" +version = "2.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "002a1b3dbf967edfafc32655d0f377ab0bb7b994aa1d32c8cc7e9b8bf3ebb8f0" +checksum = "11a6ae1e52eb25aab8f3fb9fca13be982a373b8f1157ca14b897a825ba4a2d35" dependencies = [ "proc-macro2", "quote", @@ -6644,7 +6755,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.57", ] [[package]] @@ -6665,6 +6776,17 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.57", +] + [[package]] name = "system-configuration" version = "0.5.1" @@ -6700,15 +6822,14 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.8.0" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if 1.0.0", - "fastrand 2.0.1", - "redox_syscall 0.3.5", + "fastrand 2.0.2", "rustix", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -6725,7 +6846,7 @@ dependencies = [ "percent-encoding", "pest", "pest_derive", - "rand 0.8.5", + "rand", "regex", "serde", "serde_json", @@ -6735,36 +6856,34 @@ dependencies = [ [[package]] name = "test-case" -version = "3.2.1" +version = "3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8f1e820b7f1d95a0cdbf97a5df9de10e1be731983ab943e56703ac1b8e9d425" +checksum = "eb2550dd13afcd286853192af8601920d959b14c401fcece38071d53bf0768a8" dependencies = [ "test-case-macros", ] [[package]] name = "test-case-core" -version = "3.2.1" +version = "3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54c25e2cb8f5fcd7318157634e8838aa6f7e4715c96637f969fabaccd1ef5462" +checksum = "adcb7fd841cd518e279be3d5a3eb0636409487998a4aff22f3de87b81e88384f" dependencies = [ "cfg-if 1.0.0", - "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.57", ] [[package]] name = "test-case-macros" -version = "3.2.1" +version = "3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37cfd7bbc88a0104e304229fba519bdc45501a30b760fb72240342f1289ad257" +checksum = "5c89e72a01ed4c579669add59014b9a524d609c0c88c6a585ce37485879f6ffb" dependencies = [ - "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.57", "test-case-core", ] @@ -6773,10 +6892,10 @@ name = "test_utils" version = "0.1.0" dependencies = [ "async-trait", - "base64 0.21.5", + "base64 0.22.0", "clap", "masking", - "rand 0.8.5", + "rand", "regex", "reqwest", "serde", @@ -6785,8 +6904,8 @@ dependencies = [ "serial_test", "thirtyfour", "time", - "tokio 1.36.0", - "toml 0.7.4", + "tokio 1.37.0", + "toml", ] [[package]] @@ -6800,8 +6919,8 @@ dependencies = [ "chrono", "cookie 0.16.2", "fantoccini", - "futures 0.3.28", - "http 0.2.9", + "futures 0.3.30", + "http 0.2.12", "log", "parking_lot 0.12.1", "serde", @@ -6810,7 +6929,7 @@ dependencies = [ "stringmatch", "thirtyfour-macros", "thiserror", - "tokio 1.36.0", + "tokio 1.37.0", "url", "urlparse", ] @@ -6829,52 +6948,46 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.49" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" +checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.49" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" +checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.57", ] [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ "cfg-if 1.0.0", "once_cell", ] -[[package]] -name = "tiff" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a53f4706d65497df0c4349241deddf35f84cee19c87ed86ea8ca590f4464437" -dependencies = [ - "jpeg-decoder", - "miniz_oxide 0.4.4", - "weezl", -] - [[package]] name = "time" -version = "0.3.23" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59e399c068f43a5d116fedaf73b203fa4f9c519f17e2b34f63221d3792f81446" +checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" dependencies = [ + "deranged", "itoa", + "libc", + "num-conv", + "num_threads", + "powerfmt", "serde", "time-core", "time-macros", @@ -6882,19 +6995,29 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.10" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96ba15a897f3c86766b757e5ac7221554c6750054d74d5b28844fce5fb36a6c4" +checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" dependencies = [ + "num-conv", "time-core", ] +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + [[package]] name = "tinytemplate" version = "1.2.1" @@ -6946,19 +7069,19 @@ dependencies = [ [[package]] name = "tokio" -version = "1.36.0" +version = "1.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" dependencies = [ "backtrace", - "bytes 1.5.0", + "bytes 1.6.0", "libc", - "mio 0.8.10", + "mio 0.8.11", "num_cpus", "parking_lot 0.12.1", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.5", + "socket2", "tokio-macros", "windows-sys 0.48.0", ] @@ -7023,7 +7146,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" dependencies = [ "pin-project-lite", - "tokio 1.36.0", + "tokio 1.37.0", ] [[package]] @@ -7034,7 +7157,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.57", ] [[package]] @@ -7044,7 +7167,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" dependencies = [ "native-tls", - "tokio 1.36.0", + "tokio 1.37.0", ] [[package]] @@ -7073,7 +7196,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ "rustls 0.20.9", - "tokio 1.36.0", + "tokio 1.37.0", "webpki", ] @@ -7084,18 +7207,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ "rustls 0.21.10", - "tokio 1.36.0", + "tokio 1.37.0", ] [[package]] name = "tokio-stream" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" dependencies = [ "futures-core", "pin-project-lite", - "tokio 1.36.0", + "tokio 1.37.0", "tokio-util", ] @@ -7187,71 +7310,73 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ - "bytes 1.5.0", + "bytes 1.6.0", "futures-core", "futures-sink", "pin-project-lite", - "tokio 1.36.0", + "tokio 1.37.0", "tracing", ] [[package]] name = "toml" -version = "0.5.11" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" dependencies = [ + "indexmap 2.2.6", "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.22.9", ] [[package]] -name = "toml" -version = "0.7.4" +name = "toml_datetime" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6135d499e69981f9ff0ef2167955a5333c35e36f6937d382974566b3d5b94ec" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" dependencies = [ - "indexmap 1.9.3", "serde", - "serde_spanned", - "toml_datetime", - "toml_edit 0.19.14", ] [[package]] -name = "toml_datetime" -version = "0.6.3" +name = "toml_edit" +version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "serde", + "indexmap 2.2.6", + "toml_datetime", + "winnow 0.5.40", ] [[package]] name = "toml_edit" -version = "0.19.14" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ - "indexmap 2.1.0", - "serde", - "serde_spanned", + "indexmap 2.2.6", "toml_datetime", - "winnow", + "winnow 0.5.40", ] [[package]] name = "toml_edit" -version = "0.20.2" +version = "0.22.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" +checksum = "8e40bb779c5187258fd7aad0eb68cb8706a0a81fa712fbea808ab43c4b8374c4" dependencies = [ - "indexmap 2.1.0", + "indexmap 2.2.6", + "serde", + "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.6.5", ] [[package]] @@ -7264,19 +7389,19 @@ dependencies = [ "async-trait", "axum", "base64 0.13.1", - "bytes 1.5.0", + "bytes 1.6.0", "futures-core", "futures-util", - "h2", - "http 0.2.9", - "http-body", - "hyper", + "h2 0.3.25", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.28", "hyper-timeout", "percent-encoding", "pin-project", "prost", "prost-derive", - "tokio 1.36.0", + "tokio 1.37.0", "tokio-stream", "tokio-util", "tower", @@ -7297,9 +7422,9 @@ dependencies = [ "indexmap 1.9.3", "pin-project", "pin-project-lite", - "rand 0.8.5", + "rand", "slab", - "tokio 1.36.0", + "tokio 1.37.0", "tokio-util", "tower-layer", "tower-service", @@ -7347,11 +7472,12 @@ dependencies = [ [[package]] name = "tracing-appender" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d48f71a791638519505cefafe162606f706c25592e4bde4d97600c0195312e" +checksum = "3566e8ce28cc0a3fe42519fc80e6b4c943cc4c8cef275620eb8dac2d3d4e06cf" dependencies = [ "crossbeam-channel", + "thiserror", "time", "tracing-subscriber", ] @@ -7364,7 +7490,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.57", ] [[package]] @@ -7390,12 +7516,23 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" dependencies = [ - "lazy_static", "log", + "once_cell", "tracing-core", ] @@ -7409,7 +7546,7 @@ dependencies = [ "opentelemetry", "tracing", "tracing-core", - "tracing-log", + "tracing-log 0.1.4", "tracing-subscriber", ] @@ -7425,9 +7562,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ "matchers", "nu-ansi-term", @@ -7436,25 +7573,25 @@ dependencies = [ "serde", "serde_json", "sharded-slab", - "smallvec 1.11.1", + "smallvec 1.13.2", "thread_local", "tracing", "tracing-core", - "tracing-log", + "tracing-log 0.2.0", "tracing-serde", ] [[package]] name = "triomphe" -version = "0.1.9" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee8098afad3fb0c54a9007aab6804558410503ad676d4633f9c2559a00ac0f" +checksum = "859eb650cfee7434994602c3a68b25d77ad9e68c8a6cd491616ef86661382eb3" [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "typenum" @@ -7535,9 +7672,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" @@ -7547,18 +7684,18 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] [[package]] name = "unicode-segmentation" -version = "1.10.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-xid" @@ -7572,12 +7709,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" -[[package]] -name = "unidecode" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "402bb19d8e03f1d1a7450e2bd613980869438e0666331be3e073089124aa1adc" - [[package]] name = "untrusted" version = "0.7.1" @@ -7592,9 +7723,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", @@ -7616,11 +7747,11 @@ checksum = "110352d4e9076c67839003c7788d8604e24dcded13e0b375af3efaa8cf468517" [[package]] name = "utoipa" -version = "3.5.0" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d82b1bc5417102a73e8464c686eef947bdfb99fcdfc0a4f228e81afa9526470a" +checksum = "272ebdfbc99111033031d2f10e018836056e4d2c8e2acda76450ec7974269fa7" dependencies = [ - "indexmap 2.1.0", + "indexmap 2.2.6", "serde", "serde_json", "utoipa-gen", @@ -7628,34 +7759,34 @@ dependencies = [ [[package]] name = "utoipa-gen" -version = "3.5.0" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d96dcd6fc96f3df9b3280ef480770af1b7c5d14bc55192baa9b067976d920c" +checksum = "d3c9f4d08338c1bfa70dde39412a040a884c6f318b3d09aaaf3437a1e52027fc" dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.57", ] [[package]] name = "uuid" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" dependencies = [ "atomic", - "getrandom 0.2.11", + "getrandom", ] [[package]] name = "validator" -version = "0.16.1" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b92f40481c04ff1f4f61f304d61793c7b56ff76ac1469f1beb199b1445b253bd" +checksum = "da339118f018cc70ebf01fafc103360528aad53717e4bf311db929cb01cb9345" dependencies = [ "idna", - "lazy_static", + "once_cell", "regex", "serde", "serde_derive", @@ -7671,14 +7802,14 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "vaultrs" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28084ac780b443e7f3514df984a2933bd3ab39e71914d951cdf8e4d298a7c9bc" +checksum = "0bb996bb053adadc767f8b0bda2a80bc2b67d24fe89f2b959ae919e200d79a19" dependencies = [ "async-trait", - "bytes 1.5.0", + "bytes 1.6.0", "derive_builder", - "http 0.2.9", + "http 0.2.12", "reqwest", "rustify", "rustify_derive", @@ -7697,12 +7828,15 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "vergen" -version = "8.2.1" +version = "8.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b3c89c2c7e50f33e4d35527e5bf9c11d6d132226dbbd1753f0fbe9f19ef88c6" +checksum = "e27d6bdd219887a9eadd19e1c34f32e47fa332301184935c6d9bca26f3cca525" dependencies = [ "anyhow", + "cargo_metadata 0.18.1", + "cfg-if 1.0.0", "git2", + "regex", "rustc_version 0.4.0", "rustversion", "time", @@ -7735,17 +7869,11 @@ dependencies = [ "libc", ] -[[package]] -name = "waker-fn" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" - [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -7762,21 +7890,21 @@ dependencies = [ [[package]] name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +name = "wasite" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -7784,24 +7912,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.57", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -7811,9 +7939,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -7821,28 +7949,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.57", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", @@ -7855,9 +7983,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9973cb72c8587d5ad5efdb91e663d36177dc37725e6c90ca86c626b0cc45c93f" dependencies = [ "base64 0.13.1", - "bytes 1.5.0", + "bytes 1.6.0", "cookie 0.16.2", - "http 0.2.9", + "http 0.2.12", "log", "serde", "serde_derive", @@ -7869,12 +7997,12 @@ dependencies = [ [[package]] name = "webpki" -version = "0.22.2" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07ecc0cd7cac091bf682ec5efa18b1cff79d617b84181f38b3951dbe135f607f" +checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", + "ring 0.17.8", + "untrusted 0.9.0", ] [[package]] @@ -7888,24 +8016,18 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.25.3" +version = "0.25.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" - -[[package]] -name = "weezl" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "whoami" -version = "1.4.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22fc3756b8a9133049b26c7f61ab35416c130e8c09b660f5b3958b446f52cc50" +checksum = "a44ab49fad634e88f55bf8f9bb3abd2f27d7204172a112c7c9987e01c1c94ea9" dependencies = [ - "wasm-bindgen", - "web-sys", + "redox_syscall 0.4.1", + "wasite", ] [[package]] @@ -7953,11 +8075,11 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-core" -version = "0.51.1" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.48.5", + "windows-targets 0.52.4", ] [[package]] @@ -7975,7 +8097,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.4", ] [[package]] @@ -7995,17 +8117,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", ] [[package]] @@ -8016,9 +8138,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" [[package]] name = "windows_aarch64_msvc" @@ -8028,9 +8150,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" [[package]] name = "windows_i686_gnu" @@ -8040,9 +8162,9 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" [[package]] name = "windows_i686_msvc" @@ -8052,9 +8174,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" [[package]] name = "windows_x86_64_gnu" @@ -8064,9 +8186,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" [[package]] name = "windows_x86_64_gnullvm" @@ -8076,9 +8198,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" [[package]] name = "windows_x86_64_msvc" @@ -8088,15 +8210,24 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" + +[[package]] +name = "winnow" +version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] [[package]] name = "winnow" -version = "0.5.19" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" +checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" dependencies = [ "memchr", ] @@ -8113,24 +8244,26 @@ dependencies = [ [[package]] name = "wiremock" -version = "0.5.18" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd7b0b5b253ebc0240d6aac6dd671c495c467420577bf634d3064ae7e6fa2b4c" +checksum = "ec874e1eef0df2dcac546057fe5e29186f09c378181cd7b635b4b7bcc98e9d81" dependencies = [ "assert-json-diff", "async-trait", - "base64 0.21.5", + "base64 0.21.7", "deadpool", - "futures 0.3.28", - "futures-timer", - "http-types", - "hyper", + "futures 0.3.30", + "http 1.1.0", + "http-body-util", + "hyper 1.2.0", + "hyper-util", "log", "once_cell", "regex", "serde", "serde_json", - "tokio 1.36.0", + "tokio 1.37.0", + "url", ] [[package]] @@ -8154,9 +8287,9 @@ dependencies = [ [[package]] name = "x509-parser" -version = "0.15.1" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7069fba5b66b9193bd2c5d3d4ff12b839118f6bcbef5328efafafb5395cf63da" +checksum = "fcbc162f30700d6f3f82a24bf7cc62ffe7caea42c0b2cba8bf7f3ae50cf51f69" dependencies = [ "asn1-rs", "data-encoding", @@ -8186,56 +8319,54 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.31" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c4061bedbb353041c12f413700357bec76df2c7e2ca8e4df8bac24c6bf68e3d" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.31" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3c129550b3e6de3fd0ba67ba5c81818f9805e58b8d7fee80a3a59d2c9fc601a" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.57", ] [[package]] name = "zeroize" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" [[package]] name = "zstd" -version = "0.12.4" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" +checksum = "bffb3309596d527cfcba7dfc6ed6052f1d39dfbd7c867aa2e865e4a449c10110" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "6.0.6" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" +checksum = "43747c7422e2924c11144d5229878b98180ef8b06cca4ab5af37afc8a8d8ea3e" dependencies = [ - "libc", "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.0.8+zstd.1.5.5" +version = "2.0.9+zstd.1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" +checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" dependencies = [ "cc", - "libc", "pkg-config", ] diff --git a/crates/analytics/Cargo.toml b/crates/analytics/Cargo.toml index 37b13a39713..2b1cc798a7e 100644 --- a/crates/analytics/Cargo.toml +++ b/crates/analytics/Cargo.toml @@ -2,51 +2,40 @@ name = "analytics" version = "0.1.0" description = "Analytics / Reports / Search related functionality" -edition = "2021" +edition.workspace = true +rust-version.workspace = true +license.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] # First party crates -api_models = { version = "0.1.0", path = "../api_models", features = [ - "errors", -] } +api_models = { version = "0.1.0", path = "../api_models", features = ["errors"] } storage_impl = { version = "0.1.0", path = "../storage_impl", default-features = false } common_utils = { version = "0.1.0", path = "../common_utils" } external_services = { version = "0.1.0", path = "../external_services", default-features = false } hyperswitch_interfaces = { version = "0.1.0", path = "../hyperswitch_interfaces" } masking = { version = "0.1.0", path = "../masking" } -router_env = { version = "0.1.0", path = "../router_env", features = [ - "log_extra_implicit_fields", - "log_custom_entries_to_extra", -] } -diesel_models = { version = "0.1.0", path = "../diesel_models", features = [ - "kv_store", -] } +router_env = { version = "0.1.0", path = "../router_env", features = ["log_extra_implicit_fields", "log_custom_entries_to_extra"] } +diesel_models = { version = "0.1.0", path = "../diesel_models", features = ["kv_store"] } #Third Party dependencies -actix-web = "4.3.1" -async-trait = "0.1.68" -aws-config = { version = "1.1.6", features = ["behavior-version-latest"] } -aws-sdk-lambda = { version = "1.1.4" } -aws-smithy-types = { version = "1.1.6" } +actix-web = "4.5.1" +async-trait = "0.1.79" +aws-config = { version = "1.1.9", features = ["behavior-version-latest"] } +aws-sdk-lambda = { version = "1.18.0" } +aws-smithy-types = { version = "1.1.8" } bigdecimal = { version = "0.3.1", features = ["serde"] } error-stack = "0.4.1" -futures = "0.3.28" +futures = "0.3.30" opensearch = { version = "2.2.0", features = ["aws-auth"] } -once_cell = "1.18.0" -reqwest = { version = "0.11.18", features = ["serde_json"] } -serde = { version = "1.0.193", features = ["derive", "rc"] } -serde_json = "1.0.108" -sqlx = { version = "0.6.3", features = [ - "postgres", - "runtime-actix", - "runtime-actix-native-tls", - "time", - "bigdecimal", -] } -strum = { version = "0.25.0", features = ["derive"] } -thiserror = "1.0.43" -time = { version = "0.3.21", features = ["serde", "serde-well-known", "std"] } -tokio = { version = "1.36.0", features = ["macros", "rt-multi-thread"] } +once_cell = "1.19.0" +reqwest = { version = "0.11.27", features = ["serde_json"] } +serde = { version = "1.0.197", features = ["derive", "rc"] } +serde_json = "1.0.115" +sqlx = { version = "0.7.3", features = ["postgres", "runtime-tokio", "runtime-tokio-native-tls", "time", "bigdecimal"] } +strum = { version = "0.26.2", features = ["derive"] } +thiserror = "1.0.58" +time = { version = "0.3.34", features = ["serde", "serde-well-known", "std"] } +tokio = { version = "1.37.0", features = ["macros", "rt-multi-thread"] } diff --git a/crates/analytics/src/sqlx.rs b/crates/analytics/src/sqlx.rs index 586ec1bfb17..86782c5f750 100644 --- a/crates/analytics/src/sqlx.rs +++ b/crates/analytics/src/sqlx.rs @@ -100,10 +100,10 @@ where Type: DbType + FromStr + Display, { fn encode_by_ref(&self, buf: &mut PgArgumentBuffer) -> sqlx::encode::IsNull { - self.0.to_string().encode(buf) + <String as Encode<'q, Postgres>>::encode(self.0.to_string(), buf) } fn size_hint(&self) -> usize { - self.0.to_string().size_hint() + <String as Encode<'q, Postgres>>::size_hint(&self.0.to_string()) } } diff --git a/crates/api_models/Cargo.toml b/crates/api_models/Cargo.toml index 356a29830ec..cdcee9c506e 100644 --- a/crates/api_models/Cargo.toml +++ b/crates/api_models/Cargo.toml @@ -23,22 +23,22 @@ openapi = ["common_enums/openapi", "olap", "backwards_compatibility", "business_ recon = [] [dependencies] -actix-web = { version = "4.3.1", optional = true } +actix-web = { version = "4.5.1", optional = true } error-stack = "0.4.1" mime = "0.3.17" -reqwest = { version = "0.11.18", optional = true } -serde = { version = "1.0.193", features = ["derive"] } -serde_json = "1.0.108" -strum = { version = "0.25", features = ["derive"] } -time = { version = "0.3.21", features = ["serde", "serde-well-known", "std"] } -url = { version = "2.4.0", features = ["serde"] } -utoipa = { version = "3.5.0", features = ["preserve_order", "preserve_path_order"] } -frunk = "0.4.1" -frunk_core = "0.4.1" +reqwest = { version = "0.11.27", optional = true } +serde = { version = "1.0.197", features = ["derive"] } +serde_json = "1.0.115" +strum = { version = "0.26", features = ["derive"] } +time = { version = "0.3.34", features = ["serde", "serde-well-known", "std"] } +url = { version = "2.5.0", features = ["serde"] } +utoipa = { version = "4.2.0", features = ["preserve_order", "preserve_path_order"] } +frunk = "0.4.2" +frunk_core = "0.4.2" # First party crates cards = { version = "0.1.0", path = "../cards" } -common_enums = { path = "../common_enums" } +common_enums = { version = "0.1.0", path = "../common_enums" } common_utils = { version = "0.1.0", path = "../common_utils" } euclid = { version = "0.1.0", path = "../euclid" } masking = { version = "0.1.0", path = "../masking", default-features = false, features = ["alloc", "serde"] } diff --git a/crates/api_models/src/conditional_configs.rs b/crates/api_models/src/conditional_configs.rs index f8ed13421ac..46bad3e9e86 100644 --- a/crates/api_models/src/conditional_configs.rs +++ b/crates/api_models/src/conditional_configs.rs @@ -17,7 +17,7 @@ use serde::{Deserialize, Serialize}; PartialEq, Eq, strum::Display, - strum::EnumVariantNames, + strum::VariantNames, strum::EnumIter, strum::EnumString, Serialize, diff --git a/crates/api_models/src/enums.rs b/crates/api_models/src/enums.rs index 354dec29237..e93371ef947 100644 --- a/crates/api_models/src/enums.rs +++ b/crates/api_models/src/enums.rs @@ -35,7 +35,7 @@ pub enum RoutingAlgorithm { ToSchema, serde::Deserialize, serde::Serialize, - strum::EnumVariantNames, + strum::VariantNames, strum::EnumIter, strum::Display, strum::EnumString, diff --git a/crates/cards/Cargo.toml b/crates/cards/Cargo.toml index bb185bf2167..ab4152893af 100644 --- a/crates/cards/Cargo.toml +++ b/crates/cards/Cargo.toml @@ -12,9 +12,9 @@ license.workspace = true [dependencies] error-stack = "0.4.1" luhn = "1.0.1" -serde = { version = "1.0.193", features = ["derive"] } -thiserror = "1.0.40" -time = "0.3.21" +serde = { version = "1.0.197", features = ["derive"] } +thiserror = "1.0.58" +time = "0.3.34" # First party crates common_utils = { version = "0.1.0", path = "../common_utils" } @@ -24,4 +24,4 @@ masking = { version = "0.1.0", path = "../masking" } router_env = { version = "0.1.0", path = "../router_env", features = ["log_extra_implicit_fields", "log_custom_entries_to_extra"] } [dev-dependencies] -serde_json = "1.0.108" +serde_json = "1.0.115" diff --git a/crates/common_enums/Cargo.toml b/crates/common_enums/Cargo.toml index 30da73c57d2..5c88236b8ae 100644 --- a/crates/common_enums/Cargo.toml +++ b/crates/common_enums/Cargo.toml @@ -13,14 +13,14 @@ openapi = [] payouts = [] [dependencies] -diesel = { version = "2.1.0", features = ["postgres"] } -serde = { version = "1.0.193", features = ["derive"] } -serde_json = "1.0.108" -strum = { version = "0.25", features = ["derive"] } -utoipa = { version = "3.5.0", features = ["preserve_order", "preserve_path_order"] } +diesel = { version = "2.1.5", features = ["postgres"] } +serde = { version = "1.0.197", features = ["derive"] } +serde_json = "1.0.115" +strum = { version = "0.26", features = ["derive"] } +utoipa = { version = "4.2.0", features = ["preserve_order", "preserve_path_order"] } # First party crates router_derive = { version = "0.1.0", path = "../router_derive" } [dev-dependencies] -serde_json = "1.0.108" +serde_json = "1.0.115" diff --git a/crates/common_enums/src/enums.rs b/crates/common_enums/src/enums.rs index 571449b9872..fefe0a93af2 100644 --- a/crates/common_enums/src/enums.rs +++ b/crates/common_enums/src/enums.rs @@ -74,7 +74,7 @@ pub enum AttemptStatus { strum::Display, strum::EnumString, strum::EnumIter, - strum::EnumVariantNames, + strum::VariantNames, ToSchema, )] #[router_derive::diesel_enum(storage_type = "db_enum")] @@ -209,7 +209,7 @@ impl AttemptStatus { serde::Deserialize, serde::Serialize, strum::Display, - strum::EnumVariantNames, + strum::VariantNames, strum::EnumIter, strum::EnumString, ToSchema, @@ -312,7 +312,7 @@ pub enum BlocklistDataKind { serde::Deserialize, serde::Serialize, strum::Display, - strum::EnumVariantNames, + strum::VariantNames, strum::EnumIter, strum::EnumString, ToSchema, @@ -386,7 +386,7 @@ pub enum ConnectorType { strum::Display, strum::EnumString, strum::EnumIter, - strum::EnumVariantNames, + strum::VariantNames, ToSchema, )] #[router_derive::diesel_enum(storage_type = "db_enum")] @@ -1181,7 +1181,7 @@ pub enum IntentStatus { serde::Deserialize, serde::Serialize, strum::Display, - strum::EnumVariantNames, + strum::VariantNames, strum::EnumIter, strum::EnumString, ToSchema, @@ -1328,7 +1328,7 @@ pub enum PaymentExperience { serde::Deserialize, serde::Serialize, strum::Display, - strum::EnumVariantNames, + strum::VariantNames, strum::EnumIter, strum::EnumString, ToSchema, @@ -1435,7 +1435,7 @@ pub enum PaymentMethodType { serde::Deserialize, serde::Serialize, strum::Display, - strum::EnumVariantNames, + strum::VariantNames, strum::EnumIter, strum::EnumString, ToSchema, @@ -1543,7 +1543,7 @@ pub enum MandateStatus { serde::Deserialize, serde::Serialize, strum::Display, - strum::EnumVariantNames, + strum::VariantNames, strum::EnumIter, strum::EnumString, ToSchema, @@ -1709,7 +1709,7 @@ pub enum CountryAlpha3 { Eq, Hash, strum::Display, - strum::EnumVariantNames, + strum::VariantNames, strum::EnumIter, strum::EnumString, Deserialize, @@ -2109,7 +2109,7 @@ pub enum PayoutStatus { serde::Deserialize, serde::Serialize, strum::Display, - strum::EnumVariantNames, + strum::VariantNames, strum::EnumIter, strum::EnumString, ToSchema, diff --git a/crates/common_utils/Cargo.toml b/crates/common_utils/Cargo.toml index bc8a3af0a43..285d423958d 100644 --- a/crates/common_utils/Cargo.toml +++ b/crates/common_utils/Cargo.toml @@ -13,33 +13,33 @@ async_ext = ["dep:futures", "dep:async-trait"] logs = ["dep:router_env"] [dependencies] -async-trait = { version = "0.1.68", optional = true } -bytes = "1.4.0" -diesel = "2.1.0" +async-trait = { version = "0.1.79", optional = true } +bytes = "1.6.0" +diesel = "2.1.5" error-stack = "0.4.1" -futures = { version = "0.3.28", optional = true } +futures = { version = "0.3.30", optional = true } hex = "0.4.3" -http = "0.2.9" +http = "0.2.12" md5 = "0.7.0" nanoid = "0.4.0" -once_cell = "1.18.0" +once_cell = "1.19.0" phonenumber = "0.3.3" -quick-xml = { version = "0.28.2", features = ["serialize"] } +quick-xml = { version = "0.31.0", features = ["serialize"] } rand = "0.8.5" -regex = "1.8.4" -reqwest = { version = "0.11.18", features = ["json", "native-tls", "gzip", "multipart"] } -ring = { version = "0.16.20", features = ["std"] } +regex = "1.10.4" +reqwest = { version = "0.11.27", features = ["json", "native-tls", "gzip", "multipart"] } +ring = { version = "0.17.8", features = ["std", "wasm32_unknown_unknown_js"] } rustc-hash = "1.1.0" -serde = { version = "1.0.193", features = ["derive"] } -serde_json = "1.0.108" +serde = { version = "1.0.197", features = ["derive"] } +serde_json = "1.0.115" serde_urlencoded = "0.7.1" -signal-hook = { version = "0.3.15", optional = true } -strum = { version = "0.24.1", features = ["derive"] } -thiserror = "1.0.40" -time = { version = "0.3.21", features = ["serde", "serde-well-known", "std"] } -tokio = { version = "1.36.0", features = ["macros", "rt-multi-thread"], optional = true } +signal-hook = { version = "0.3.17", optional = true } +strum = { version = "0.26.2", features = ["derive"] } +thiserror = "1.0.58" +time = { version = "0.3.34", features = ["serde", "serde-well-known", "std"] } +tokio = { version = "1.37.0", features = ["macros", "rt-multi-thread"], optional = true } semver = { version = "1.0.22", features = ["serde"] } -uuid = { version = "1.7.0", features = ["v7"] } +uuid = { version = "1.8.0", features = ["v7"] } # First party crates common_enums = { version = "0.1.0", path = "../common_enums" } @@ -50,6 +50,6 @@ router_env = { version = "0.1.0", path = "../router_env", features = ["log_extra signal-hook-tokio = { version = "0.3.1", features = ["futures-v0_3"], optional = true } [dev-dependencies] -fake = "2.6.1" -proptest = "1.2.0" -test-case = "3.1.0" +fake = "2.9.2" +proptest = "1.4.0" +test-case = "3.3.1" diff --git a/crates/config_importer/Cargo.toml b/crates/config_importer/Cargo.toml index d831812cdca..129abae15ad 100644 --- a/crates/config_importer/Cargo.toml +++ b/crates/config_importer/Cargo.toml @@ -12,12 +12,12 @@ all-features = true rustdoc-args = ["--cfg", "docsrs"] [dependencies] -anyhow = "1.0.75" -clap = { version = "4.3.2", default-features = false, features = ["std", "derive", "help", "usage"] } -indexmap = { version = "2.1.0", optional = true } -serde = { version = "1.0.193", features = ["derive"] } -serde_json = "1.0.108" -toml = { version = "0.7.4", default-features = false, features = ["parse"] } +anyhow = "1.0.81" +clap = { version = "4.4.18", default-features = false, features = ["std", "derive", "help", "usage"] } +indexmap = { version = "2.2.6", optional = true } +serde = { version = "1.0.197", features = ["derive"] } +serde_json = "1.0.115" +toml = { version = "0.8.12", default-features = false, features = ["parse"] } [features] default = ["preserve_order"] diff --git a/crates/connector_configs/Cargo.toml b/crates/connector_configs/Cargo.toml index 7966e6a5afe..de0c963d7b6 100644 --- a/crates/connector_configs/Cargo.toml +++ b/crates/connector_configs/Cargo.toml @@ -16,7 +16,7 @@ payouts = ["api_models/payouts"] [dependencies] api_models = { version = "0.1.0", path = "../api_models", package = "api_models" } -serde = { version = "1.0.193", features = ["derive"] } -serde_with = "3.4.0" -toml = "0.7.3" -utoipa = { version = "3.5.0", features = ["preserve_order", "preserve_path_order"] } +serde = { version = "1.0.197", features = ["derive"] } +serde_with = "3.7.0" +toml = "0.8.12" +utoipa = { version = "4.2.0", features = ["preserve_order", "preserve_path_order"] } diff --git a/crates/currency_conversion/Cargo.toml b/crates/currency_conversion/Cargo.toml index d2c99080bf6..40129258a67 100644 --- a/crates/currency_conversion/Cargo.toml +++ b/crates/currency_conversion/Cargo.toml @@ -3,6 +3,8 @@ name = "currency_conversion" description = "Currency conversion for cost based routing" version = "0.1.0" edition.workspace = true +rust-version.workspace = true +license.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] @@ -10,7 +12,7 @@ edition.workspace = true common_enums = { version = "0.1.0", path = "../common_enums", package = "common_enums" } # Third party crates -rust_decimal = "1.29" +rust_decimal = "1.35" rusty-money = { git = "https://github.com/varunsrin/rusty_money", rev = "bbc0150742a0fff905225ff11ee09388e9babdcc", features = ["iso", "crypto"] } -serde = { version = "1.0.193", features = ["derive"] } -thiserror = "1.0.43" +serde = { version = "1.0.197", features = ["derive"] } +thiserror = "1.0.58" diff --git a/crates/data_models/Cargo.toml b/crates/data_models/Cargo.toml index 090983246d7..6da89dc2325 100644 --- a/crates/data_models/Cargo.toml +++ b/crates/data_models/Cargo.toml @@ -21,9 +21,9 @@ masking = { version = "0.1.0", path = "../masking" } diesel_models = { version = "0.1.0", path = "../diesel_models", features = ["kv_store"] } # Third party deps -async-trait = "0.1.68" +async-trait = "0.1.79" error-stack = "0.4.1" -serde = { version = "1.0.193", features = ["derive"] } -serde_json = "1.0.108" -thiserror = "1.0.40" -time = { version = "0.3.21", features = ["serde", "serde-well-known", "std"] } +serde = { version = "1.0.197", features = ["derive"] } +serde_json = "1.0.115" +thiserror = "1.0.58" +time = { version = "0.3.34", features = ["serde", "serde-well-known", "std"] } diff --git a/crates/diesel_models/Cargo.toml b/crates/diesel_models/Cargo.toml index d0ef6169335..85533d0cf33 100644 --- a/crates/diesel_models/Cargo.toml +++ b/crates/diesel_models/Cargo.toml @@ -13,18 +13,18 @@ kv_store = [] [dependencies] async-bb8-diesel = { git = "https://github.com/jarnura/async-bb8-diesel", rev = "53b4ab901aab7635c8215fd1c2d542c8db443094" } -diesel = { version = "2.1.0", features = ["postgres", "serde_json", "time", "64-column-tables"] } +diesel = { version = "2.1.5", features = ["postgres", "serde_json", "time", "64-column-tables"] } error-stack = "0.4.1" -frunk = "0.4.1" -frunk_core = "0.4.1" -serde = { version = "1.0.193", features = ["derive"] } -serde_json = "1.0.108" -strum = { version = "0.24.1", features = ["derive"] } -thiserror = "1.0.40" -time = { version = "0.3.21", features = ["serde", "serde-well-known", "std"] } +frunk = "0.4.2" +frunk_core = "0.4.2" +serde = { version = "1.0.197", features = ["derive"] } +serde_json = "1.0.115" +strum = { version = "0.26.2", features = ["derive"] } +thiserror = "1.0.58" +time = { version = "0.3.34", features = ["serde", "serde-well-known", "std"] } # First party crates -common_enums = { path = "../common_enums" } +common_enums = { version = "0.1.0", path = "../common_enums" } common_utils = { version = "0.1.0", path = "../common_utils" } masking = { version = "0.1.0", path = "../masking" } router_derive = { version = "0.1.0", path = "../router_derive" } diff --git a/crates/drainer/Cargo.toml b/crates/drainer/Cargo.toml index 4a2f7f1720e..424ca658847 100644 --- a/crates/drainer/Cargo.toml +++ b/crates/drainer/Cargo.toml @@ -12,22 +12,22 @@ release = ["vergen", "external_services/aws_kms"] vergen = ["router_env/vergen"] [dependencies] -actix-web = "4.3.1" +actix-web = "4.5.1" async-bb8-diesel = { git = "https://github.com/jarnura/async-bb8-diesel", rev = "53b4ab901aab7635c8215fd1c2d542c8db443094" } bb8 = "0.8" -clap = { version = "4.3.2", default-features = false, features = ["std", "derive", "help", "usage"] } -config = { version = "0.13.3", features = ["toml"] } -diesel = { version = "2.1.0", features = ["postgres"] } +clap = { version = "4.4.18", default-features = false, features = ["std", "derive", "help", "usage"] } +config = { version = "0.14.0", features = ["toml"] } +diesel = { version = "2.1.5", features = ["postgres"] } error-stack = "0.4.1" mime = "0.3.17" -once_cell = "1.18.0" -reqwest = { version = "0.11.18" } -serde = "1.0.193" -serde_json = "1.0.108" -serde_path_to_error = "0.1.14" -thiserror = "1.0.40" -tokio = { version = "1.36.0", features = ["macros", "rt-multi-thread"] } -async-trait = "0.1.74" +once_cell = "1.19.0" +reqwest = { version = "0.11.27" } +serde = "1.0.197" +serde_json = "1.0.115" +serde_path_to_error = "0.1.16" +thiserror = "1.0.58" +tokio = { version = "1.37.0", features = ["macros", "rt-multi-thread"] } +async-trait = "0.1.79" # First Party Crates common_utils = { version = "0.1.0", path = "../common_utils", features = ["signals"] } diff --git a/crates/euclid/Cargo.toml b/crates/euclid/Cargo.toml index 256ed784512..7de27645523 100644 --- a/crates/euclid/Cargo.toml +++ b/crates/euclid/Cargo.toml @@ -4,19 +4,20 @@ description = "DSL for static routing" version = "0.1.0" edition.workspace = true rust-version.workspace = true +license.workspace = true [dependencies] -erased-serde = "0.3.28" -frunk = "0.4.1" -frunk_core = "0.4.1" +erased-serde = "0.4.4" +frunk = "0.4.2" +frunk_core = "0.4.2" nom = { version = "7.1.3", features = ["alloc"], optional = true } -once_cell = "1.18.0" +once_cell = "1.19.0" rustc-hash = "1.1.0" -serde = { version = "1.0.193", features = ["derive", "rc"] } -serde_json = "1.0.108" -strum = { version = "0.25", features = ["derive"] } -thiserror = "1.0.43" -utoipa = { version = "3.5.0", features = ["preserve_order", "preserve_path_order"] } +serde = { version = "1.0.197", features = ["derive", "rc"] } +serde_json = "1.0.115" +strum = { version = "0.26", features = ["derive"] } +thiserror = "1.0.58" +utoipa = { version = "4.2.0", features = ["preserve_order", "preserve_path_order"] } # First party dependencies common_enums = { version = "0.1.0", path = "../common_enums" } diff --git a/crates/euclid/src/enums.rs b/crates/euclid/src/enums.rs index 7bd32d33633..f473c5980c7 100644 --- a/crates/euclid/src/enums.rs +++ b/crates/euclid/src/enums.rs @@ -48,7 +48,7 @@ collect_variants!(PayoutWalletType); PartialEq, Eq, strum::Display, - strum::EnumVariantNames, + strum::VariantNames, strum::EnumIter, strum::EnumString, serde::Serialize, @@ -68,7 +68,7 @@ pub enum MandateAcceptanceType { PartialEq, Eq, strum::Display, - strum::EnumVariantNames, + strum::VariantNames, strum::EnumIter, strum::EnumString, serde::Serialize, @@ -88,7 +88,7 @@ pub enum PaymentType { PartialEq, Eq, strum::Display, - strum::EnumVariantNames, + strum::VariantNames, strum::EnumIter, strum::EnumString, serde::Serialize, @@ -109,7 +109,7 @@ pub enum MandateType { PartialEq, Eq, strum::Display, - strum::EnumVariantNames, + strum::VariantNames, strum::EnumIter, strum::EnumString, serde::Serialize, @@ -131,7 +131,7 @@ pub enum PayoutBankTransferType { PartialEq, Eq, strum::Display, - strum::EnumVariantNames, + strum::VariantNames, strum::EnumIter, strum::EnumString, serde::Serialize, @@ -151,7 +151,7 @@ pub enum PayoutWalletType { PartialEq, Eq, strum::Display, - strum::EnumVariantNames, + strum::VariantNames, strum::EnumIter, strum::EnumString, serde::Serialize, diff --git a/crates/euclid/src/frontend/dir.rs b/crates/euclid/src/frontend/dir.rs index 7fb12d96c3e..e00d821a310 100644 --- a/crates/euclid/src/frontend/dir.rs +++ b/crates/euclid/src/frontend/dir.rs @@ -113,7 +113,7 @@ impl DirKey { serde::Serialize, strum::Display, strum::EnumIter, - strum::EnumVariantNames, + strum::VariantNames, strum::EnumString, strum::EnumMessage, strum::EnumProperty, @@ -490,7 +490,7 @@ impl DirKeyKind { } #[derive( - Debug, Clone, Hash, PartialEq, Eq, serde::Serialize, strum::Display, strum::EnumVariantNames, + Debug, Clone, Hash, PartialEq, Eq, serde::Serialize, strum::Display, strum::VariantNames, )] #[serde(tag = "key", content = "value")] pub enum DirValue { @@ -677,7 +677,7 @@ impl DirValue { serde::Serialize, strum::Display, strum::EnumIter, - strum::EnumVariantNames, + strum::VariantNames, strum::EnumString, strum::EnumMessage, strum::EnumProperty, @@ -743,7 +743,7 @@ pub enum PayoutDirKeyKind { #[cfg(feature = "payouts")] #[derive( - Debug, Clone, Hash, PartialEq, Eq, serde::Serialize, strum::Display, strum::EnumVariantNames, + Debug, Clone, Hash, PartialEq, Eq, serde::Serialize, strum::Display, strum::VariantNames, )] pub enum PayoutDirValue { #[serde(rename = "business_country", alias = "country")] diff --git a/crates/euclid/src/frontend/dir/enums.rs b/crates/euclid/src/frontend/dir/enums.rs index ab33f16fb0a..ee64c4ca333 100644 --- a/crates/euclid/src/frontend/dir/enums.rs +++ b/crates/euclid/src/frontend/dir/enums.rs @@ -16,7 +16,7 @@ pub use crate::enums::{PayoutBankTransferType, PayoutType, PayoutWalletType}; PartialEq, Eq, strum::Display, - strum::EnumVariantNames, + strum::VariantNames, strum::EnumIter, strum::EnumString, serde::Serialize, @@ -36,7 +36,7 @@ pub enum CardType { PartialEq, Eq, strum::Display, - strum::EnumVariantNames, + strum::VariantNames, strum::EnumIter, strum::EnumString, serde::Serialize, @@ -61,7 +61,7 @@ pub enum PayLaterType { PartialEq, Eq, strum::Display, - strum::EnumVariantNames, + strum::VariantNames, strum::EnumIter, strum::EnumString, serde::Serialize, @@ -98,7 +98,7 @@ pub enum WalletType { PartialEq, Eq, strum::Display, - strum::EnumVariantNames, + strum::VariantNames, strum::EnumIter, strum::EnumString, serde::Serialize, @@ -130,7 +130,7 @@ pub enum VoucherType { PartialEq, Eq, strum::Display, - strum::EnumVariantNames, + strum::VariantNames, strum::EnumIter, strum::EnumString, serde::Serialize, @@ -164,7 +164,7 @@ pub enum BankRedirectType { PartialEq, Eq, strum::Display, - strum::EnumVariantNames, + strum::VariantNames, strum::EnumIter, strum::EnumString, serde::Serialize, @@ -195,7 +195,7 @@ pub enum BankTransferType { PartialEq, Eq, strum::Display, - strum::EnumVariantNames, + strum::VariantNames, strum::EnumIter, strum::EnumString, serde::Serialize, @@ -215,7 +215,7 @@ pub enum GiftCardType { PartialEq, Eq, strum::Display, - strum::EnumVariantNames, + strum::VariantNames, strum::EnumIter, strum::EnumString, serde::Serialize, @@ -237,7 +237,7 @@ pub enum CardRedirectType { PartialEq, Eq, strum::Display, - strum::EnumVariantNames, + strum::VariantNames, strum::EnumIter, strum::EnumString, serde::Serialize, @@ -256,7 +256,7 @@ pub enum CryptoType { PartialEq, Eq, strum::Display, - strum::EnumVariantNames, + strum::VariantNames, strum::EnumIter, strum::EnumString, serde::Serialize, @@ -275,7 +275,7 @@ pub enum UpiType { PartialEq, Eq, strum::Display, - strum::EnumVariantNames, + strum::VariantNames, strum::EnumIter, strum::EnumString, serde::Serialize, @@ -297,7 +297,7 @@ pub enum BankDebitType { PartialEq, Eq, strum::Display, - strum::EnumVariantNames, + strum::VariantNames, strum::EnumIter, strum::EnumString, serde::Serialize, diff --git a/crates/euclid/src/types.rs b/crates/euclid/src/types.rs index 59736ae6512..904525d54b7 100644 --- a/crates/euclid/src/types.rs +++ b/crates/euclid/src/types.rs @@ -23,7 +23,7 @@ pub type Metadata = std::collections::HashMap<String, serde_json::Value>; PartialEq, Eq, strum::Display, - strum::EnumVariantNames, + strum::VariantNames, strum::EnumString, )] pub enum EuclidKey { diff --git a/crates/euclid_macros/Cargo.toml b/crates/euclid_macros/Cargo.toml index 2524887a8a0..d3bd99bfbee 100644 --- a/crates/euclid_macros/Cargo.toml +++ b/crates/euclid_macros/Cargo.toml @@ -4,13 +4,14 @@ description = "Macros for Euclid DSL" version = "0.1.0" edition.workspace = true rust-version.workspace = true +license.workspace = true [lib] proc-macro = true [dependencies] -proc-macro2 = "1.0.51" -quote = "1.0.23" +proc-macro2 = "1.0.79" +quote = "1.0.35" rustc-hash = "1.1.0" -strum = { version = "0.24", features = ["derive"] } -syn = "1.0.109" +strum = { version = "0.26", features = ["derive"] } +syn = "2.0.57" diff --git a/crates/euclid_wasm/Cargo.toml b/crates/euclid_wasm/Cargo.toml index d33ed2688a9..6f5d3ec9cc3 100644 --- a/crates/euclid_wasm/Cargo.toml +++ b/crates/euclid_wasm/Cargo.toml @@ -4,6 +4,7 @@ description = "WASM bindings for Euclid DSL" version = "0.1.0" edition.workspace = true rust-version.workspace = true +license.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [lib] @@ -24,15 +25,15 @@ payouts = ["api_models/payouts", "euclid/payouts"] api_models = { version = "0.1.0", path = "../api_models", package = "api_models" } currency_conversion = { version = "0.1.0", path = "../currency_conversion" } connector_configs = { version = "0.1.0", path = "../connector_configs" } -euclid = { path = "../euclid", features = [] } +euclid = { version = "0.1.0", path = "../euclid", features = [] } kgraph_utils = { version = "0.1.0", path = "../kgraph_utils" } common_enums = { version = "0.1.0", path = "../common_enums" } # Third party crates -getrandom = { version = "0.2.10", features = ["js"] } -once_cell = "1.18.0" +getrandom = { version = "0.2.12", features = ["js"] } +once_cell = "1.19.0" ron-parser = "0.1.4" serde = { version = "1.0", features = [] } -serde-wasm-bindgen = "0.5" -strum = { version = "0.25", features = ["derive"] } -wasm-bindgen = { version = "0.2.86" } +serde-wasm-bindgen = "0.6.5" +strum = { version = "0.26", features = ["derive"] } +wasm-bindgen = { version = "0.2.92" } diff --git a/crates/external_services/Cargo.toml b/crates/external_services/Cargo.toml index f19216f74d7..31e22d4a640 100644 --- a/crates/external_services/Cargo.toml +++ b/crates/external_services/Cargo.toml @@ -11,26 +11,26 @@ license.workspace = true aws_kms = ["dep:aws-config", "dep:aws-sdk-kms"] email = ["dep:aws-config"] aws_s3 = ["dep:aws-config", "dep:aws-sdk-s3"] -hashicorp-vault = [ "dep:vaultrs" ] +hashicorp-vault = ["dep:vaultrs"] [dependencies] -async-trait = "0.1.68" +async-trait = "0.1.79" aws-config = { version = "0.55.3", optional = true } aws-sdk-kms = { version = "0.28.0", optional = true } aws-sdk-sesv2 = "0.28.0" aws-sdk-sts = "0.28.0" aws-sdk-s3 = { version = "0.28.0", optional = true } aws-smithy-client = "0.55.3" -base64 = "0.21.2" -dyn-clone = "1.0.11" +base64 = "0.22.0" +dyn-clone = "1.0.17" error-stack = "0.4.1" -once_cell = "1.18.0" -serde = { version = "1.0.193", features = ["derive"] } -thiserror = "1.0.40" -tokio = "1.36.0" +once_cell = "1.19.0" +serde = { version = "1.0.197", features = ["derive"] } +thiserror = "1.0.58" +tokio = "1.37.0" hyper-proxy = "0.9.1" -hyper = "0.14.26" -vaultrs = { version = "0.7.0", optional = true } +hyper = "0.14.28" +vaultrs = { version = "0.7.2", optional = true } hex = "0.4.3" # First party crates diff --git a/crates/hyperswitch_interfaces/Cargo.toml b/crates/hyperswitch_interfaces/Cargo.toml index 855cf63917f..034e0a67d92 100644 --- a/crates/hyperswitch_interfaces/Cargo.toml +++ b/crates/hyperswitch_interfaces/Cargo.toml @@ -7,10 +7,10 @@ readme = "README.md" license.workspace = true [dependencies] -async-trait = "0.1.68" -dyn-clone = "1.0.11" -serde = { version = "1.0.193", features = ["derive"] } -thiserror = "1.0.40" +async-trait = "0.1.79" +dyn-clone = "1.0.17" +serde = { version = "1.0.197", features = ["derive"] } +thiserror = "1.0.58" # First party crates common_utils = { version = "0.1.0", path = "../common_utils" } diff --git a/crates/kgraph_utils/Cargo.toml b/crates/kgraph_utils/Cargo.toml index a07285167e4..4ad5ef04f42 100644 --- a/crates/kgraph_utils/Cargo.toml +++ b/crates/kgraph_utils/Cargo.toml @@ -4,6 +4,7 @@ description = "Utilities for constructing and working with Knowledge Graphs" version = "0.1.0" edition.workspace = true rust-version.workspace = true +license.workspace = true [features] dummy_connector = ["api_models/dummy_connector", "euclid/dummy_connector"] @@ -16,9 +17,9 @@ euclid = { version = "0.1.0", path = "../euclid" } masking = { version = "0.1.0", path = "../masking/" } # Third party crates -serde = "1.0.193" -serde_json = "1.0.108" -thiserror = "1.0.43" +serde = "1.0.197" +serde_json = "1.0.115" +thiserror = "1.0.58" [dev-dependencies] criterion = "0.5" diff --git a/crates/masking/Cargo.toml b/crates/masking/Cargo.toml index 23f207d63d5..e7f3550ed7e 100644 --- a/crates/masking/Cargo.toml +++ b/crates/masking/Cargo.toml @@ -18,12 +18,12 @@ rustdoc-args = ["--cfg", "docsrs"] [dependencies] bytes = { version = "1", optional = true } -diesel = { version = "2.1.0", features = ["postgres", "serde_json", "time"], optional = true } -erased-serde = "0.3.31" +diesel = { version = "2.1.5", features = ["postgres", "serde_json", "time"], optional = true } +erased-serde = "0.4.4" serde = { version = "1", features = ["derive"], optional = true } -serde_json = { version = "1.0.108", optional = true } -subtle = "=2.4.1" -zeroize = { version = "1.6", default-features = false } +serde_json = { version = "1.0.115", optional = true } +subtle = "2.5.0" +zeroize = { version = "1.7", default-features = false } [dev-dependencies] -serde_json = "1.0.108" +serde_json = "1.0.115" diff --git a/crates/openapi/Cargo.toml b/crates/openapi/Cargo.toml index 330f5ed890f..8cf8c156ba0 100644 --- a/crates/openapi/Cargo.toml +++ b/crates/openapi/Cargo.toml @@ -8,7 +8,7 @@ license.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -serde_json = "1.0.96" -utoipa = { version = "3.5.0", features = ["preserve_order", "preserve_path_order", "time"] } +serde_json = "1.0.115" +utoipa = { version = "4.2.0", features = ["preserve_order", "preserve_path_order", "time"] } api_models = { version = "0.1.0", path = "../api_models", features = ["frm", "payouts", "openapi"] } diff --git a/crates/pm_auth/Cargo.toml b/crates/pm_auth/Cargo.toml index ef21539d4fa..bb56db6f232 100644 --- a/crates/pm_auth/Cargo.toml +++ b/crates/pm_auth/Cargo.toml @@ -5,6 +5,7 @@ version = "0.1.0" edition.workspace = true rust-version.workspace = true readme = "README.md" +license.workspace = true [dependencies] # First party crates @@ -16,12 +17,12 @@ router_derive = { version = "0.1.0", path = "../router_derive" } router_env = { version = "0.1.0", path = "../router_env", features = ["log_extra_implicit_fields", "log_custom_entries_to_extra"] } # Third party crates -async-trait = "0.1.66" -bytes = "1.4.0" +async-trait = "0.1.79" +bytes = "1.6.0" error-stack = "0.4.1" -http = "0.2.9" +http = "0.2.12" mime = "0.3.17" -serde = "1.0.193" -serde_json = "1.0.108" -strum = { version = "0.24.1", features = ["derive"] } -thiserror = "1.0.43" +serde = "1.0.197" +serde_json = "1.0.115" +strum = { version = "0.26.2", features = ["derive"] } +thiserror = "1.0.58" diff --git a/crates/redis_interface/Cargo.toml b/crates/redis_interface/Cargo.toml index 233781b52e4..1fb74be79d9 100644 --- a/crates/redis_interface/Cargo.toml +++ b/crates/redis_interface/Cargo.toml @@ -11,14 +11,14 @@ license.workspace = true error-stack = "0.4.1" fred = { version = "7.1.2", features = ["metrics", "partial-tracing", "subscriber-client", "check-unresponsive"] } futures = "0.3" -serde = { version = "1.0.193", features = ["derive"] } -thiserror = "1.0.40" -tokio = "1.36.0" -tokio-stream = {version = "0.1.14", features = ["sync"]} +serde = { version = "1.0.197", features = ["derive"] } +thiserror = "1.0.58" +tokio = "1.37.0" +tokio-stream = {version = "0.1.15", features = ["sync"]} # First party crates common_utils = { version = "0.1.0", path = "../common_utils", features = ["async_ext"] } router_env = { version = "0.1.0", path = "../router_env", features = ["log_extra_implicit_fields", "log_custom_entries_to_extra"] } [dev-dependencies] -tokio = { version = "1.36.0", features = ["macros", "rt-multi-thread"] } +tokio = { version = "1.37.0", features = ["macros", "rt-multi-thread"] } diff --git a/crates/router/Cargo.toml b/crates/router/Cargo.toml index 288e2001876..002e22ec4d8 100644 --- a/crates/router/Cargo.toml +++ b/crates/router/Cargo.toml @@ -26,80 +26,75 @@ dummy_connector = ["api_models/dummy_connector", "euclid/dummy_connector", "kgra connector_choice_mca_id = ["api_models/connector_choice_mca_id", "euclid/connector_choice_mca_id", "kgraph_utils/connector_choice_mca_id"] external_access_dc = ["dummy_connector"] detailed_errors = ["api_models/detailed_errors", "error-stack/serde"] -payouts = [ - "api_models/payouts", - "common_enums/payouts", - "data_models/payouts", - "storage_impl/payouts" -] +payouts = ["api_models/payouts", "common_enums/payouts", "data_models/payouts", "storage_impl/payouts"] payout_retry = ["payouts"] recon = ["email", "api_models/recon"] retry = [] [dependencies] -actix-cors = "0.6.4" -actix-multipart = "0.6.0" -actix-rt = "2.8.0" -actix-web = "4.3.1" +actix-cors = "0.6.5" +actix-multipart = "0.6.1" +actix-rt = "2.9.0" +actix-web = "4.5.1" async-bb8-diesel = { git = "https://github.com/jarnura/async-bb8-diesel", rev = "53b4ab901aab7635c8215fd1c2d542c8db443094" } -argon2 = { version = "0.5.0", features = ["std"] } -async-trait = "0.1.68" -base64 = "0.21.2" +argon2 = { version = "0.5.3", features = ["std"] } +async-trait = "0.1.79" +base64 = "0.22.0" bb8 = "0.8" bigdecimal = "0.3.1" -blake3 = "1.3.3" -bytes = "1.4.0" -clap = { version = "4.3.2", default-features = false, features = ["std", "derive", "help", "usage"] } -config = { version = "0.13.3", features = ["toml"] } -cookie = "0.18.0" -diesel = { version = "2.1.0", features = ["postgres"] } -digest = "0.9" -dyn-clone = "1.0.11" -encoding_rs = "0.8.32" +blake3 = "1.5.1" +bytes = "1.6.0" +clap = { version = "4.4.18", default-features = false, features = ["std", "derive", "help", "usage"] } +config = { version = "0.14.0", features = ["toml"] } +cookie = "0.18.1" +diesel = { version = "2.1.5", features = ["postgres"] } +digest = "0.10.7" +dyn-clone = "1.0.17" +encoding_rs = "0.8.33" error-stack = "0.4.1" -futures = "0.3.28" +futures = "0.3.30" hex = "0.4.3" -http = "0.2.9" -hyper = "0.14.27" -image = "0.23.14" -infer = "0.13.0" -josekit = "0.8.3" -jsonwebtoken = "8.3.0" -maud = { version = "0.25", features = ["actix-web"] } +http = "0.2.12" +hyper = "0.14.28" +image = { version = "0.25.1", default-features = false, features = ["png"] } +infer = "0.15.0" +josekit = "0.8.6" +jsonwebtoken = "9.2.0" +maud = { version = "0.26.0", features = ["actix-web"] } mimalloc = { version = "0.1", optional = true } mime = "0.3.17" nanoid = "0.4.0" -num_cpus = "1.15.0" -once_cell = "1.18.0" -openssl = "0.10.60" -qrcode = "0.12.0" +num_cpus = "1.16.0" +once_cell = "1.19.0" +openssl = "0.10.64" +qrcode = "0.14.0" rand = "0.8.5" rand_chacha = "0.3.1" -regex = "1.8.4" -reqwest = { version = "0.11.18", features = ["json", "native-tls", "gzip", "multipart"] } -ring = "0.16.20" -roxmltree = "0.18.0" -rust_decimal = { version = "1.30.0", features = ["serde-with-float", "serde-with-str"] } +regex = "1.10.4" +reqwest = { version = "0.11.27", features = ["json", "native-tls", "gzip", "multipart"] } +ring = "0.17.8" +roxmltree = "0.19.0" +rust_decimal = { version = "1.35.0", features = ["serde-with-float", "serde-with-str"] } rustc-hash = "1.1.0" -serde = { version = "1.0.193", features = ["derive"] } -serde_json = "1.0.108" -serde_path_to_error = "0.1.14" +serde = { version = "1.0.197", features = ["derive"] } +serde_json = "1.0.115" +serde_path_to_error = "0.1.16" serde_qs = { version = "0.12.0", optional = true } serde_urlencoded = "0.7.1" -serde_with = "3.4.0" -sha-1 = { version = "0.9" } -sqlx = { version = "0.6.3", features = ["postgres", "runtime-actix", "runtime-actix-native-tls", "time", "bigdecimal"] } -strum = { version = "0.25", features = ["derive"] } +serde_with = "3.7.0" +sha1 = { version = "0.10.6" } +sqlx = { version = "0.7.3", features = ["postgres", "runtime-tokio", "runtime-tokio-native-tls", "time", "bigdecimal"] } +strum = { version = "0.26", features = ["derive"] } tera = "1.19.1" -thiserror = "1.0.40" -time = { version = "0.3.21", features = ["serde", "serde-well-known", "std"] } -tokio = { version = "1.36.0", features = ["macros", "rt-multi-thread"] } -unicode-segmentation = "1.10.1" -url = { version = "2.4.0", features = ["serde"] } -utoipa = { version = "3.5.0", features = ["preserve_order", "preserve_path_order", "time"] } -uuid = { version = "1.7.0", features = ["v4"] } -validator = "0.16.0" -x509-parser = "0.15.0" +thiserror = "1.0.58" +time = { version = "0.3.34", features = ["serde", "serde-well-known", "std"] } +tokio = { version = "1.37.0", features = ["macros", "rt-multi-thread"] } +unicode-segmentation = "1.11.0" +url = { version = "2.5.0", features = ["serde"] } +utoipa = { version = "4.2.0", features = ["preserve_order", "preserve_path_order", "time"] } +uuid = { version = "1.8.0", features = ["v4"] } +validator = "0.17.0" +x509-parser = "0.16.0" tracing-futures = { version = "0.2.5", features = ["tokio"] } # First party crates @@ -123,25 +118,25 @@ router_env = { version = "0.1.0", path = "../router_env", features = ["log_extra scheduler = { version = "0.1.0", path = "../scheduler", default-features = false } storage_impl = { version = "0.1.0", path = "../storage_impl", default-features = false } openapi = { version = "0.1.0", path = "../openapi", optional = true } -erased-serde = "0.3.31" +erased-serde = "0.4.4" quick-xml = { version = "0.31.0", features = ["serialize"] } -rdkafka = "0.36.0" +rdkafka = "0.36.2" isocountry = "0.3.2" iso_currency = "0.4.4" -actix-http = "3.3.1" +actix-http = "3.6.0" [build-dependencies] router_env = { version = "0.1.0", path = "../router_env", default-features = false } [dev-dependencies] -actix-http = "3.3.1" -awc = { version = "3.1.1", features = ["rustls"] } +actix-http = "3.6.0" +awc = { version = "3.4.0", features = ["rustls"] } derive_deref = "1.1.1" rand = "0.8.5" -serial_test = "2.0.0" -time = { version = "0.3.21", features = ["macros"] } -tokio = "1.36.0" -wiremock = "0.5.18" +serial_test = "3.0.0" +time = { version = "0.3.34", features = ["macros"] } +tokio = "1.37.0" +wiremock = "0.6.0" # First party dev-dependencies diff --git a/crates/router/src/types/domain/user.rs b/crates/router/src/types/domain/user.rs index 4625a72f5dd..93df373d21a 100644 --- a/crates/router/src/types/domain/user.rs +++ b/crates/router/src/types/domain/user.rs @@ -85,11 +85,13 @@ static BLOCKED_EMAIL: Lazy<HashSet<String>> = Lazy::new(|| { impl UserEmail { pub fn new(email: Secret<String, pii::EmailStrategy>) -> UserResult<Self> { + use validator::ValidateEmail; + let email_string = email.expose(); let email = pii::Email::from_str(&email_string).change_context(UserErrors::EmailParsingError)?; - if validator::validate_email(&email_string) { + if email_string.validate_email() { let (_username, domain) = match email_string.as_str().split_once('@') { Some((u, d)) => (u, d), None => return Err(UserErrors::EmailParsingError.into()), @@ -105,8 +107,10 @@ impl UserEmail { } pub fn from_pii_email(email: pii::Email) -> UserResult<Self> { + use validator::ValidateEmail; + let email_string = email.peek(); - if validator::validate_email(email_string) { + if email_string.validate_email() { let (_username, domain) = match email_string.split_once('@') { Some((u, d)) => (u, d), None => return Err(UserErrors::EmailParsingError.into()), diff --git a/crates/router/src/utils.rs b/crates/router/src/utils.rs index 56f68e33d3b..1a3eb92d240 100644 --- a/crates/router/src/utils.rs +++ b/crates/router/src/utils.rs @@ -176,15 +176,15 @@ impl QrImage { let qrcode_image_buffer = qr_code.render::<Luma<u8>>().build(); let qrcode_dynamic_image = image::DynamicImage::ImageLuma8(qrcode_image_buffer); - let mut image_bytes = Vec::new(); + let mut image_bytes = std::io::BufWriter::new(std::io::Cursor::new(Vec::new())); // Encodes qrcode_dynamic_image and write it to image_bytes - let _ = qrcode_dynamic_image.write_to(&mut image_bytes, image::ImageOutputFormat::Png); + let _ = qrcode_dynamic_image.write_to(&mut image_bytes, image::ImageFormat::Png); let image_data_source = format!( "{},{}", consts::QR_IMAGE_DATA_SOURCE_STRING, - consts::BASE64_ENGINE.encode(image_bytes) + consts::BASE64_ENGINE.encode(image_bytes.get_ref().get_ref()) ); Ok(Self { data: image_data_source, diff --git a/crates/router_derive/Cargo.toml b/crates/router_derive/Cargo.toml index 07e95b9232c..79378407946 100644 --- a/crates/router_derive/Cargo.toml +++ b/crates/router_derive/Cargo.toml @@ -12,14 +12,13 @@ proc-macro = true doctest = false [dependencies] -indexmap = "2.1.0" -proc-macro2 = "1.0.56" -quote = "1.0.26" -syn = { version = "2.0.5", features = ["full", "extra-traits"] } # the full feature does not seem to encompass all the features -strum = { version = "0.24.1", features = ["derive"] } +indexmap = "2.2.6" +proc-macro2 = "1.0.79" +quote = "1.0.35" +syn = { version = "2.0.57", features = ["full", "extra-traits"] } # the full feature does not seem to encompass all the features +strum = { version = "0.26.2", features = ["derive"] } [dev-dependencies] -diesel = { version = "2.1.0", features = ["postgres"] } -serde = { version = "1.0.193", features = ["derive"] } -serde_json = "1.0.108" - +diesel = { version = "2.1.5", features = ["postgres"] } +serde = { version = "1.0.197", features = ["derive"] } +serde_json = "1.0.115" diff --git a/crates/router_env/Cargo.toml b/crates/router_env/Cargo.toml index c161d02b8d2..72f0f0b39ac 100644 --- a/crates/router_env/Cargo.toml +++ b/crates/router_env/Cargo.toml @@ -9,33 +9,33 @@ license.workspace = true [dependencies] cargo_metadata = "0.18.1" -config = { version = "0.13.3", features = ["toml"] } +config = { version = "0.14.0", features = ["toml"] } error-stack = "0.4.1" gethostname = "0.4.3" -once_cell = "1.18.0" +once_cell = "1.19.0" opentelemetry = { version = "0.19.0", features = ["rt-tokio-current-thread", "metrics"] } opentelemetry-otlp = { version = "0.12.0", features = ["metrics"] } rustc-hash = "1.1" -serde = { version = "1.0.193", features = ["derive"] } -serde_json = "1.0.108" -serde_path_to_error = "0.1.14" -strum = { version = "0.24.1", features = ["derive"] } -time = { version = "0.3.21", default-features = false, features = ["formatting"] } -tokio = { version = "1.36.0" } -tracing = { version = "0.1.37" } +serde = { version = "1.0.197", features = ["derive"] } +serde_json = "1.0.115" +serde_path_to_error = "0.1.16" +strum = { version = "0.26.2", features = ["derive"] } +time = { version = "0.3.34", default-features = false, features = ["formatting"] } +tokio = { version = "1.37.0" } +tracing = { version = "0.1.40" } tracing-actix-web = { version = "0.7.10", features = ["opentelemetry_0_19", "uuid_v7"], optional = true } -tracing-appender = { version = "0.2.2" } +tracing-appender = { version = "0.2.3" } tracing-attributes = "0.1.27" tracing-opentelemetry = { version = "0.19.0" } -tracing-subscriber = { version = "0.3.17", default-features = true, features = ["env-filter", "json", "registry"] } -vergen = { version = "8.2.1", optional = true, features = ["cargo", "git", "git2", "rustc"] } +tracing-subscriber = { version = "0.3.18", default-features = true, features = ["env-filter", "json", "registry"] } +vergen = { version = "8.3.1", optional = true, features = ["cargo", "git", "git2", "rustc"] } [dev-dependencies] -tokio = { version = "1.36.0", features = ["macros", "rt-multi-thread"] } +tokio = { version = "1.37.0", features = ["macros", "rt-multi-thread"] } [build-dependencies] cargo_metadata = "0.18.1" -vergen = { version = "8.2.1", features = ["cargo", "git", "git2", "rustc"], optional = true } +vergen = { version = "8.3.1", features = ["cargo", "git", "git2", "rustc"], optional = true } [features] default = ["actix_web", "payouts"] diff --git a/crates/scheduler/Cargo.toml b/crates/scheduler/Cargo.toml index 4f2a423709f..f713b8f2f2b 100644 --- a/crates/scheduler/Cargo.toml +++ b/crates/scheduler/Cargo.toml @@ -1,7 +1,9 @@ [package] name = "scheduler" version = "0.1.0" -edition = "2021" +edition.workspace = true +rust-version.workspace = true +license.workspace = true [features] default = ["kv_store", "olap"] @@ -11,19 +13,19 @@ email = ["external_services/email"] [dependencies] # Third party crates -async-trait = "0.1.68" +async-trait = "0.1.79" error-stack = "0.4.1" -futures = "0.3.28" -num_cpus = "1.15.0" -once_cell = "1.18.0" +futures = "0.3.30" +num_cpus = "1.16.0" +once_cell = "1.19.0" rand = "0.8.5" -serde = "1.0.193" -serde_json = "1.0.108" -strum = { version = "0.24.1", features = ["derive"] } -thiserror = "1.0.40" -time = { version = "0.3.21", features = ["serde", "serde-well-known", "std"] } -tokio = { version = "1.36.0", features = ["macros", "rt-multi-thread"] } -uuid = { version = "1.7.0", features = ["v4"] } +serde = "1.0.197" +serde_json = "1.0.115" +strum = { version = "0.26.2", features = ["derive"] } +thiserror = "1.0.58" +time = { version = "0.3.34", features = ["serde", "serde-well-known", "std"] } +tokio = { version = "1.37.0", features = ["macros", "rt-multi-thread"] } +uuid = { version = "1.8.0", features = ["v4"] } # First party crates common_utils = { version = "0.1.0", path = "../common_utils", features = ["signals", "async_ext"] } diff --git a/crates/storage_impl/Cargo.toml b/crates/storage_impl/Cargo.toml index d7107cdccfa..5421e301f6a 100644 --- a/crates/storage_impl/Cargo.toml +++ b/crates/storage_impl/Cargo.toml @@ -26,23 +26,22 @@ router_derive = { version = "0.1.0", path = "../router_derive" } router_env = { version = "0.1.0", path = "../router_env" } # Third party crates -actix-web = "4.3.1" +actix-web = "4.5.1" async-bb8-diesel = { git = "https://github.com/jarnura/async-bb8-diesel", rev = "53b4ab901aab7635c8215fd1c2d542c8db443094" } -async-trait = "0.1.72" -bb8 = "0.8.1" -bytes = "1.4.0" -config = { version = "0.13.3", features = ["toml"] } -crc32fast = "1.3.2" -diesel = { version = "2.1.0", default-features = false, features = ["postgres"] } -dyn-clone = "1.0.12" +async-trait = "0.1.79" +bb8 = "0.8.3" +bytes = "1.6.0" +config = { version = "0.14.0", features = ["toml"] } +crc32fast = "1.4.0" +diesel = { version = "2.1.5", default-features = false, features = ["postgres"] } +dyn-clone = "1.0.17" error-stack = "0.4.1" -futures = "0.3.28" -http = "0.2.9" +futures = "0.3.30" +http = "0.2.12" mime = "0.3.17" moka = { version = "0.12", features = ["future"] } -once_cell = "1.18.0" -ring = "0.16.20" -serde = { version = "1.0.193", features = ["derive"] } -serde_json = "1.0.108" -thiserror = "1.0.40" -tokio = { version = "1.36.0", features = ["rt-multi-thread"] } +once_cell = "1.19.0" +serde = { version = "1.0.197", features = ["derive"] } +serde_json = "1.0.115" +thiserror = "1.0.58" +tokio = { version = "1.37.0", features = ["rt-multi-thread"] } diff --git a/crates/storage_impl/src/errors.rs b/crates/storage_impl/src/errors.rs index 7002d0946f7..4c5f84f5b73 100644 --- a/crates/storage_impl/src/errors.rs +++ b/crates/storage_impl/src/errors.rs @@ -12,30 +12,6 @@ use crate::{errors as storage_errors, store::errors::DatabaseError}; pub type ApplicationResult<T> = Result<T, ApplicationError>; -macro_rules! impl_error_display { - ($st: ident, $arg: tt) => { - impl Display for $st { - fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!( - fmt, - "{{ error_type: {:?}, error_description: {} }}", - self, $arg - ) - } - } - }; -} -macro_rules! impl_error_type { - ($name: ident, $arg: tt) => { - #[derive(Debug)] - pub struct $name; - - impl_error_display!($name, $arg); - - impl std::error::Error for $name {} - }; -} - #[derive(Debug, thiserror::Error)] pub enum StorageError { #[error("DatabaseError: {0:?}")] @@ -176,8 +152,6 @@ impl RedisErrorExt for error_stack::Report<RedisError> { } } -impl_error_type!(EncryptionError, "Encryption error"); - #[derive(Debug, thiserror::Error)] pub enum ApplicationError { // Display's impl can be overridden by the attribute error marco. @@ -210,12 +184,6 @@ impl From<std::io::Error> for ApplicationError { } } -impl From<ring::error::Unspecified> for EncryptionError { - fn from(_: ring::error::Unspecified) -> Self { - Self - } -} - impl From<ConfigError> for ApplicationError { fn from(err: ConfigError) -> Self { Self::ConfigurationError(err) diff --git a/crates/test_utils/Cargo.toml b/crates/test_utils/Cargo.toml index 59ff36e6cc5..714e34f0e95 100644 --- a/crates/test_utils/Cargo.toml +++ b/crates/test_utils/Cargo.toml @@ -13,20 +13,20 @@ dummy_connector = [] payouts = [] [dependencies] -async-trait = "0.1.68" -base64 = "0.21.2" -clap = { version = "4.3.2", default-features = false, features = ["std", "derive", "help", "usage"] } +async-trait = "0.1.79" +base64 = "0.22.0" +clap = { version = "4.4.18", default-features = false, features = ["std", "derive", "help", "usage"] } rand = "0.8.5" -regex = "1.10.3" -reqwest = { version = "0.11.18", features = ["native-tls"] } -serde = { version = "1.0.193", features = ["derive"] } -serde_json = "1.0.108" +regex = "1.10.4" +reqwest = { version = "0.11.27", features = ["native-tls"] } +serde = { version = "1.0.197", features = ["derive"] } +serde_json = "1.0.115" serde_urlencoded = "0.7.1" -serial_test = "2.0.0" +serial_test = "3.0.0" thirtyfour = "0.31.0" -time = { version = "0.3.21", features = ["macros"] } -tokio = "1.36.0" -toml = "0.7.4" +time = { version = "0.3.34", features = ["macros"] } +tokio = "1.37.0" +toml = "0.8.12" # First party crates masking = { version = "0.1.0", path = "../masking" } diff --git a/crates/test_utils/tests/connectors/adyen_uk_wh_ui.rs b/crates/test_utils/tests/connectors/adyen_uk_wh_ui.rs index 9da7f71324f..4235d0ff17d 100644 --- a/crates/test_utils/tests/connectors/adyen_uk_wh_ui.rs +++ b/crates/test_utils/tests/connectors/adyen_uk_wh_ui.rs @@ -1,4 +1,3 @@ -use serial_test::serial; use thirtyfour::{prelude::*, WebDriver}; use crate::{selenium::*, tester}; @@ -28,7 +27,6 @@ async fn should_make_webhook(web_driver: WebDriver) -> Result<(), WebDriverError } #[test] -#[serial] fn should_make_webhook_test() { tester!(should_make_webhook); } diff --git a/crates/test_utils/tests/connectors/authorizedotnet_wh_ui.rs b/crates/test_utils/tests/connectors/authorizedotnet_wh_ui.rs index b0cf50702c9..b17fd80b0a1 100644 --- a/crates/test_utils/tests/connectors/authorizedotnet_wh_ui.rs +++ b/crates/test_utils/tests/connectors/authorizedotnet_wh_ui.rs @@ -1,5 +1,4 @@ use rand::Rng; -use serial_test::serial; use thirtyfour::{prelude::*, WebDriver}; use crate::{selenium::*, tester}; @@ -31,7 +30,6 @@ async fn should_make_webhook(web_driver: WebDriver) -> Result<(), WebDriverError } #[test] -#[serial] fn should_make_webhook_test() { tester!(should_make_webhook); } diff --git a/crates/test_utils/tests/connectors/bluesnap_wh_ui.rs b/crates/test_utils/tests/connectors/bluesnap_wh_ui.rs index 1d327123944..abaf3d53f50 100644 --- a/crates/test_utils/tests/connectors/bluesnap_wh_ui.rs +++ b/crates/test_utils/tests/connectors/bluesnap_wh_ui.rs @@ -1,4 +1,3 @@ -use serial_test::serial; use thirtyfour::{prelude::*, WebDriver}; use crate::{selenium::*, tester}; @@ -28,7 +27,6 @@ async fn should_make_webhook(web_driver: WebDriver) -> Result<(), WebDriverError } #[test] -#[serial] fn should_make_webhook_test() { tester!(should_make_webhook); } diff --git a/crates/test_utils/tests/connectors/checkout_wh_ui.rs b/crates/test_utils/tests/connectors/checkout_wh_ui.rs index 1692db06072..f9d459765c7 100644 --- a/crates/test_utils/tests/connectors/checkout_wh_ui.rs +++ b/crates/test_utils/tests/connectors/checkout_wh_ui.rs @@ -1,4 +1,3 @@ -use serial_test::serial; use thirtyfour::{prelude::*, WebDriver}; use crate::{selenium::*, tester}; @@ -33,7 +32,6 @@ async fn should_make_webhook(web_driver: WebDriver) -> Result<(), WebDriverError } #[test] -#[serial] fn should_make_webhook_test() { tester!(should_make_webhook); } diff --git a/crates/test_utils/tests/connectors/stripe_wh_ui.rs b/crates/test_utils/tests/connectors/stripe_wh_ui.rs index d5f1e3717e2..31f8e794a46 100644 --- a/crates/test_utils/tests/connectors/stripe_wh_ui.rs +++ b/crates/test_utils/tests/connectors/stripe_wh_ui.rs @@ -1,4 +1,3 @@ -use serial_test::serial; use thirtyfour::{prelude::*, WebDriver}; use crate::{selenium::*, tester}; @@ -29,8 +28,6 @@ async fn should_make_webhook(web_driver: WebDriver) -> Result<(), WebDriverError } #[test] -#[serial] - fn should_make_webhook_test() { tester!(should_make_webhook); } diff --git a/docker/wasm-build.Dockerfile b/docker/wasm-build.Dockerfile index 2ebdcec217e..bddcacdfc64 100644 --- a/docker/wasm-build.Dockerfile +++ b/docker/wasm-build.Dockerfile @@ -4,7 +4,7 @@ ARG RUN_ENV=sandbox ARG EXTRA_FEATURES="" RUN apt-get update \ - && apt-get install -y libssl-dev pkg-config + && apt-get install -y clang libssl-dev pkg-config ENV CARGO_INCREMENTAL=0 # Allow more retries for network requests in cargo (downloading crates) and diff --git a/openapi/openapi_spec.json b/openapi/openapi_spec.json index 595b1830722..ad360ab7dd7 100644 --- a/openapi/openapi_spec.json +++ b/openapi/openapi_spec.json @@ -4709,7 +4709,8 @@ "type": "string", "nullable": true } - } + }, + "additionalProperties": false }, "AddressDetails": { "type": "object", @@ -4778,7 +4779,8 @@ "nullable": true, "maxLength": 255 } - } + }, + "additionalProperties": false }, "AirwallexData": { "type": "object", @@ -6560,7 +6562,8 @@ ], "nullable": true } - } + }, + "additionalProperties": false }, "BusinessProfileResponse": { "type": "object", @@ -6856,7 +6859,8 @@ "description": "Card Type", "nullable": true } - } + }, + "additionalProperties": false }, "CardDetailFromLocker": { "type": "object", @@ -7513,7 +7517,8 @@ "expiration": { "$ref": "#/components/schemas/ApiKeyExpiration" } - } + }, + "additionalProperties": false }, "CreateApiKeyResponse": { "type": "object", @@ -7752,7 +7757,8 @@ ], "nullable": true } - } + }, + "additionalProperties": false }, "CustomerDefaultPaymentMethodResponse": { "type": "object", @@ -8841,7 +8847,8 @@ }, "description": "payment methods that can be used in the payment" } - } + }, + "additionalProperties": false }, "FrmMessage": { "type": "object", @@ -8897,7 +8904,8 @@ }, "description": "payment method types(credit, debit) that can be used in the payment" } - } + }, + "additionalProperties": false }, "FrmPaymentMethodType": { "type": "object", @@ -8921,7 +8929,8 @@ "action": { "$ref": "#/components/schemas/FrmAction" } - } + }, + "additionalProperties": false }, "FrmPreferredFlowTypes": { "type": "string", @@ -9862,7 +9871,8 @@ ], "nullable": true } - } + }, + "additionalProperties": false }, "MandateResponse": { "type": "object", @@ -10120,7 +10130,8 @@ "description": "The id of the organization to which the merchant belongs to", "nullable": true } - } + }, + "additionalProperties": false }, "MerchantAccountDeleteResponse": { "type": "object", @@ -10405,7 +10416,8 @@ "nullable": true, "maxLength": 64 } - } + }, + "additionalProperties": false }, "MerchantConnectorCreate": { "type": "object", @@ -10556,7 +10568,8 @@ ], "nullable": true } - } + }, + "additionalProperties": false }, "MerchantConnectorDeleteResponse": { "type": "object", @@ -10789,7 +10802,8 @@ "status": { "$ref": "#/components/schemas/ConnectorStatus" } - } + }, + "additionalProperties": false }, "MerchantConnectorUpdate": { "type": "object", @@ -10902,7 +10916,8 @@ "status": { "$ref": "#/components/schemas/ConnectorStatus" } - } + }, + "additionalProperties": false }, "MerchantConnectorWebhookDetails": { "type": "object", @@ -10919,7 +10934,8 @@ "type": "string", "example": "12345678900987654321" } - } + }, + "additionalProperties": false }, "MerchantDetails": { "type": "object", @@ -10988,7 +11004,8 @@ ], "nullable": true } - } + }, + "additionalProperties": false }, "MerchantRoutingAlgorithm": { "type": "object", @@ -11370,7 +11387,8 @@ "type": "string", "description": "The user-agent of the customer's browser" } - } + }, + "additionalProperties": false }, "OrderDetails": { "type": "object", @@ -12203,7 +12221,8 @@ "example": "2022-09-10T10:11:12Z", "nullable": true } - } + }, + "additionalProperties": false }, "PaymentListResponse": { "type": "object", @@ -12315,7 +12334,8 @@ ], "nullable": true } - } + }, + "additionalProperties": false }, "PaymentMethodData": { "oneOf": [ @@ -12842,7 +12862,8 @@ "description": "You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.", "nullable": true } - } + }, + "additionalProperties": false }, "PaymentMethodsEnabled": { "type": "object", @@ -12865,7 +12886,8 @@ ], "nullable": true } - } + }, + "additionalProperties": false }, "PaymentRetrieveBody": { "type": "object", @@ -14246,7 +14268,8 @@ ], "nullable": true } - } + }, + "additionalProperties": false }, "PaymentsResponse": { "type": "object", @@ -15542,7 +15565,8 @@ "description": "The business profile to use for this payment, if not passed the default business profile\nassociated with the merchant account will be used.", "nullable": true } - } + }, + "additionalProperties": false }, "PayoutCreateResponse": { "type": "object", @@ -15711,7 +15735,8 @@ "description": "List of attempts", "nullable": true } - } + }, + "additionalProperties": false }, "PayoutEntityType": { "type": "string", @@ -16084,7 +16109,8 @@ "type": "string", "example": "food" } - } + }, + "additionalProperties": false }, "ProductType": { "type": "string", @@ -16386,7 +16412,8 @@ ], "nullable": true } - } + }, + "additionalProperties": false }, "RefundResponse": { "type": "object", @@ -16501,7 +16528,8 @@ "description": "You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.", "nullable": true } - } + }, + "additionalProperties": false }, "RequestPaymentMethodTypes": { "type": "object", @@ -17760,7 +17788,8 @@ ], "nullable": true } - } + }, + "additionalProperties": false }, "UpiData": { "type": "object", @@ -18429,7 +18458,8 @@ "example": true, "nullable": true } - } + }, + "additionalProperties": false } }, "securitySchemes": {
build
update dependencies (#4268)
36a9f0e8b1212500ff1c0f94d09844f368a6d24b
2023-07-07 18:16:25
github-actions[bot]
chore(version): v1.1.0
false
diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a58d75a22f..f8320222b1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,25 @@ All notable changes to HyperSwitch will be documented here. - - - + +## 1.1.0 (2023-07-07) + +### Features + +- **connector:** + - [Globepay] Add template code for Globepay connector ([#1623](https://github.com/juspay/hyperswitch/pull/1623)) ([`06f92c2`](https://github.com/juspay/hyperswitch/commit/06f92c2c4c267e3d6ec914670684bb36b71ecd51)) + - [Payme] add Authorize, Sync, Capture, Refund, Refund Sync, Mandate & web hooks support for cards ([#1594](https://github.com/juspay/hyperswitch/pull/1594)) ([`093cc6a`](https://github.com/juspay/hyperswitch/commit/093cc6a71cb3060c06bc4e6238af8896b36308db)) +- **router:** Get filters for payments ([#1600](https://github.com/juspay/hyperswitch/pull/1600)) ([`d5891ec`](https://github.com/juspay/hyperswitch/commit/d5891ecbd4a110e3885d6504194f7c7811a413d3)) +- Add cache for api_key and mca tables ([#1212](https://github.com/juspay/hyperswitch/pull/1212)) ([`fc9057e`](https://github.com/juspay/hyperswitch/commit/fc9057ef2c601fd8a7deb5d10dc5678abd8e6f7b)) + +### Bug Fixes + +- **router:** Desc payment list for pagination ([#1556](https://github.com/juspay/hyperswitch/pull/1556)) ([`f77fdb7`](https://github.com/juspay/hyperswitch/commit/f77fdb7a6ed354151d8a758a734382a4c3b2698e)) + +**Full Changelog:** [`v1.0.5...v1.1.0`](https://github.com/juspay/hyperswitch/compare/v1.0.5...v1.1.0) + +- - - + ## 1.0.5 (2023-07-06) ### Features
chore
v1.1.0
83dbb7a8daf44bdd3d8c0e98973bba4b90eb5861
2024-07-24 23:01:41
Kiran Kumar
refactor(connector): added amount conversion framework for bitpay (#4973)
false
diff --git a/crates/router/src/connector/bitpay.rs b/crates/router/src/connector/bitpay.rs index 61e8cb03a27..445324dee3f 100644 --- a/crates/router/src/connector/bitpay.rs +++ b/crates/router/src/connector/bitpay.rs @@ -1,13 +1,17 @@ pub mod transformers; -use std::fmt::Debug; - -use common_utils::{errors::ReportSwitchExt, ext_traits::ByteSliceExt, request::RequestContent}; +use common_utils::{ + errors::ReportSwitchExt, + ext_traits::ByteSliceExt, + request::RequestContent, + types::{AmountConvertor, MinorUnit, MinorUnitForConnector}, +}; use error_stack::ResultExt; use masking::PeekInterface; use transformers as bitpay; use self::bitpay::BitpayWebhookDetails; +use super::utils as connector_utils; use crate::{ configs::settings, consts, @@ -27,8 +31,18 @@ use crate::{ utils::BytesExt, }; -#[derive(Debug, Clone)] -pub struct Bitpay; +#[derive(Clone)] +pub struct Bitpay { + amount_converter: &'static (dyn AmountConvertor<Output = MinorUnit> + Sync), +} + +impl Bitpay { + pub fn new() -> &'static Self { + &Self { + amount_converter: &MinorUnitForConnector, + } + } +} impl api::Payment for Bitpay {} impl api::PaymentToken for Bitpay {} @@ -195,12 +209,13 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P req: &types::PaymentsAuthorizeRouterData, _connectors: &settings::Connectors, ) -> CustomResult<RequestContent, errors::ConnectorError> { - let connector_router_data = bitpay::BitpayRouterData::try_from(( - &self.get_currency_unit(), + let amount = connector_utils::convert_amount( + self.amount_converter, + req.request.minor_amount, req.request.currency, - req.request.amount, - req, - ))?; + )?; + + let connector_router_data = bitpay::BitpayRouterData::from((amount, req)); let connector_req = bitpay::BitpayPaymentsRequest::try_from(&connector_router_data)?; Ok(RequestContent::Json(Box::new(connector_req))) diff --git a/crates/router/src/connector/bitpay/transformers.rs b/crates/router/src/connector/bitpay/transformers.rs index 8a54c79b185..ffce669dcaf 100644 --- a/crates/router/src/connector/bitpay/transformers.rs +++ b/crates/router/src/connector/bitpay/transformers.rs @@ -1,3 +1,4 @@ +use common_utils::types::MinorUnit; use masking::Secret; use reqwest::Url; use serde::{Deserialize, Serialize}; @@ -11,25 +12,16 @@ use crate::{ #[derive(Debug, Serialize)] pub struct BitpayRouterData<T> { - pub amount: i64, + pub amount: MinorUnit, pub router_data: T, } -impl<T> TryFrom<(&api::CurrencyUnit, enums::Currency, i64, T)> for BitpayRouterData<T> { - type Error = error_stack::Report<errors::ConnectorError>; - - fn try_from( - (_currency_unit, _currency, amount, router_data): ( - &api::CurrencyUnit, - enums::Currency, - i64, - T, - ), - ) -> Result<Self, Self::Error> { - Ok(Self { +impl<T> From<(MinorUnit, T)> for BitpayRouterData<T> { + fn from((amount, router_data): (MinorUnit, T)) -> Self { + Self { amount, router_data, - }) + } } } @@ -45,7 +37,7 @@ pub enum TransactionSpeed { #[derive(Default, Debug, Serialize, Eq, PartialEq)] #[serde(rename_all = "camelCase")] pub struct BitpayPaymentsRequest { - price: i64, + price: MinorUnit, currency: String, #[serde(rename = "redirectURL")] redirect_url: String, @@ -119,10 +111,10 @@ pub enum ExceptionStatus { pub struct BitpayPaymentResponseData { pub url: Option<Url>, pub status: BitpayPaymentStatus, - pub price: i64, + pub price: MinorUnit, pub currency: String, - pub amount_paid: i64, - pub invoice_time: Option<i64>, + pub amount_paid: MinorUnit, + pub invoice_time: Option<MinorUnit>, pub rate_refresh_time: Option<i64>, pub expiration_time: Option<i64>, pub current_time: Option<i64>, @@ -183,7 +175,7 @@ impl<F, T> // Type definition for RefundRequest #[derive(Default, Debug, Serialize)] pub struct BitpayRefundRequest { - pub amount: i64, + pub amount: MinorUnit, } impl<F> TryFrom<&BitpayRouterData<&types::RefundsRouterData<F>>> for BitpayRefundRequest { @@ -192,7 +184,7 @@ impl<F> TryFrom<&BitpayRouterData<&types::RefundsRouterData<F>>> for BitpayRefun item: &BitpayRouterData<&types::RefundsRouterData<F>>, ) -> Result<Self, Self::Error> { Ok(Self { - amount: item.router_data.request.refund_amount, + amount: item.amount, }) } } diff --git a/crates/router/src/types/api.rs b/crates/router/src/types/api.rs index 174f873e1fc..ec474242d25 100644 --- a/crates/router/src/types/api.rs +++ b/crates/router/src/types/api.rs @@ -367,7 +367,9 @@ impl ConnectorData { enums::Connector::Billwerk => { Ok(ConnectorEnum::Old(Box::new(connector::Billwerk::new()))) } - enums::Connector::Bitpay => Ok(ConnectorEnum::Old(Box::new(&connector::Bitpay))), + enums::Connector::Bitpay => { + Ok(ConnectorEnum::Old(Box::new(connector::Bitpay::new()))) + } enums::Connector::Bluesnap => { Ok(ConnectorEnum::Old(Box::new(connector::Bluesnap::new()))) } diff --git a/crates/router/tests/connectors/bitpay.rs b/crates/router/tests/connectors/bitpay.rs index 6135a33f45d..43959fa683c 100644 --- a/crates/router/tests/connectors/bitpay.rs +++ b/crates/router/tests/connectors/bitpay.rs @@ -13,7 +13,7 @@ impl utils::Connector for BitpayTest { fn get_data(&self) -> api::ConnectorData { use router::connector::Bitpay; utils::construct_connector_data_old( - Box::new(&Bitpay), + Box::new(Bitpay::new()), types::Connector::Bitpay, api::GetToken::Connector, None,
refactor
added amount conversion framework for bitpay (#4973)
f07689e75b8be8f79471b09b3752f0d5a4cec7f5
2024-07-16 16:39:26
Shankar Singh C
fix(routing): do not update `perform_session_flow_routing` output if the `SessionRoutingChoice` is none (#5336)
false
diff --git a/crates/router/src/core/payments/routing.rs b/crates/router/src/core/payments/routing.rs index d1a5441d958..d6904e09a3d 100644 --- a/crates/router/src/core/payments/routing.rs +++ b/crates/router/src/core/payments/routing.rs @@ -1009,7 +1009,9 @@ pub async fn perform_session_flow_routing( }); } } - result.insert(pm_type, session_routing_choice); + if !session_routing_choice.is_empty() { + result.insert(pm_type, session_routing_choice); + } } }
fix
do not update `perform_session_flow_routing` output if the `SessionRoutingChoice` is none (#5336)
1b3b7f5bc62b193d82ea7d39b4b777a6e02d612e
2023-02-24 17:53:16
ItsMeShashank
enhance(router/webhooks): expose additional incoming request details to webhooks flow (#637)
false
diff --git a/connector-template/mod.rs b/connector-template/mod.rs index 8282f7d1698..926a4819738 100644 --- a/connector-template/mod.rs +++ b/connector-template/mod.rs @@ -421,21 +421,21 @@ impl impl api::IncomingWebhook for {{project-name | downcase | pascal_case}} { fn get_webhook_object_reference_id( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<String, errors::ConnectorError> { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } fn get_webhook_event_type( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<api::IncomingWebhookEvent, errors::ConnectorError> { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } fn get_webhook_resource_object( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<serde_json::Value, errors::ConnectorError> { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } diff --git a/crates/api_models/src/webhooks.rs b/crates/api_models/src/webhooks.rs index eb116eba317..d3ae9ea0d6c 100644 --- a/crates/api_models/src/webhooks.rs +++ b/crates/api_models/src/webhooks.rs @@ -9,12 +9,14 @@ use crate::{enums as api_enums, payments}; pub enum IncomingWebhookEvent { PaymentIntentFailure, PaymentIntentSuccess, + EndpointVerification, } pub enum WebhookFlow { Payment, Refund, Subscription, + ReturnResponse, } impl From<IncomingWebhookEvent> for WebhookFlow { @@ -22,10 +24,17 @@ impl From<IncomingWebhookEvent> for WebhookFlow { match evt { IncomingWebhookEvent::PaymentIntentFailure => Self::Payment, IncomingWebhookEvent::PaymentIntentSuccess => Self::Payment, + IncomingWebhookEvent::EndpointVerification => Self::ReturnResponse, } } } +pub struct IncomingWebhookRequestDetails<'a> { + pub method: actix_web::http::Method, + pub headers: &'a actix_web::http::header::HeaderMap, + pub body: &'a [u8], +} + pub type MerchantWebhookConfig = std::collections::HashSet<IncomingWebhookEvent>; pub struct IncomingWebhookDetails { diff --git a/crates/router/src/connector/aci.rs b/crates/router/src/connector/aci.rs index b1ebb50a267..648464c4c8f 100644 --- a/crates/router/src/connector/aci.rs +++ b/crates/router/src/connector/aci.rs @@ -530,21 +530,21 @@ impl services::ConnectorIntegration<api::RSync, types::RefundsData, types::Refun impl api::IncomingWebhook for Aci { fn get_webhook_object_reference_id( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<String, errors::ConnectorError> { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } fn get_webhook_event_type( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<api::IncomingWebhookEvent, errors::ConnectorError> { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } fn get_webhook_resource_object( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<serde_json::Value, errors::ConnectorError> { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } diff --git a/crates/router/src/connector/adyen.rs b/crates/router/src/connector/adyen.rs index f126a75f43c..a7762862f21 100644 --- a/crates/router/src/connector/adyen.rs +++ b/crates/router/src/connector/adyen.rs @@ -656,18 +656,16 @@ fn get_webhook_object_from_body( impl api::IncomingWebhook for Adyen { fn get_webhook_source_verification_algorithm( &self, - _headers: &actix_web::http::header::HeaderMap, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<Box<dyn crypto::VerifySignature + Send>, errors::ConnectorError> { Ok(Box::new(crypto::HmacSha256)) } fn get_webhook_source_verification_signature( &self, - _headers: &actix_web::http::header::HeaderMap, - body: &[u8], + request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<Vec<u8>, errors::ConnectorError> { - let notif_item = get_webhook_object_from_body(body) + let notif_item = get_webhook_object_from_body(request.body) .change_context(errors::ConnectorError::WebhookSourceVerificationFailed)?; let base64_signature = notif_item.additional_data.hmac_signature; @@ -682,12 +680,11 @@ impl api::IncomingWebhook for Adyen { fn get_webhook_source_verification_message( &self, - _headers: &actix_web::http::header::HeaderMap, - body: &[u8], + request: &api::IncomingWebhookRequestDetails<'_>, _merchant_id: &str, _secret: &[u8], ) -> CustomResult<Vec<u8>, errors::ConnectorError> { - let notif = get_webhook_object_from_body(body) + let notif = get_webhook_object_from_body(request.body) .change_context(errors::ConnectorError::WebhookSourceVerificationFailed)?; let message = format!( @@ -721,9 +718,9 @@ impl api::IncomingWebhook for Adyen { fn get_webhook_object_reference_id( &self, - body: &[u8], + request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<String, errors::ConnectorError> { - let notif = get_webhook_object_from_body(body) + let notif = get_webhook_object_from_body(request.body) .change_context(errors::ConnectorError::WebhookReferenceIdNotFound)?; Ok(notif.psp_reference) @@ -731,9 +728,9 @@ impl api::IncomingWebhook for Adyen { fn get_webhook_event_type( &self, - body: &[u8], + request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<api::IncomingWebhookEvent, errors::ConnectorError> { - let notif = get_webhook_object_from_body(body) + let notif = get_webhook_object_from_body(request.body) .change_context(errors::ConnectorError::WebhookEventTypeNotFound)?; Ok(match notif.event_code.as_str() { @@ -744,9 +741,9 @@ impl api::IncomingWebhook for Adyen { fn get_webhook_resource_object( &self, - body: &[u8], + request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<serde_json::Value, errors::ConnectorError> { - let notif = get_webhook_object_from_body(body) + let notif = get_webhook_object_from_body(request.body) .change_context(errors::ConnectorError::WebhookEventTypeNotFound)?; let response: adyen::AdyenResponse = notif.into(); @@ -760,6 +757,7 @@ impl api::IncomingWebhook for Adyen { fn get_webhook_api_response( &self, + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<services::api::ApplicationResponse<serde_json::Value>, errors::ConnectorError> { Ok(services::api::ApplicationResponse::TextPlain( diff --git a/crates/router/src/connector/applepay.rs b/crates/router/src/connector/applepay.rs index 3687c3b7824..791507fb576 100644 --- a/crates/router/src/connector/applepay.rs +++ b/crates/router/src/connector/applepay.rs @@ -242,21 +242,21 @@ impl services::ConnectorRedirectResponse for Applepay {} impl api::IncomingWebhook for Applepay { fn get_webhook_object_reference_id( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<String, errors::ConnectorError> { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } fn get_webhook_event_type( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<api::IncomingWebhookEvent, errors::ConnectorError> { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } fn get_webhook_resource_object( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<serde_json::Value, errors::ConnectorError> { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } diff --git a/crates/router/src/connector/authorizedotnet.rs b/crates/router/src/connector/authorizedotnet.rs index 5542af0da5a..5a1b5613629 100644 --- a/crates/router/src/connector/authorizedotnet.rs +++ b/crates/router/src/connector/authorizedotnet.rs @@ -572,21 +572,21 @@ impl services::ConnectorIntegration<api::RSync, types::RefundsData, types::Refun impl api::IncomingWebhook for Authorizedotnet { fn get_webhook_object_reference_id( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<String, errors::ConnectorError> { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } fn get_webhook_event_type( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<api::IncomingWebhookEvent, errors::ConnectorError> { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } fn get_webhook_resource_object( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<serde_json::Value, errors::ConnectorError> { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } diff --git a/crates/router/src/connector/braintree.rs b/crates/router/src/connector/braintree.rs index a757fea17b5..e3f24358887 100644 --- a/crates/router/src/connector/braintree.rs +++ b/crates/router/src/connector/braintree.rs @@ -688,21 +688,21 @@ impl services::ConnectorIntegration<api::RSync, types::RefundsData, types::Refun impl api::IncomingWebhook for Braintree { fn get_webhook_object_reference_id( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<String, errors::ConnectorError> { Err(errors::ConnectorError::NotImplemented("braintree".to_string()).into()) } fn get_webhook_event_type( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<api::IncomingWebhookEvent, errors::ConnectorError> { Err(errors::ConnectorError::NotImplemented("braintree".to_string()).into()) } fn get_webhook_resource_object( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<serde_json::Value, errors::ConnectorError> { Err(errors::ConnectorError::NotImplemented("braintree".to_string()).into()) } diff --git a/crates/router/src/connector/checkout.rs b/crates/router/src/connector/checkout.rs index 49be6ce1133..ea4c4697c95 100644 --- a/crates/router/src/connector/checkout.rs +++ b/crates/router/src/connector/checkout.rs @@ -734,21 +734,21 @@ impl services::ConnectorIntegration<api::RSync, types::RefundsData, types::Refun impl api::IncomingWebhook for Checkout { fn get_webhook_object_reference_id( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<String, errors::ConnectorError> { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } fn get_webhook_event_type( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<api::IncomingWebhookEvent, errors::ConnectorError> { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } fn get_webhook_resource_object( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<serde_json::Value, errors::ConnectorError> { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } diff --git a/crates/router/src/connector/cybersource.rs b/crates/router/src/connector/cybersource.rs index a932a3fe829..998ccdc3639 100644 --- a/crates/router/src/connector/cybersource.rs +++ b/crates/router/src/connector/cybersource.rs @@ -696,21 +696,21 @@ impl ConnectorIntegration<api::RSync, types::RefundsData, types::RefundsResponse impl api::IncomingWebhook for Cybersource { fn get_webhook_object_reference_id( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<String, errors::ConnectorError> { Err(errors::ConnectorError::NotImplemented("cybersource".to_string()).into()) } fn get_webhook_event_type( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<api::IncomingWebhookEvent, errors::ConnectorError> { Err(errors::ConnectorError::NotImplemented("cybersource".to_string()).into()) } fn get_webhook_resource_object( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<serde_json::Value, errors::ConnectorError> { Err(errors::ConnectorError::NotImplemented("cybersource".to_string()).into()) } diff --git a/crates/router/src/connector/fiserv.rs b/crates/router/src/connector/fiserv.rs index 0e241cefd96..a1ca56b04a8 100644 --- a/crates/router/src/connector/fiserv.rs +++ b/crates/router/src/connector/fiserv.rs @@ -416,21 +416,21 @@ impl services::ConnectorIntegration<api::RSync, types::RefundsData, types::Refun impl api::IncomingWebhook for Fiserv { fn get_webhook_object_reference_id( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<String, errors::ConnectorError> { Err(errors::ConnectorError::NotImplemented("fiserv".to_string()).into()) } fn get_webhook_event_type( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<api::IncomingWebhookEvent, errors::ConnectorError> { Err(errors::ConnectorError::NotImplemented("fiserv".to_string()).into()) } fn get_webhook_resource_object( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<serde_json::Value, errors::ConnectorError> { Err(errors::ConnectorError::NotImplemented("fiserv".to_string()).into()) } diff --git a/crates/router/src/connector/globalpay.rs b/crates/router/src/connector/globalpay.rs index 25b5a0fb068..580dd3fccc3 100644 --- a/crates/router/src/connector/globalpay.rs +++ b/crates/router/src/connector/globalpay.rs @@ -693,21 +693,21 @@ impl ConnectorIntegration<api::RSync, types::RefundsData, types::RefundsResponse impl api::IncomingWebhook for Globalpay { fn get_webhook_object_reference_id( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<String, errors::ConnectorError> { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } fn get_webhook_event_type( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<api::IncomingWebhookEvent, errors::ConnectorError> { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } fn get_webhook_resource_object( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<serde_json::Value, errors::ConnectorError> { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } diff --git a/crates/router/src/connector/klarna.rs b/crates/router/src/connector/klarna.rs index aab27644cf5..38e576cffd6 100644 --- a/crates/router/src/connector/klarna.rs +++ b/crates/router/src/connector/klarna.rs @@ -360,21 +360,21 @@ impl services::ConnectorIntegration<api::RSync, types::RefundsData, types::Refun impl api::IncomingWebhook for Klarna { fn get_webhook_object_reference_id( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<String, errors::ConnectorError> { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } fn get_webhook_event_type( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<api::IncomingWebhookEvent, errors::ConnectorError> { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } fn get_webhook_resource_object( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<serde_json::Value, errors::ConnectorError> { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } diff --git a/crates/router/src/connector/payu.rs b/crates/router/src/connector/payu.rs index 23546799187..3972f9c62b3 100644 --- a/crates/router/src/connector/payu.rs +++ b/crates/router/src/connector/payu.rs @@ -684,21 +684,21 @@ impl ConnectorIntegration<api::RSync, types::RefundsData, types::RefundsResponse impl api::IncomingWebhook for Payu { fn get_webhook_object_reference_id( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<String, errors::ConnectorError> { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } fn get_webhook_event_type( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<api::IncomingWebhookEvent, errors::ConnectorError> { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } fn get_webhook_resource_object( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<serde_json::Value, errors::ConnectorError> { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } diff --git a/crates/router/src/connector/rapyd.rs b/crates/router/src/connector/rapyd.rs index ec6687913eb..8c0c47409e3 100644 --- a/crates/router/src/connector/rapyd.rs +++ b/crates/router/src/connector/rapyd.rs @@ -666,18 +666,16 @@ impl services::ConnectorIntegration<api::RSync, types::RefundsData, types::Refun impl api::IncomingWebhook for Rapyd { fn get_webhook_source_verification_algorithm( &self, - _headers: &actix_web::http::header::HeaderMap, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<Box<dyn crypto::VerifySignature + Send>, errors::ConnectorError> { Ok(Box::new(crypto::HmacSha256)) } fn get_webhook_source_verification_signature( &self, - headers: &actix_web::http::header::HeaderMap, - _body: &[u8], + request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<Vec<u8>, errors::ConnectorError> { - let base64_signature = conn_utils::get_header_key_value("signature", headers)?; + let base64_signature = conn_utils::get_header_key_value("signature", request.headers)?; let signature = consts::BASE64_ENGINE_URL_SAFE .decode(base64_signature.as_bytes()) .into_report() @@ -701,16 +699,15 @@ impl api::IncomingWebhook for Rapyd { fn get_webhook_source_verification_message( &self, - headers: &actix_web::http::header::HeaderMap, - body: &[u8], + request: &api::IncomingWebhookRequestDetails<'_>, merchant_id: &str, secret: &[u8], ) -> CustomResult<Vec<u8>, errors::ConnectorError> { - let host = conn_utils::get_header_key_value("host", headers)?; + let host = conn_utils::get_header_key_value("host", request.headers)?; let connector = self.id(); let url_path = format!("https://{host}/webhooks/{merchant_id}/{connector}"); - let salt = conn_utils::get_header_key_value("salt", headers)?; - let timestamp = conn_utils::get_header_key_value("timestamp", headers)?; + let salt = conn_utils::get_header_key_value("salt", request.headers)?; + let timestamp = conn_utils::get_header_key_value("timestamp", request.headers)?; let stringify_auth = String::from_utf8(secret.to_vec()) .into_report() .change_context(errors::ConnectorError::WebhookSourceVerificationFailed) @@ -720,7 +717,7 @@ impl api::IncomingWebhook for Rapyd { .change_context(errors::ConnectorError::WebhookSourceVerificationFailed)?; let access_key = auth.access_key; let secret_key = auth.secret_key; - let body_string = String::from_utf8(body.to_vec()) + let body_string = String::from_utf8(request.body.to_vec()) .into_report() .change_context(errors::ConnectorError::WebhookSourceVerificationFailed) .attach_printable("Could not convert body to UTF-8")?; @@ -732,19 +729,18 @@ impl api::IncomingWebhook for Rapyd { async fn verify_webhook_source( &self, db: &dyn StorageInterface, - headers: &actix_web::http::header::HeaderMap, - body: &[u8], + request: &api::IncomingWebhookRequestDetails<'_>, merchant_id: &str, ) -> CustomResult<bool, errors::ConnectorError> { let signature = self - .get_webhook_source_verification_signature(headers, body) + .get_webhook_source_verification_signature(request) .change_context(errors::ConnectorError::WebhookSourceVerificationFailed)?; let secret = self .get_webhook_source_verification_merchant_secret(db, merchant_id) .await .change_context(errors::ConnectorError::WebhookSourceVerificationFailed)?; let message = self - .get_webhook_source_verification_message(headers, body, merchant_id, &secret) + .get_webhook_source_verification_message(request, merchant_id, &secret) .change_context(errors::ConnectorError::WebhookSourceVerificationFailed)?; let stringify_auth = String::from_utf8(secret.to_vec()) @@ -763,11 +759,13 @@ impl api::IncomingWebhook for Rapyd { fn get_webhook_object_reference_id( &self, - body: &[u8], + request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<String, errors::ConnectorError> { - let webhook: transformers::RapydIncomingWebhook = body + let webhook: transformers::RapydIncomingWebhook = request + .body .parse_struct("RapydIncomingWebhook") .change_context(errors::ConnectorError::WebhookEventTypeNotFound)?; + Ok(match webhook.data { transformers::WebhookData::PaymentData(payment_data) => payment_data.id, transformers::WebhookData::RefundData(refund_data) => refund_data.id, @@ -776,19 +774,22 @@ impl api::IncomingWebhook for Rapyd { fn get_webhook_event_type( &self, - body: &[u8], + request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<api::IncomingWebhookEvent, errors::ConnectorError> { - let webhook: transformers::RapydIncomingWebhook = body + let webhook: transformers::RapydIncomingWebhook = request + .body .parse_struct("RapydIncomingWebhook") .change_context(errors::ConnectorError::WebhookEventTypeNotFound)?; + webhook.webhook_type.try_into() } fn get_webhook_resource_object( &self, - body: &[u8], + request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<serde_json::Value, errors::ConnectorError> { - let webhook: transformers::RapydIncomingWebhook = body + let webhook: transformers::RapydIncomingWebhook = request + .body .parse_struct("RapydIncomingWebhook") .change_context(errors::ConnectorError::WebhookEventTypeNotFound)?; let response = match webhook.data { diff --git a/crates/router/src/connector/shift4.rs b/crates/router/src/connector/shift4.rs index 470eeb2502e..cc515d3d8e9 100644 --- a/crates/router/src/connector/shift4.rs +++ b/crates/router/src/connector/shift4.rs @@ -499,9 +499,10 @@ impl ConnectorIntegration<api::RSync, types::RefundsData, types::RefundsResponse impl api::IncomingWebhook for Shift4 { fn get_webhook_object_reference_id( &self, - body: &[u8], + request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<String, errors::ConnectorError> { - let details: shift4::Shift4WebhookObjectId = body + let details: shift4::Shift4WebhookObjectId = request + .body .parse_struct("Shift4WebhookObjectId") .change_context(errors::ConnectorError::WebhookReferenceIdNotFound)?; @@ -510,9 +511,10 @@ impl api::IncomingWebhook for Shift4 { fn get_webhook_event_type( &self, - body: &[u8], + request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<api::IncomingWebhookEvent, errors::ConnectorError> { - let details: shift4::Shift4WebhookObjectEventType = body + let details: shift4::Shift4WebhookObjectEventType = request + .body .parse_struct("Shift4WebhookObjectEventType") .change_context(errors::ConnectorError::WebhookEventTypeNotFound)?; Ok(match details.event_type { @@ -524,9 +526,10 @@ impl api::IncomingWebhook for Shift4 { fn get_webhook_resource_object( &self, - body: &[u8], + request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<serde_json::Value, errors::ConnectorError> { - let details: shift4::Shift4WebhookObjectResource = body + let details: shift4::Shift4WebhookObjectResource = request + .body .parse_struct("Shift4WebhookObjectResource") .change_context(errors::ConnectorError::WebhookResourceObjectNotFound)?; Ok(details.data) diff --git a/crates/router/src/connector/stripe.rs b/crates/router/src/connector/stripe.rs index 15959b945e5..8e54d50fc49 100644 --- a/crates/router/src/connector/stripe.rs +++ b/crates/router/src/connector/stripe.rs @@ -880,18 +880,16 @@ fn get_signature_elements_from_header( impl api::IncomingWebhook for Stripe { fn get_webhook_source_verification_algorithm( &self, - _headers: &actix_web::http::header::HeaderMap, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<Box<dyn crypto::VerifySignature + Send>, errors::ConnectorError> { Ok(Box::new(crypto::HmacSha256)) } fn get_webhook_source_verification_signature( &self, - headers: &actix_web::http::header::HeaderMap, - _body: &[u8], + request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<Vec<u8>, errors::ConnectorError> { - let mut security_header_kvs = get_signature_elements_from_header(headers)?; + let mut security_header_kvs = get_signature_elements_from_header(request.headers)?; let signature = security_header_kvs .remove("v1") @@ -905,12 +903,11 @@ impl api::IncomingWebhook for Stripe { fn get_webhook_source_verification_message( &self, - headers: &actix_web::http::header::HeaderMap, - body: &[u8], + request: &api::IncomingWebhookRequestDetails<'_>, _merchant_id: &str, _secret: &[u8], ) -> CustomResult<Vec<u8>, errors::ConnectorError> { - let mut security_header_kvs = get_signature_elements_from_header(headers)?; + let mut security_header_kvs = get_signature_elements_from_header(request.headers)?; let timestamp = security_header_kvs .remove("t") @@ -920,7 +917,7 @@ impl api::IncomingWebhook for Stripe { Ok(format!( "{}.{}", String::from_utf8_lossy(&timestamp), - String::from_utf8_lossy(body) + String::from_utf8_lossy(request.body) ) .into_bytes()) } @@ -941,9 +938,10 @@ impl api::IncomingWebhook for Stripe { fn get_webhook_object_reference_id( &self, - body: &[u8], + request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<String, errors::ConnectorError> { - let details: stripe::StripeWebhookObjectId = body + let details: stripe::StripeWebhookObjectId = request + .body .parse_struct("StripeWebhookObjectId") .change_context(errors::ConnectorError::WebhookReferenceIdNotFound)?; @@ -952,9 +950,10 @@ impl api::IncomingWebhook for Stripe { fn get_webhook_event_type( &self, - body: &[u8], + request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<api::IncomingWebhookEvent, errors::ConnectorError> { - let details: stripe::StripeWebhookObjectEventType = body + let details: stripe::StripeWebhookObjectEventType = request + .body .parse_struct("StripeWebhookObjectEventType") .change_context(errors::ConnectorError::WebhookEventTypeNotFound)?; @@ -967,9 +966,10 @@ impl api::IncomingWebhook for Stripe { fn get_webhook_resource_object( &self, - body: &[u8], + request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<serde_json::Value, errors::ConnectorError> { - let details: stripe::StripeWebhookObjectResource = body + let details: stripe::StripeWebhookObjectResource = request + .body .parse_struct("StripeWebhookObjectResource") .change_context(errors::ConnectorError::WebhookResourceObjectNotFound)?; diff --git a/crates/router/src/connector/worldline.rs b/crates/router/src/connector/worldline.rs index 7d6f214e96a..d086205cd5a 100644 --- a/crates/router/src/connector/worldline.rs +++ b/crates/router/src/connector/worldline.rs @@ -655,21 +655,21 @@ impl ConnectorIntegration<api::RSync, types::RefundsData, types::RefundsResponse impl api::IncomingWebhook for Worldline { fn get_webhook_object_reference_id( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<String, errors::ConnectorError> { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } fn get_webhook_event_type( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<api::IncomingWebhookEvent, errors::ConnectorError> { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } fn get_webhook_resource_object( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<serde_json::Value, errors::ConnectorError> { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } diff --git a/crates/router/src/connector/worldpay.rs b/crates/router/src/connector/worldpay.rs index bd53b9fd784..ff41f8b1b88 100644 --- a/crates/router/src/connector/worldpay.rs +++ b/crates/router/src/connector/worldpay.rs @@ -594,21 +594,21 @@ impl ConnectorIntegration<api::RSync, types::RefundsData, types::RefundsResponse impl api::IncomingWebhook for Worldpay { fn get_webhook_object_reference_id( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<String, errors::ConnectorError> { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } fn get_webhook_event_type( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<api::IncomingWebhookEvent, errors::ConnectorError> { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } fn get_webhook_resource_object( &self, - _body: &[u8], + _request: &api::IncomingWebhookRequestDetails<'_>, ) -> CustomResult<serde_json::Value, errors::ConnectorError> { Err(errors::ConnectorError::WebhooksNotImplemented).into_report() } diff --git a/crates/router/src/core/webhooks.rs b/crates/router/src/core/webhooks.rs index bb059356eb9..7be7781bd06 100644 --- a/crates/router/src/core/webhooks.rs +++ b/crates/router/src/core/webhooks.rs @@ -211,11 +211,16 @@ pub async fn webhooks_core( let connector = connector.connector; + let mut request_details = api::IncomingWebhookRequestDetails { + method: req.method().clone(), + headers: req.headers(), + body: &body, + }; + let source_verified = connector .verify_webhook_source( &*state.store, - req.headers(), - &body, + &request_details, &merchant_account.merchant_id, ) .await @@ -225,16 +230,17 @@ pub async fn webhooks_core( let decoded_body = connector .decode_webhook_body( &*state.store, - req.headers(), - &body, + &request_details, &merchant_account.merchant_id, ) .await .change_context(errors::ApiErrorResponse::InternalServerError) .attach_printable("There was an error in incoming webhook body decoding")?; + request_details.body = &decoded_body; + let event_type = connector - .get_webhook_event_type(&decoded_body) + .get_webhook_event_type(&request_details) .change_context(errors::ApiErrorResponse::InternalServerError) .attach_printable("Could not find event type in incoming webhook body")?; @@ -248,12 +254,12 @@ pub async fn webhooks_core( if process_webhook_further { let object_ref_id = connector - .get_webhook_object_reference_id(&decoded_body) + .get_webhook_object_reference_id(&request_details) .change_context(errors::ApiErrorResponse::InternalServerError) .attach_printable("Could not find object reference id in incoming webhook body")?; let event_object = connector - .get_webhook_resource_object(&decoded_body) + .get_webhook_resource_object(&request_details) .change_context(errors::ApiErrorResponse::InternalServerError) .attach_printable("Could not find resource object in incoming webhook body")?; @@ -277,6 +283,9 @@ pub async fn webhooks_core( .await .change_context(errors::ApiErrorResponse::InternalServerError) .attach_printable("Incoming webhook flow for payments failed")?, + + api::WebhookFlow::ReturnResponse => {} + _ => Err(errors::ApiErrorResponse::InternalServerError) .into_report() .attach_printable("Unsupported Flow Type received in incoming webhooks")?, @@ -284,7 +293,7 @@ pub async fn webhooks_core( } let response = connector - .get_webhook_api_response() + .get_webhook_api_response(&request_details) .change_context(errors::ApiErrorResponse::InternalServerError) .attach_printable("Could not get incoming webhook api response from connector")?; diff --git a/crates/router/src/routes/app.rs b/crates/router/src/routes/app.rs index 968d69e69d5..f3bdbaf32e2 100644 --- a/crates/router/src/routes/app.rs +++ b/crates/router/src/routes/app.rs @@ -315,7 +315,8 @@ impl Webhooks { .app_data(web::Data::new(config)) .service( web::resource("/{merchant_id}/{connector}") - .route(web::post().to(receive_incoming_webhook)), + .route(web::post().to(receive_incoming_webhook)) + .route(web::get().to(receive_incoming_webhook)), ) } } diff --git a/crates/router/src/types/api/webhooks.rs b/crates/router/src/types/api/webhooks.rs index 36a9f87624b..2340c30964d 100644 --- a/crates/router/src/types/api/webhooks.rs +++ b/crates/router/src/types/api/webhooks.rs @@ -1,6 +1,6 @@ pub use api_models::webhooks::{ - IncomingWebhookDetails, IncomingWebhookEvent, MerchantWebhookConfig, OutgoingWebhook, - OutgoingWebhookContent, WebhookFlow, + IncomingWebhookDetails, IncomingWebhookEvent, IncomingWebhookRequestDetails, + MerchantWebhookConfig, OutgoingWebhook, OutgoingWebhookContent, WebhookFlow, }; use error_stack::ResultExt; @@ -16,8 +16,7 @@ use crate::{ pub trait IncomingWebhook: ConnectorCommon + Sync { fn get_webhook_body_decoding_algorithm( &self, - _headers: &actix_web::http::header::HeaderMap, - _body: &[u8], + _request: &IncomingWebhookRequestDetails<'_>, ) -> CustomResult<Box<dyn crypto::DecodeMessage + Send>, errors::ConnectorError> { Ok(Box::new(crypto::NoAlgorithm)) } @@ -32,23 +31,21 @@ pub trait IncomingWebhook: ConnectorCommon + Sync { fn get_webhook_body_decoding_message( &self, - _headers: &actix_web::http::header::HeaderMap, - body: &[u8], + request: &IncomingWebhookRequestDetails<'_>, ) -> CustomResult<Vec<u8>, errors::ConnectorError> { - Ok(body.to_vec()) + Ok(request.body.to_vec()) } async fn decode_webhook_body( &self, db: &dyn StorageInterface, - headers: &actix_web::http::header::HeaderMap, - body: &[u8], + request: &IncomingWebhookRequestDetails<'_>, merchant_id: &str, ) -> CustomResult<Vec<u8>, errors::ConnectorError> { - let algorithm = self.get_webhook_body_decoding_algorithm(headers, body)?; + let algorithm = self.get_webhook_body_decoding_algorithm(request)?; let message = self - .get_webhook_body_decoding_message(headers, body) + .get_webhook_body_decoding_message(request) .change_context(errors::ConnectorError::WebhookBodyDecodingFailed)?; let secret = self .get_webhook_body_decoding_merchant_secret(db, merchant_id) @@ -62,8 +59,7 @@ pub trait IncomingWebhook: ConnectorCommon + Sync { fn get_webhook_source_verification_algorithm( &self, - _headers: &actix_web::http::header::HeaderMap, - _body: &[u8], + _request: &IncomingWebhookRequestDetails<'_>, ) -> CustomResult<Box<dyn crypto::VerifySignature + Send>, errors::ConnectorError> { Ok(Box::new(crypto::NoAlgorithm)) } @@ -78,16 +74,14 @@ pub trait IncomingWebhook: ConnectorCommon + Sync { fn get_webhook_source_verification_signature( &self, - _headers: &actix_web::http::header::HeaderMap, - _body: &[u8], + _request: &IncomingWebhookRequestDetails<'_>, ) -> CustomResult<Vec<u8>, errors::ConnectorError> { Ok(Vec::new()) } fn get_webhook_source_verification_message( &self, - _headers: &actix_web::http::header::HeaderMap, - _body: &[u8], + _request: &IncomingWebhookRequestDetails<'_>, _merchant_id: &str, _secret: &[u8], ) -> CustomResult<Vec<u8>, errors::ConnectorError> { @@ -97,23 +91,22 @@ pub trait IncomingWebhook: ConnectorCommon + Sync { async fn verify_webhook_source( &self, db: &dyn StorageInterface, - headers: &actix_web::http::header::HeaderMap, - body: &[u8], + request: &IncomingWebhookRequestDetails<'_>, merchant_id: &str, ) -> CustomResult<bool, errors::ConnectorError> { let algorithm = self - .get_webhook_source_verification_algorithm(headers, body) + .get_webhook_source_verification_algorithm(request) .change_context(errors::ConnectorError::WebhookSourceVerificationFailed)?; let signature = self - .get_webhook_source_verification_signature(headers, body) + .get_webhook_source_verification_signature(request) .change_context(errors::ConnectorError::WebhookSourceVerificationFailed)?; let secret = self .get_webhook_source_verification_merchant_secret(db, merchant_id) .await .change_context(errors::ConnectorError::WebhookSourceVerificationFailed)?; let message = self - .get_webhook_source_verification_message(headers, body, merchant_id, &secret) + .get_webhook_source_verification_message(request, merchant_id, &secret) .change_context(errors::ConnectorError::WebhookSourceVerificationFailed)?; algorithm @@ -123,21 +116,22 @@ pub trait IncomingWebhook: ConnectorCommon + Sync { fn get_webhook_object_reference_id( &self, - _body: &[u8], + _request: &IncomingWebhookRequestDetails<'_>, ) -> CustomResult<String, errors::ConnectorError>; fn get_webhook_event_type( &self, - _body: &[u8], + _request: &IncomingWebhookRequestDetails<'_>, ) -> CustomResult<IncomingWebhookEvent, errors::ConnectorError>; fn get_webhook_resource_object( &self, - _body: &[u8], + _request: &IncomingWebhookRequestDetails<'_>, ) -> CustomResult<serde_json::Value, errors::ConnectorError>; fn get_webhook_api_response( &self, + _request: &IncomingWebhookRequestDetails<'_>, ) -> CustomResult<services::api::ApplicationResponse<serde_json::Value>, errors::ConnectorError> { Ok(services::api::ApplicationResponse::StatusOk)
enhance
expose additional incoming request details to webhooks flow (#637)
0fa61a9dd194c5b3688f8f68b056c263d92327d0
2023-12-18 21:32:31
Sahkal Poddar
fix(payment_link): added amount conversion to base unit based on currency (#3162)
false
diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rs index 717a908b1f0..5efebb14f81 100644 --- a/crates/api_models/src/payments.rs +++ b/crates/api_models/src/payments.rs @@ -3355,7 +3355,7 @@ pub struct PaymentLinkInitiateRequest { #[derive(Debug, serde::Serialize)] pub struct PaymentLinkDetails { - pub amount: i64, + pub amount: String, pub currency: api_enums::Currency, pub pub_key: String, pub client_secret: String, @@ -3365,7 +3365,7 @@ pub struct PaymentLinkDetails { pub merchant_logo: String, pub return_url: String, pub merchant_name: String, - pub order_details: Option<Vec<OrderDetailsWithAmount>>, + pub order_details: Option<Vec<OrderDetailsWithStringAmount>>, pub max_items_visible_after_collapse: i8, pub sdk_theme: Option<String>, } @@ -3423,3 +3423,17 @@ pub struct PaymentLinkListResponse { // The list of payment link response objects pub data: Vec<PaymentLinkResponse>, } + +#[derive(Debug, Default, Eq, PartialEq, serde::Deserialize, serde::Serialize, Clone, ToSchema)] +pub struct OrderDetailsWithStringAmount { + /// Name of the product that is being purchased + #[schema(max_length = 255, example = "shirt")] + pub product_name: String, + /// The quantity of the product to be purchased + #[schema(example = 1)] + pub quantity: u16, + /// the amount per quantity of product + pub amount: String, + /// Product Image link + pub product_img_link: Option<String>, +} diff --git a/crates/router/src/compatibility/stripe/errors.rs b/crates/router/src/compatibility/stripe/errors.rs index cf49b1aad20..5963110c632 100644 --- a/crates/router/src/compatibility/stripe/errors.rs +++ b/crates/router/src/compatibility/stripe/errors.rs @@ -241,6 +241,8 @@ pub enum StripeErrorCode { LockTimeout, #[error(error_type = StripeErrorType::InvalidRequestError, code = "", message = "Merchant connector account is configured with invalid {config}")] InvalidConnectorConfiguration { config: String }, + #[error(error_type = StripeErrorType::HyperswitchError, code = "HE_01", message = "Failed to convert currency to minor unit")] + CurrencyConversionFailed, // [#216]: https://github.com/juspay/hyperswitch/issues/216 // Implement the remaining stripe error codes @@ -595,6 +597,7 @@ impl From<errors::ApiErrorResponse> for StripeErrorCode { errors::ApiErrorResponse::InvalidConnectorConfiguration { config } => { Self::InvalidConnectorConfiguration { config } } + errors::ApiErrorResponse::CurrencyConversionFailed => Self::CurrencyConversionFailed, } } } @@ -662,7 +665,8 @@ impl actix_web::ResponseError for StripeErrorCode { | Self::CurrencyNotSupported { .. } | Self::DuplicateCustomer | Self::PaymentMethodUnactivated - | Self::InvalidConnectorConfiguration { .. } => StatusCode::BAD_REQUEST, + | Self::InvalidConnectorConfiguration { .. } + | Self::CurrencyConversionFailed => StatusCode::BAD_REQUEST, Self::RefundFailed | Self::PayoutFailed | Self::PaymentLinkNotFound diff --git a/crates/router/src/core/errors/api_error_response.rs b/crates/router/src/core/errors/api_error_response.rs index ac51c5018df..f94504cf274 100644 --- a/crates/router/src/core/errors/api_error_response.rs +++ b/crates/router/src/core/errors/api_error_response.rs @@ -238,6 +238,8 @@ pub enum ApiErrorResponse { CurrencyNotSupported { message: String }, #[error(error_type = ErrorType::InvalidRequestError, code = "IR_24", message = "Merchant connector account is configured with invalid {config}")] InvalidConnectorConfiguration { config: String }, + #[error(error_type = ErrorType::ValidationError, code = "HE_01", message = "Failed to convert currency to minor unit")] + CurrencyConversionFailed, } impl PTError for ApiErrorResponse { diff --git a/crates/router/src/core/errors/transformers.rs b/crates/router/src/core/errors/transformers.rs index 58eb0213cb6..fa9a5185790 100644 --- a/crates/router/src/core/errors/transformers.rs +++ b/crates/router/src/core/errors/transformers.rs @@ -270,6 +270,9 @@ impl ErrorSwitch<api_models::errors::types::ApiErrorResponse> for ApiErrorRespon Self::InvalidConnectorConfiguration {config} => { AER::BadRequest(ApiError::new("IR", 24, format!("Merchant connector account is configured with invalid {config}"), None)) } + Self::CurrencyConversionFailed => { + AER::Unprocessable(ApiError::new("HE", 2, "Failed to convert currency to minor unit", None)) + } } } } diff --git a/crates/router/src/core/payment_link.rs b/crates/router/src/core/payment_link.rs index 07fdf4ae407..81b06f5f9aa 100644 --- a/crates/router/src/core/payment_link.rs +++ b/crates/router/src/core/payment_link.rs @@ -85,8 +85,6 @@ pub async fn intiate_payment_link_flow( extract_payment_link_config(merchant_account.payment_link_config.clone())? }; - let order_details = validate_order_details(payment_intent.order_details)?; - let return_url = if let Some(payment_create_return_url) = payment_intent.return_url { payment_create_return_url } else { @@ -102,12 +100,16 @@ pub async fn intiate_payment_link_flow( payment_intent.currency, payment_intent.client_secret, )?; + let order_details = validate_order_details(payment_intent.order_details, currency)?; let (default_sdk_theme, default_background_color) = (DEFAULT_SDK_THEME, DEFAULT_BACKGROUND_COLOR); let payment_details = api_models::payments::PaymentLinkDetails { - amount: payment_intent.amount, + amount: currency + .to_currency_base_unit(payment_intent.amount) + .into_report() + .change_context(errors::ApiErrorResponse::CurrencyConversionFailed)?, currency, payment_id: payment_intent.payment_id, merchant_name: payment_link.custom_merchant_name.unwrap_or( @@ -236,8 +238,9 @@ pub fn check_payment_link_status(fulfillment_time: Option<PrimitiveDateTime>) -> fn validate_order_details( order_details: Option<Vec<Secret<serde_json::Value>>>, + currency: api_models::enums::Currency, ) -> Result< - Option<Vec<api_models::payments::OrderDetailsWithAmount>>, + Option<Vec<api_models::payments::OrderDetailsWithStringAmount>>, error_stack::Report<errors::ApiErrorResponse>, > { let order_details = order_details @@ -256,14 +259,31 @@ fn validate_order_details( }) .transpose()?; - let updated_order_details = order_details.map(|mut order_details| { - for order in order_details.iter_mut() { - if order.product_img_link.is_none() { - order.product_img_link = Some(DEFAULT_PRODUCT_IMG.to_string()); + let updated_order_details = match order_details { + Some(mut order_details) => { + let mut order_details_amount_string_array: Vec< + api_models::payments::OrderDetailsWithStringAmount, + > = Vec::new(); + for order in order_details.iter_mut() { + let mut order_details_amount_string : api_models::payments::OrderDetailsWithStringAmount = Default::default(); + if order.product_img_link.is_none() { + order_details_amount_string.product_img_link = + Some(DEFAULT_PRODUCT_IMG.to_string()) + } else { + order_details_amount_string.product_img_link = order.product_img_link.clone() + }; + order_details_amount_string.amount = currency + .to_currency_base_unit(order.amount) + .into_report() + .change_context(errors::ApiErrorResponse::CurrencyConversionFailed)?; + order_details_amount_string.product_name = order.product_name.clone(); + order_details_amount_string.quantity = order.quantity; + order_details_amount_string_array.push(order_details_amount_string) } + Some(order_details_amount_string_array) } - order_details - }); + None => None, + }; Ok(updated_order_details) }
fix
added amount conversion to base unit based on currency (#3162)
28e7a7fc5e49029dc5e7a367bb4d2a946ed1fe45
2024-09-04 20:26:50
Mani Chandra
feat(users): Add profile level invites (#5793)
false
diff --git a/crates/api_models/src/user.rs b/crates/api_models/src/user.rs index a0dadfea217..78157f62bc5 100644 --- a/crates/api_models/src/user.rs +++ b/crates/api_models/src/user.rs @@ -51,9 +51,6 @@ pub struct AuthorizeResponse { //this field is added for audit/debug reasons #[serde(skip_serializing)] pub user_id: String, - //this field is added for audit/debug reasons - #[serde(skip_serializing)] - pub merchant_id: id_type::MerchantId, } #[derive(serde::Deserialize, Debug, serde::Serialize)] @@ -209,7 +206,6 @@ pub struct VerifyTokenResponse { #[derive(Debug, serde::Deserialize, serde::Serialize)] pub struct UpdateUserAccountDetailsRequest { pub name: Option<Secret<String>>, - pub preferred_merchant_id: Option<id_type::MerchantId>, } #[derive(Debug, serde::Deserialize, serde::Serialize)] diff --git a/crates/api_models/src/user_role.rs b/crates/api_models/src/user_role.rs index e4819b74fbc..05087d09e80 100644 --- a/crates/api_models/src/user_role.rs +++ b/crates/api_models/src/user_role.rs @@ -147,3 +147,12 @@ pub struct ListInvitationForUserResponse { pub entity_name: Option<Secret<String>>, pub role_id: String, } + +pub type AcceptInvitationsV2Request = Vec<Entity>; +pub type AcceptInvitationsPreAuthRequest = Vec<Entity>; + +#[derive(Debug, serde::Deserialize, serde::Serialize)] +pub struct Entity { + pub entity_id: String, + pub entity_type: common_enums::EntityType, +} diff --git a/crates/diesel_models/src/schema.rs b/crates/diesel_models/src/schema.rs index 7927dfee106..58cf2063629 100644 --- a/crates/diesel_models/src/schema.rs +++ b/crates/diesel_models/src/schema.rs @@ -1334,8 +1334,6 @@ diesel::table! { is_verified -> Bool, created_at -> Timestamp, last_modified_at -> Timestamp, - #[max_length = 64] - preferred_merchant_id -> Nullable<Varchar>, totp_status -> TotpStatus, totp_secret -> Nullable<Bytea>, totp_recovery_codes -> Nullable<Array<Nullable<Text>>>, diff --git a/crates/diesel_models/src/schema_v2.rs b/crates/diesel_models/src/schema_v2.rs index 41bf563a3a3..e2bda4a1704 100644 --- a/crates/diesel_models/src/schema_v2.rs +++ b/crates/diesel_models/src/schema_v2.rs @@ -1298,8 +1298,6 @@ diesel::table! { is_verified -> Bool, created_at -> Timestamp, last_modified_at -> Timestamp, - #[max_length = 64] - preferred_merchant_id -> Nullable<Varchar>, totp_status -> TotpStatus, totp_secret -> Nullable<Bytea>, totp_recovery_codes -> Nullable<Array<Nullable<Text>>>, diff --git a/crates/diesel_models/src/user.rs b/crates/diesel_models/src/user.rs index 582041ec42e..9f7b77dc5d6 100644 --- a/crates/diesel_models/src/user.rs +++ b/crates/diesel_models/src/user.rs @@ -18,7 +18,6 @@ pub struct User { pub is_verified: bool, pub created_at: PrimitiveDateTime, pub last_modified_at: PrimitiveDateTime, - pub preferred_merchant_id: Option<common_utils::id_type::MerchantId>, pub totp_status: TotpStatus, pub totp_secret: Option<Encryption>, #[diesel(deserialize_as = OptionalDieselArray<Secret<String>>)] @@ -38,7 +37,6 @@ pub struct UserNew { pub is_verified: bool, pub created_at: Option<PrimitiveDateTime>, pub last_modified_at: Option<PrimitiveDateTime>, - pub preferred_merchant_id: Option<common_utils::id_type::MerchantId>, pub totp_status: TotpStatus, pub totp_secret: Option<Encryption>, pub totp_recovery_codes: Option<Vec<Secret<String>>>, @@ -52,7 +50,6 @@ pub struct UserUpdateInternal { password: Option<Secret<String>>, is_verified: Option<bool>, last_modified_at: PrimitiveDateTime, - preferred_merchant_id: Option<common_utils::id_type::MerchantId>, totp_status: Option<TotpStatus>, totp_secret: Option<Encryption>, totp_recovery_codes: Option<Vec<Secret<String>>>, @@ -65,7 +62,6 @@ pub enum UserUpdate { AccountUpdate { name: Option<String>, is_verified: Option<bool>, - preferred_merchant_id: Option<common_utils::id_type::MerchantId>, }, TotpUpdate { totp_status: Option<TotpStatus>, @@ -86,22 +82,16 @@ impl From<UserUpdate> for UserUpdateInternal { password: None, is_verified: Some(true), last_modified_at, - preferred_merchant_id: None, totp_status: None, totp_secret: None, totp_recovery_codes: None, last_password_modified_at: None, }, - UserUpdate::AccountUpdate { - name, - is_verified, - preferred_merchant_id, - } => Self { + UserUpdate::AccountUpdate { name, is_verified } => Self { name, password: None, is_verified, last_modified_at, - preferred_merchant_id, totp_status: None, totp_secret: None, totp_recovery_codes: None, @@ -116,7 +106,6 @@ impl From<UserUpdate> for UserUpdateInternal { password: None, is_verified: None, last_modified_at, - preferred_merchant_id: None, totp_status, totp_secret, totp_recovery_codes, @@ -127,7 +116,6 @@ impl From<UserUpdate> for UserUpdateInternal { password: Some(password), is_verified: None, last_modified_at, - preferred_merchant_id: None, last_password_modified_at: Some(last_modified_at), totp_status: None, totp_secret: None, diff --git a/crates/diesel_models/src/user_role.rs b/crates/diesel_models/src/user_role.rs index c454e8b58bc..29be4d62aef 100644 --- a/crates/diesel_models/src/user_role.rs +++ b/crates/diesel_models/src/user_role.rs @@ -26,52 +26,53 @@ pub struct UserRole { pub version: enums::UserRoleVersion, } -pub fn get_entity_id_and_type(user_role: &UserRole) -> (Option<String>, Option<EntityType>) { - match (user_role.version, user_role.role_id.as_str()) { - (enums::UserRoleVersion::V1, consts::ROLE_ID_ORGANIZATION_ADMIN) => ( - user_role - .org_id - .clone() - .map(|org_id| org_id.get_string_repr().to_string()), - Some(EntityType::Organization), - ), - (enums::UserRoleVersion::V1, consts::ROLE_ID_INTERNAL_VIEW_ONLY_USER) - | (enums::UserRoleVersion::V1, consts::ROLE_ID_INTERNAL_ADMIN) => ( - user_role - .merchant_id - .clone() - .map(|merchant_id| merchant_id.get_string_repr().to_string()), - Some(EntityType::Internal), - ), - (enums::UserRoleVersion::V1, _) => ( - user_role - .merchant_id - .clone() - .map(|merchant_id| merchant_id.get_string_repr().to_string()), - Some(EntityType::Merchant), - ), - (enums::UserRoleVersion::V2, _) => (user_role.entity_id.clone(), user_role.entity_type), +impl UserRole { + pub fn get_entity_id_and_type(&self) -> Option<(String, EntityType)> { + match (self.version, self.role_id.as_str()) { + (enums::UserRoleVersion::V1, consts::ROLE_ID_ORGANIZATION_ADMIN) => { + let org_id = self.org_id.clone()?.get_string_repr().to_string(); + Some((org_id, EntityType::Organization)) + } + (enums::UserRoleVersion::V1, consts::ROLE_ID_INTERNAL_VIEW_ONLY_USER) + | (enums::UserRoleVersion::V1, consts::ROLE_ID_INTERNAL_ADMIN) => { + let merchant_id = self.merchant_id.clone()?.get_string_repr().to_string(); + Some((merchant_id, EntityType::Internal)) + } + (enums::UserRoleVersion::V1, _) => { + let merchant_id = self.merchant_id.clone()?.get_string_repr().to_string(); + Some((merchant_id, EntityType::Merchant)) + } + (enums::UserRoleVersion::V2, _) => self.entity_id.clone().zip(self.entity_type), + } } } impl Hash for UserRole { fn hash<H: std::hash::Hasher>(&self, state: &mut H) { - let (entity_id, entity_type) = get_entity_id_and_type(self); - self.user_id.hash(state); - entity_id.hash(state); - entity_type.hash(state); + if let Some((entity_id, entity_type)) = self.get_entity_id_and_type() { + entity_id.hash(state); + entity_type.hash(state); + } } } impl PartialEq for UserRole { fn eq(&self, other: &Self) -> bool { - let (self_entity_id, self_entity_type) = get_entity_id_and_type(self); - let (other_entity_id, other_entity_type) = get_entity_id_and_type(other); - - self.user_id == other.user_id - && self_entity_id == other_entity_id - && self_entity_type == other_entity_type + match ( + self.get_entity_id_and_type(), + other.get_entity_id_and_type(), + ) { + ( + Some((self_entity_id, self_entity_type)), + Some((other_entity_id, other_entity_type)), + ) => { + self.user_id == other.user_id + && self_entity_id == other_entity_id + && self_entity_type == other_entity_type + } + _ => self.user_id == other.user_id, + } } } diff --git a/crates/router/src/core/user.rs b/crates/router/src/core/user.rs index 8e99a202dfe..0c4afbe4ecd 100644 --- a/crates/router/src/core/user.rs +++ b/crates/router/src/core/user.rs @@ -18,8 +18,6 @@ use diesel_models::{ user_authentication_method::{UserAuthenticationMethodNew, UserAuthenticationMethodUpdate}, }; use error_stack::{report, ResultExt}; -#[cfg(feature = "email")] -use external_services::email::EmailData; use masking::{ExposeInterface, PeekInterface, Secret}; #[cfg(feature = "email")] use router_env::env; @@ -64,7 +62,7 @@ pub async fn signup_with_merchant_id( .insert_user_and_merchant_in_db(state.clone()) .await?; - let user_role = new_user + let _user_role = new_user .insert_org_level_user_role_in_db( state.clone(), common_utils::consts::ROLE_ID_ORGANIZATION_ADMIN.to_string(), @@ -89,16 +87,10 @@ pub async fn signup_with_merchant_id( ) .await; - let Some(merchant_id) = user_role.merchant_id else { - return Err(report!(UserErrors::InternalServerError) - .attach_printable("merchant_id not found for user_role")); - }; - logger::info!(?send_email_result); Ok(ApplicationResponse::Json(user_api::AuthorizeResponse { is_email_sent: send_email_result.is_ok(), user_id: user_from_db.get_user_id().to_string(), - merchant_id, })) } @@ -195,7 +187,6 @@ pub async fn connect_account( if let Ok(found_user) = find_user { let user_from_db: domain::UserFromStorage = found_user.into(); - let user_role = user_from_db.get_role_from_db(state.clone()).await?; let email_contents = email_types::MagicLink { recipient_email: domain::UserEmail::from_pii_email(user_from_db.get_email())?, @@ -212,18 +203,12 @@ pub async fn connect_account( state.conf.proxy.https_url.as_ref(), ) .await; - - let Some(merchant_id) = user_role.merchant_id else { - return Err(report!(UserErrors::InternalServerError) - .attach_printable("merchant_id not found for user_role")); - }; logger::info!(?send_email_result); return Ok(ApplicationResponse::Json( user_api::ConnectAccountResponse { is_email_sent: send_email_result.is_ok(), user_id: user_from_db.get_user_id().to_string(), - merchant_id, }, )); } else if find_user @@ -245,7 +230,7 @@ pub async fn connect_account( let user_from_db = new_user .insert_user_and_merchant_in_db(state.clone()) .await?; - let user_role = new_user + let _user_role = new_user .insert_org_level_user_role_in_db( state.clone(), common_utils::consts::ROLE_ID_ORGANIZATION_ADMIN.to_string(), @@ -269,18 +254,12 @@ pub async fn connect_account( ) .await; - let Some(merchant_id) = user_role.merchant_id else { - return Err(report!(UserErrors::InternalServerError) - .attach_printable("merchant_id not found for user_role")); - }; - logger::info!(?send_email_result); return Ok(ApplicationResponse::Json( user_api::ConnectAccountResponse { is_email_sent: send_email_result.is_ok(), user_id: user_from_db.get_user_id().to_string(), - merchant_id, }, )); } else { @@ -512,15 +491,19 @@ pub async fn invite_multiple_user( .attach_printable("Number of invite requests must not exceed 10"); } - let responses = futures::future::join_all(requests.iter().map(|request| async { - match handle_invitation(&state, &user_from_token, request, &req_state, &auth_id).await { + let responses = futures::future::join_all(requests.into_iter().map(|request| async { + match handle_invitation(&state, &user_from_token, &request, &req_state, &auth_id).await { Ok(response) => response, - Err(error) => InviteMultipleUserResponse { - email: request.email.clone(), - is_email_sent: false, - password: None, - error: Some(error.current_context().get_error_message().to_string()), - }, + Err(error) => { + logger::error!(invite_error=?error); + + InviteMultipleUserResponse { + email: request.email, + is_email_sent: false, + password: None, + error: Some(error.current_context().get_error_message().to_string()), + } + } } })) .await; @@ -570,6 +553,7 @@ async fn handle_invitation( user_from_token, request, invitee_user.into(), + role_info, auth_id, ) .await @@ -579,8 +563,15 @@ async fn handle_invitation( .err() .unwrap_or(false) { - handle_new_user_invitation(state, user_from_token, request, req_state.clone(), auth_id) - .await + handle_new_user_invitation( + state, + user_from_token, + request, + role_info, + req_state.clone(), + auth_id, + ) + .await } else { Err(UserErrors::InternalServerError.into()) } @@ -592,6 +583,7 @@ async fn handle_existing_user_invitation( user_from_token: &auth::UserFromToken, request: &user_api::InviteUserRequest, invitee_user_from_db: domain::UserFromStorage, + role_info: roles::RoleInfo, auth_id: &Option<String>, ) -> UserResult<InviteMultipleUserResponse> { let now = common_utils::date_time::now(); @@ -642,24 +634,66 @@ async fn handle_existing_user_invitation( last_modified_by: user_from_token.user_id.clone(), created_at: now, last_modified: now, - entity: domain::MerchantLevel { - org_id: user_from_token.org_id.clone(), - merchant_id: user_from_token.merchant_id.clone(), - }, - } - .insert_in_v1_and_v2(state) - .await?; + entity: domain::NoLevel, + }; + + let _user_role = match role_info.get_entity_type() { + EntityType::Internal => return Err(UserErrors::InvalidRoleId.into()), + EntityType::Organization => return Err(UserErrors::InvalidRoleId.into()), + EntityType::Merchant => { + user_role + .add_entity(domain::MerchantLevel { + org_id: user_from_token.org_id.clone(), + merchant_id: user_from_token.merchant_id.clone(), + }) + .insert_in_v1_and_v2(state) + .await? + } + EntityType::Profile => { + let profile_id = user_from_token + .profile_id + .clone() + .ok_or(UserErrors::InternalServerError)?; + user_role + .add_entity(domain::ProfileLevel { + org_id: user_from_token.org_id.clone(), + merchant_id: user_from_token.merchant_id.clone(), + profile_id: profile_id.clone(), + }) + .insert_in_v2(state) + .await? + } + }; let is_email_sent; #[cfg(feature = "email")] { let invitee_email = domain::UserEmail::from_pii_email(request.email.clone())?; - let email_contents = email_types::InviteRegisteredUser { + let entity = match role_info.get_entity_type() { + EntityType::Internal => return Err(UserErrors::InvalidRoleId.into()), + EntityType::Organization => return Err(UserErrors::InvalidRoleId.into()), + EntityType::Merchant => email_types::Entity { + entity_id: user_from_token.merchant_id.get_string_repr().to_owned(), + entity_type: EntityType::Merchant, + }, + EntityType::Profile => { + let profile_id = user_from_token + .profile_id + .clone() + .ok_or(UserErrors::InternalServerError)?; + email_types::Entity { + entity_id: profile_id.get_string_repr().to_owned(), + entity_type: EntityType::Profile, + } + } + }; + + let email_contents = email_types::InviteUser { recipient_email: invitee_email, user_name: domain::UserName::new(invitee_user_from_db.get_name())?, settings: state.conf.clone(), subject: "You have been invited to join Hyperswitch Community!", - merchant_id: user_from_token.merchant_id.clone(), + entity, auth_id: auth_id.clone(), }; @@ -692,6 +726,7 @@ async fn handle_new_user_invitation( state: &SessionState, user_from_token: &auth::UserFromToken, request: &user_api::InviteUserRequest, + role_info: roles::RoleInfo, req_state: ReqState, auth_id: &Option<String>, ) -> UserResult<InviteMultipleUserResponse> { @@ -718,13 +753,36 @@ async fn handle_new_user_invitation( last_modified_by: user_from_token.user_id.clone(), created_at: now, last_modified: now, - entity: domain::MerchantLevel { - merchant_id: user_from_token.merchant_id.clone(), - org_id: user_from_token.org_id.clone(), - }, - } - .insert_in_v1_and_v2(state) - .await?; + entity: domain::NoLevel, + }; + + let _user_role = match role_info.get_entity_type() { + EntityType::Internal => return Err(UserErrors::InvalidRoleId.into()), + EntityType::Organization => return Err(UserErrors::InvalidRoleId.into()), + EntityType::Merchant => { + user_role + .add_entity(domain::MerchantLevel { + org_id: user_from_token.org_id.clone(), + merchant_id: user_from_token.merchant_id.clone(), + }) + .insert_in_v1_and_v2(state) + .await? + } + EntityType::Profile => { + let profile_id = user_from_token + .profile_id + .clone() + .ok_or(UserErrors::InternalServerError)?; + user_role + .add_entity(domain::ProfileLevel { + org_id: user_from_token.org_id.clone(), + merchant_id: user_from_token.merchant_id.clone(), + profile_id: profile_id.clone(), + }) + .insert_in_v2(state) + .await? + } + }; let is_email_sent; @@ -734,18 +792,39 @@ async fn handle_new_user_invitation( // Will be adding actual usage for this variable later let _ = req_state.clone(); let invitee_email = domain::UserEmail::from_pii_email(request.email.clone())?; - let email_contents: Box<dyn EmailData + Send + 'static> = - Box::new(email_types::InviteRegisteredUser { - recipient_email: invitee_email, - user_name: domain::UserName::new(new_user.get_name())?, - settings: state.conf.clone(), - subject: "You have been invited to join Hyperswitch Community!", - merchant_id: user_from_token.merchant_id.clone(), - auth_id: auth_id.clone(), - }); + let entity = match role_info.get_entity_type() { + EntityType::Internal => return Err(UserErrors::InvalidRoleId.into()), + EntityType::Organization => return Err(UserErrors::InvalidRoleId.into()), + EntityType::Merchant => email_types::Entity { + entity_id: user_from_token.merchant_id.get_string_repr().to_owned(), + entity_type: EntityType::Merchant, + }, + EntityType::Profile => { + let profile_id = user_from_token + .profile_id + .clone() + .ok_or(UserErrors::InternalServerError)?; + email_types::Entity { + entity_id: profile_id.get_string_repr().to_owned(), + entity_type: EntityType::Profile, + } + } + }; + + let email_contents = email_types::InviteUser { + recipient_email: invitee_email, + user_name: domain::UserName::new(new_user.get_name())?, + settings: state.conf.clone(), + subject: "You have been invited to join Hyperswitch Community!", + entity, + auth_id: auth_id.clone(), + }; let send_email_result = state .email_client - .compose_and_send_email(email_contents, state.conf.proxy.https_url.as_ref()) + .compose_and_send_email( + Box::new(email_contents), + state.conf.proxy.https_url.as_ref(), + ) .await; logger::info!(?send_email_result); is_email_sent = send_email_result.is_ok(); @@ -803,40 +882,66 @@ pub async fn resend_invite( } })? .into(); - let user_role = state + + let user_role = match state .store - .find_user_role_by_user_id_merchant_id( + .find_user_role_by_user_id_and_lineage( user.get_user_id(), + &user_from_token.org_id, &user_from_token.merchant_id, - UserRoleVersion::V1, + user_from_token.profile_id.as_ref(), + UserRoleVersion::V2, ) .await - .map_err(|e| { - if e.current_context().is_db_not_found() { - e.change_context(UserErrors::InvalidRoleOperation) - .attach_printable(format!( - "User role with user_id = {} and merchant_id = {:?} is not found", - user.get_user_id(), - user_from_token.merchant_id - )) + { + Ok(user_role) => Some(user_role), + Err(err) => { + if err.current_context().is_db_not_found() { + None } else { - e.change_context(UserErrors::InternalServerError) + return Err(report!(UserErrors::InternalServerError)); } - })?; + } + }; + + let user_role = match user_role { + Some(user_role) => user_role, + None => state + .store + .find_user_role_by_user_id_and_lineage( + user.get_user_id(), + &user_from_token.org_id, + &user_from_token.merchant_id, + user_from_token.profile_id.as_ref(), + UserRoleVersion::V1, + ) + .await + .to_not_found_response(UserErrors::InvalidRoleOperationWithMessage( + "User not found in records".to_string(), + ))?, + }; if !matches!(user_role.status, UserStatus::InvitationSent) { return Err(report!(UserErrors::InvalidRoleOperation)) .attach_printable("User status is not InvitationSent".to_string()); } + let (entity_id, entity_type) = user_role + .get_entity_id_and_type() + .ok_or(UserErrors::InternalServerError)?; + let email_contents = email_types::InviteUser { recipient_email: invitee_email, user_name: domain::UserName::new(user.get_name())?, settings: state.conf.clone(), subject: "You have been invited to join Hyperswitch Community!", - merchant_id: user_from_token.merchant_id, - auth_id, + entity: email_types::Entity { + entity_id, + entity_type, + }, + auth_id: auth_id.clone(), }; + state .email_client .compose_and_send_email( @@ -878,36 +983,25 @@ pub async fn accept_invite_from_email_token_only_flow( return Err(UserErrors::LinkInvalid.into()); } - let merchant_id = email_token - .get_merchant_id() - .ok_or(UserErrors::LinkInvalid)?; - - let key_manager_state = &(&state).into(); + let entity = email_token.get_entity().ok_or(UserErrors::LinkInvalid)?; - let key_store = state - .store - .get_merchant_key_store_by_merchant_id( - key_manager_state, - merchant_id, - &state.store.get_master_key().to_vec().into(), + let (org_id, merchant_id, profile_id) = + utils::user_role::get_lineage_for_user_id_and_entity_for_accepting_invite( + &state, + &user_token.user_id, + entity.entity_id.clone(), + entity.entity_type, ) .await - .change_context(UserErrors::InternalServerError) - .attach_printable("merchant_key_store not found")?; - - let merchant_account = state - .store - .find_merchant_account_by_merchant_id(key_manager_state, merchant_id, &key_store) - .await - .change_context(UserErrors::InternalServerError) - .attach_printable("merchant_account not found")?; + .change_context(UserErrors::InternalServerError)? + .ok_or(UserErrors::InternalServerError)?; let (update_v1_result, update_v2_result) = utils::user_role::update_v1_and_v2_user_roles_in_db( &state, user_from_db.get_user_id(), - &merchant_account.organization_id, - merchant_id, - None, + &org_id, + &merchant_id, + profile_id.as_ref(), UserRoleUpdate::UpdateStatus { status: UserStatus::Active, modified_by: user_from_db.get_user_id().to_owned(), @@ -951,14 +1045,7 @@ pub async fn accept_invite_from_email_token_only_flow( )?; let next_flow = current_flow.next(user_from_db.clone(), &state).await?; - let user_role = user_from_db - .get_preferred_or_active_user_role_from_db(&state) - .await - .change_context(UserErrors::InternalServerError)?; - - let token = next_flow - .get_token_with_user_role(&state, &user_role) - .await?; + let token = next_flow.get_token(&state).await?; let response = user_api::TokenResponse { token: token.clone(), @@ -1534,28 +1621,9 @@ pub async fn update_user_details( let name = req.name.map(domain::UserName::new).transpose()?; - if let Some(ref preferred_merchant_id) = req.preferred_merchant_id { - let _ = state - .store - .find_user_role_by_user_id_merchant_id( - user.get_user_id(), - preferred_merchant_id, - UserRoleVersion::V1, - ) - .await - .map_err(|e| { - if e.current_context().is_db_not_found() { - e.change_context(UserErrors::MerchantIdNotFound) - } else { - e.change_context(UserErrors::InternalServerError) - } - })?; - } - let user_update = storage_user::UserUpdate::AccountUpdate { - name: name.map(|x| x.get_secret().expose()), + name: name.map(|name| name.get_secret().expose()), is_verified: None, - preferred_merchant_id: req.preferred_merchant_id, }; state @@ -2283,23 +2351,35 @@ pub async fn list_orgs_for_user( state: SessionState, user_from_token: auth::UserFromToken, ) -> UserResponse<Vec<user_api::ListOrgsForUserResponse>> { - let orgs = state - .store - .list_user_roles_by_user_id(ListUserRolesByUserIdPayload { - user_id: user_from_token.user_id.as_str(), - org_id: None, - merchant_id: None, - profile_id: None, - entity_id: None, - version: None, - status: Some(UserStatus::Active), - limit: None, - }) - .await - .change_context(UserErrors::InternalServerError)? - .into_iter() - .filter_map(|user_role| user_role.org_id) - .collect::<HashSet<_>>(); + let role_info = roles::RoleInfo::from_role_id( + &state, + &user_from_token.role_id, + &user_from_token.merchant_id, + &user_from_token.org_id, + ) + .await + .change_context(UserErrors::InternalServerError)?; + + let orgs = match role_info.get_entity_type() { + EntityType::Internal => return Err(UserErrors::InvalidRoleOperation.into()), + EntityType::Organization | EntityType::Merchant | EntityType::Profile => state + .store + .list_user_roles_by_user_id(ListUserRolesByUserIdPayload { + user_id: user_from_token.user_id.as_str(), + org_id: None, + merchant_id: None, + profile_id: None, + entity_id: None, + version: None, + status: Some(UserStatus::Active), + limit: None, + }) + .await + .change_context(UserErrors::InternalServerError)? + .into_iter() + .filter_map(|user_role| user_role.org_id) + .collect::<HashSet<_>>(), + }; let resp = futures::future::try_join_all( orgs.iter() @@ -2333,48 +2413,50 @@ pub async fn list_merchants_for_user_in_org( ) .await .change_context(UserErrors::InternalServerError)?; - let merchant_accounts = if role_info.get_entity_type() == EntityType::Organization { - state + let merchant_accounts = match role_info.get_entity_type() { + EntityType::Organization | EntityType::Internal => state .store .list_merchant_accounts_by_organization_id( &(&state).into(), user_from_token.org_id.get_string_repr(), ) .await - .change_context(UserErrors::InternalServerError)? - .into_iter() - .map( - |merchant_account| user_api::ListMerchantsForUserInOrgResponse { - merchant_name: merchant_account.merchant_name.clone(), - merchant_id: merchant_account.get_id().to_owned(), - }, - ) - .collect::<Vec<_>>() - } else { - let merchant_ids = state - .store - .list_user_roles_by_user_id(ListUserRolesByUserIdPayload { - user_id: user_from_token.user_id.as_str(), - org_id: Some(&user_from_token.org_id), - merchant_id: None, - profile_id: None, - entity_id: None, - version: None, - status: Some(UserStatus::Active), - limit: None, - }) - .await - .change_context(UserErrors::InternalServerError)? - .into_iter() - .filter_map(|user_role| user_role.merchant_id) - .collect::<HashSet<_>>() - .into_iter() - .collect(); - state - .store - .list_multiple_merchant_accounts(&(&state).into(), merchant_ids) - .await - .change_context(UserErrors::InternalServerError)? + .change_context(UserErrors::InternalServerError)?, + EntityType::Merchant | EntityType::Profile => { + let merchant_ids = state + .store + .list_user_roles_by_user_id(ListUserRolesByUserIdPayload { + user_id: user_from_token.user_id.as_str(), + org_id: Some(&user_from_token.org_id), + merchant_id: None, + profile_id: None, + entity_id: None, + version: None, + status: Some(UserStatus::Active), + limit: None, + }) + .await + .change_context(UserErrors::InternalServerError)? + .into_iter() + .filter_map(|user_role| user_role.merchant_id) + .collect::<HashSet<_>>() + .into_iter() + .collect(); + + state + .store + .list_multiple_merchant_accounts(&(&state).into(), merchant_ids) + .await + .change_context(UserErrors::InternalServerError)? + } + }; + + if merchant_accounts.is_empty() { + Err(UserErrors::InternalServerError).attach_printable("No merchant found for a user")?; + } + + Ok(ApplicationResponse::Json( + merchant_accounts .into_iter() .map( |merchant_account| user_api::ListMerchantsForUserInOrgResponse { @@ -2382,14 +2464,8 @@ pub async fn list_merchants_for_user_in_org( merchant_id: merchant_account.get_id().to_owned(), }, ) - .collect::<Vec<_>>() - }; - - if merchant_accounts.is_empty() { - Err(UserErrors::InternalServerError).attach_printable("No merchant found for a user")?; - } - - Ok(ApplicationResponse::Json(merchant_accounts)) + .collect::<Vec<_>>(), + )) } pub async fn list_profiles_for_user_in_org_and_merchant_account( @@ -2415,27 +2491,17 @@ pub async fn list_profiles_for_user_in_org_and_merchant_account( ) .await .change_context(UserErrors::InternalServerError)?; - let user_role_level = role_info.get_entity_type(); - let profiles = - if user_role_level == EntityType::Organization || user_role_level == EntityType::Merchant { - state - .store - .list_business_profile_by_merchant_id( - key_manager_state, - &key_store, - &user_from_token.merchant_id, - ) - .await - .change_context(UserErrors::InternalServerError)? - .into_iter() - .map( - |profile| user_api::ListProfilesForUserInOrgAndMerchantAccountResponse { - profile_id: profile.get_id().to_owned(), - profile_name: profile.profile_name, - }, - ) - .collect::<Vec<_>>() - } else { + let profiles = match role_info.get_entity_type() { + EntityType::Organization | EntityType::Merchant | EntityType::Internal => state + .store + .list_business_profile_by_merchant_id( + key_manager_state, + &key_store, + &user_from_token.merchant_id, + ) + .await + .change_context(UserErrors::InternalServerError)?, + EntityType::Profile => { let profile_ids = state .store .list_user_roles_by_user_id(ListUserRolesByUserIdPayload { @@ -2463,6 +2529,15 @@ pub async fn list_profiles_for_user_in_org_and_merchant_account( })) .await .change_context(UserErrors::InternalServerError)? + } + }; + + if profiles.is_empty() { + Err(UserErrors::InternalServerError).attach_printable("No profile found for a user")?; + } + + Ok(ApplicationResponse::Json( + profiles .into_iter() .map( |profile| user_api::ListProfilesForUserInOrgAndMerchantAccountResponse { @@ -2470,14 +2545,8 @@ pub async fn list_profiles_for_user_in_org_and_merchant_account( profile_name: profile.profile_name, }, ) - .collect::<Vec<_>>() - }; - - if profiles.is_empty() { - Err(UserErrors::InternalServerError).attach_printable("No profile found for a user")?; - } - - Ok(ApplicationResponse::Json(profiles)) + .collect::<Vec<_>>(), + )) } pub async fn switch_org_for_user( diff --git a/crates/router/src/core/user_role.rs b/crates/router/src/core/user_role.rs index 5125147fde9..8c955a09517 100644 --- a/crates/router/src/core/user_role.rs +++ b/crates/router/src/core/user_role.rs @@ -3,7 +3,7 @@ use std::collections::{HashMap, HashSet}; use api_models::{user as user_api, user_role as user_role_api}; use diesel_models::{ enums::{UserRoleVersion, UserStatus}, - user_role::{get_entity_id_and_type, UserRoleUpdate}, + user_role::UserRoleUpdate, }; use error_stack::{report, ResultExt}; use once_cell::sync::Lazy; @@ -287,7 +287,59 @@ pub async fn accept_invitation( })) .await; - if update_result.iter().all(Result::is_err) { + if update_result.is_empty() || update_result.iter().all(Result::is_err) { + return Err(UserErrors::MerchantIdNotFound.into()); + } + + Ok(ApplicationResponse::StatusOk) +} + +pub async fn accept_invitations_v2( + state: SessionState, + user_from_token: auth::UserFromToken, + req: user_role_api::AcceptInvitationsV2Request, +) -> UserResponse<()> { + let lineages = futures::future::try_join_all(req.into_iter().map(|entity| { + utils::user_role::get_lineage_for_user_id_and_entity_for_accepting_invite( + &state, + &user_from_token.user_id, + entity.entity_id, + entity.entity_type, + ) + })) + .await? + .into_iter() + .flatten() + .collect::<Vec<_>>(); + + let update_results = futures::future::join_all(lineages.iter().map( + |(org_id, merchant_id, profile_id)| async { + let (update_v1_result, update_v2_result) = + utils::user_role::update_v1_and_v2_user_roles_in_db( + &state, + user_from_token.user_id.as_str(), + org_id, + merchant_id, + profile_id.as_ref(), + UserRoleUpdate::UpdateStatus { + status: UserStatus::Active, + modified_by: user_from_token.user_id.clone(), + }, + ) + .await; + + if update_v1_result.is_err_and(|err| !err.current_context().is_db_not_found()) + || update_v2_result.is_err_and(|err| !err.current_context().is_db_not_found()) + { + Err(report!(UserErrors::InternalServerError)) + } else { + Ok(()) + } + }, + )) + .await; + + if update_results.is_empty() || update_results.iter().all(Result::is_err) { return Err(UserErrors::MerchantIdNotFound.into()); } @@ -331,7 +383,7 @@ pub async fn merchant_select_token_only_flow( })) .await; - if update_result.iter().all(Result::is_err) { + if update_result.is_empty() || update_result.iter().all(Result::is_err) { return Err(UserErrors::MerchantIdNotFound.into()); } @@ -342,18 +394,80 @@ pub async fn merchant_select_token_only_flow( .change_context(UserErrors::InternalServerError)? .into(); - let user_role = user_from_db - .get_preferred_or_active_user_role_from_db(&state) + let current_flow = + domain::CurrentFlow::new(user_token, domain::SPTFlow::MerchantSelect.into())?; + let next_flow = current_flow.next(user_from_db.clone(), &state).await?; + + let token = next_flow.get_token(&state).await?; + + let response = user_api::TokenResponse { + token: token.clone(), + token_type: next_flow.get_flow().into(), + }; + auth::cookies::set_cookie_response(response, token) +} + +pub async fn accept_invitations_pre_auth( + state: SessionState, + user_token: auth::UserFromSinglePurposeToken, + req: user_role_api::AcceptInvitationsPreAuthRequest, +) -> UserResponse<user_api::TokenResponse> { + let lineages = futures::future::try_join_all(req.into_iter().map(|entity| { + utils::user_role::get_lineage_for_user_id_and_entity_for_accepting_invite( + &state, + &user_token.user_id, + entity.entity_id, + entity.entity_type, + ) + })) + .await? + .into_iter() + .flatten() + .collect::<Vec<_>>(); + + let update_results = futures::future::join_all(lineages.iter().map( + |(org_id, merchant_id, profile_id)| async { + let (update_v1_result, update_v2_result) = + utils::user_role::update_v1_and_v2_user_roles_in_db( + &state, + user_token.user_id.as_str(), + org_id, + merchant_id, + profile_id.as_ref(), + UserRoleUpdate::UpdateStatus { + status: UserStatus::Active, + modified_by: user_token.user_id.clone(), + }, + ) + .await; + + if update_v1_result.is_err_and(|err| !err.current_context().is_db_not_found()) + || update_v2_result.is_err_and(|err| !err.current_context().is_db_not_found()) + { + Err(report!(UserErrors::InternalServerError)) + } else { + Ok(()) + } + }, + )) + .await; + + if update_results.is_empty() || update_results.iter().all(Result::is_err) { + return Err(UserErrors::MerchantIdNotFound.into()); + } + + let user_from_db: domain::UserFromStorage = state + .global_store + .find_user_by_id(user_token.user_id.as_str()) .await - .change_context(UserErrors::InternalServerError)?; + .change_context(UserErrors::InternalServerError)? + .into(); let current_flow = domain::CurrentFlow::new(user_token, domain::SPTFlow::MerchantSelect.into())?; let next_flow = current_flow.next(user_from_db.clone(), &state).await?; - let token = next_flow - .get_token_with_user_role(&state, &user_role) - .await?; + let token = next_flow.get_token(&state).await?; let response = user_api::TokenResponse { token: token.clone(), @@ -709,14 +823,12 @@ pub async fn list_invitations_for_user( .collect::<HashSet<_>>() .into_iter() .filter_map(|user_role| { - let (entity_id, entity_type) = get_entity_id_and_type(&user_role); - entity_id.zip(entity_type).map(|(entity_id, entity_type)| { - user_role_api::ListInvitationForUserResponse { - entity_id, - entity_type, - entity_name: None, - role_id: user_role.role_id, - } + let (entity_id, entity_type) = user_role.get_entity_id_and_type()?; + Some(user_role_api::ListInvitationForUserResponse { + entity_id, + entity_type, + entity_name: None, + role_id: user_role.role_id, }) }) .collect(); diff --git a/crates/router/src/db/user.rs b/crates/router/src/db/user.rs index b8c5001d910..c9244eb12b4 100644 --- a/crates/router/src/db/user.rs +++ b/crates/router/src/db/user.rs @@ -159,7 +159,6 @@ impl UserInterface for MockDb { is_verified: user_data.is_verified, created_at: user_data.created_at.unwrap_or(time_now), last_modified_at: user_data.created_at.unwrap_or(time_now), - preferred_merchant_id: user_data.preferred_merchant_id, totp_status: user_data.totp_status, totp_secret: user_data.totp_secret, totp_recovery_codes: user_data.totp_recovery_codes, @@ -218,16 +217,9 @@ impl UserInterface for MockDb { is_verified: true, ..user.to_owned() }, - storage::UserUpdate::AccountUpdate { - name, - is_verified, - preferred_merchant_id, - } => storage::User { + storage::UserUpdate::AccountUpdate { name, is_verified } => storage::User { name: name.clone().map(Secret::new).unwrap_or(user.name.clone()), is_verified: is_verified.unwrap_or(user.is_verified), - preferred_merchant_id: preferred_merchant_id - .clone() - .or(user.preferred_merchant_id.clone()), ..user.to_owned() }, storage::UserUpdate::TotpUpdate { @@ -273,16 +265,9 @@ impl UserInterface for MockDb { is_verified: true, ..user.to_owned() }, - storage::UserUpdate::AccountUpdate { - name, - is_verified, - preferred_merchant_id, - } => storage::User { + storage::UserUpdate::AccountUpdate { name, is_verified } => storage::User { name: name.clone().map(Secret::new).unwrap_or(user.name.clone()), is_verified: is_verified.unwrap_or(user.is_verified), - preferred_merchant_id: preferred_merchant_id - .clone() - .or(user.preferred_merchant_id.clone()), ..user.to_owned() }, storage::UserUpdate::TotpUpdate { diff --git a/crates/router/src/routes/app.rs b/crates/router/src/routes/app.rs index 7d314bb3df2..98ced576105 100644 --- a/crates/router/src/routes/app.rs +++ b/crates/router/src/routes/app.rs @@ -1825,9 +1825,22 @@ impl User { web::resource("/invite_multiple").route(web::post().to(invite_multiple_user)), ) .service( - web::resource("/invite/accept") - .route(web::post().to(merchant_select)) - .route(web::put().to(accept_invitation)), + web::scope("/invite/accept") + .service( + web::resource("") + .route(web::post().to(merchant_select)) + .route(web::put().to(accept_invitation)), + ) + .service( + web::scope("/v2") + .service( + web::resource("").route(web::post().to(accept_invitations_v2)), + ) + .service( + web::resource("/pre_auth") + .route(web::post().to(accept_invitations_pre_auth)), + ), + ), ) .service(web::resource("/update_role").route(web::post().to(update_user_role))) .service(web::resource("/delete").route(web::delete().to(delete_user_role))), diff --git a/crates/router/src/routes/lock_utils.rs b/crates/router/src/routes/lock_utils.rs index c6160497918..2b2a1be0878 100644 --- a/crates/router/src/routes/lock_utils.rs +++ b/crates/router/src/routes/lock_utils.rs @@ -263,7 +263,9 @@ impl From<Flow> for ApiIdentifier { | Flow::GetAuthorizationInfo | Flow::GetRolesInfo | Flow::AcceptInvitation + | Flow::AcceptInvitationsV2 | Flow::MerchantSelect + | Flow::AcceptInvitationsPreAuth | Flow::DeleteUserRole | Flow::CreateRole | Flow::UpdateRole diff --git a/crates/router/src/routes/user_role.rs b/crates/router/src/routes/user_role.rs index 61250774c10..35c9098edd2 100644 --- a/crates/router/src/routes/user_role.rs +++ b/crates/router/src/routes/user_role.rs @@ -168,6 +168,25 @@ pub async fn accept_invitation( .await } +pub async fn accept_invitations_v2( + state: web::Data<AppState>, + req: HttpRequest, + json_payload: web::Json<user_role_api::AcceptInvitationsV2Request>, +) -> HttpResponse { + let flow = Flow::AcceptInvitationsV2; + let payload = json_payload.into_inner(); + Box::pin(api::server_wrap( + flow, + state.clone(), + &req, + payload, + |state, user, req_body, _| user_role_core::accept_invitations_v2(state, user, req_body), + &auth::DashboardNoPermissionAuth, + api_locking::LockAction::NotApplicable, + )) + .await +} + pub async fn merchant_select( state: web::Data<AppState>, req: HttpRequest, @@ -189,6 +208,27 @@ pub async fn merchant_select( .await } +pub async fn accept_invitations_pre_auth( + state: web::Data<AppState>, + req: HttpRequest, + json_payload: web::Json<user_role_api::AcceptInvitationsPreAuthRequest>, +) -> HttpResponse { + let flow = Flow::AcceptInvitationsPreAuth; + let payload = json_payload.into_inner(); + Box::pin(api::server_wrap( + flow, + state.clone(), + &req, + payload, + |state, user, req_body, _| async move { + user_role_core::accept_invitations_pre_auth(state, user, req_body).await + }, + &auth::SinglePurposeJWTAuth(TokenPurpose::AcceptInvite), + api_locking::LockAction::NotApplicable, + )) + .await +} + pub async fn delete_user_role( state: web::Data<AppState>, req: HttpRequest, diff --git a/crates/router/src/services/email/types.rs b/crates/router/src/services/email/types.rs index 3a17966fac3..6ed03e1ea06 100644 --- a/crates/router/src/services/email/types.rs +++ b/crates/router/src/services/email/types.rs @@ -1,4 +1,5 @@ use api_models::user::dashboard_metadata::ProdIntent; +use common_enums::EntityType; use common_utils::{ errors::{self, CustomResult}, pii, @@ -151,15 +152,31 @@ Email : {user_email} #[derive(serde::Serialize, serde::Deserialize)] pub struct EmailToken { email: String, - merchant_id: Option<common_utils::id_type::MerchantId>, flow: domain::Origin, exp: u64, + entity: Option<Entity>, +} + +#[derive(serde::Serialize, serde::Deserialize, Clone)] +pub struct Entity { + pub entity_id: String, + pub entity_type: EntityType, +} + +impl Entity { + pub fn get_entity_type(&self) -> EntityType { + self.entity_type + } + + pub fn get_entity_id(&self) -> &str { + &self.entity_id + } } impl EmailToken { pub async fn new_token( email: domain::UserEmail, - merchant_id: Option<common_utils::id_type::MerchantId>, + entity: Option<Entity>, flow: domain::Origin, settings: &configs::Settings, ) -> CustomResult<String, UserErrors> { @@ -167,9 +184,9 @@ impl EmailToken { let exp = jwt::generate_exp(expiration_duration)?.as_secs(); let token_payload = Self { email: email.get_secret().expose(), - merchant_id, flow, exp, + entity, }; jwt::generate_jwt(&token_payload, settings).await } @@ -178,8 +195,8 @@ impl EmailToken { pii::Email::try_from(self.email.clone()) } - pub fn get_merchant_id(&self) -> Option<&common_utils::id_type::MerchantId> { - self.merchant_id.as_ref() + pub fn get_entity(&self) -> Option<&Entity> { + self.entity.as_ref() } pub fn get_flow(&self) -> domain::Origin { @@ -320,13 +337,12 @@ impl EmailData for MagicLink { } } -// TODO: Deprecate this and use InviteRegisteredUser for new invites pub struct InviteUser { pub recipient_email: domain::UserEmail, pub user_name: domain::UserName, pub settings: std::sync::Arc<configs::Settings>, pub subject: &'static str, - pub merchant_id: common_utils::id_type::MerchantId, + pub entity: Entity, pub auth_id: Option<String>, } @@ -335,48 +351,7 @@ impl EmailData for InviteUser { async fn get_email_data(&self) -> CustomResult<EmailContents, EmailError> { let token = EmailToken::new_token( self.recipient_email.clone(), - Some(self.merchant_id.clone()), - domain::Origin::ResetPassword, - &self.settings, - ) - .await - .change_context(EmailError::TokenGenerationFailure)?; - - let invite_user_link = get_link_with_token( - &self.settings.user.base_url, - token, - "set_password", - &self.auth_id, - ); - - let body = html::get_html_body(EmailBody::InviteUser { - link: invite_user_link, - user_name: self.user_name.clone().get_secret().expose(), - }); - - Ok(EmailContents { - subject: self.subject.to_string(), - body: external_services::email::IntermediateString::new(body), - recipient: self.recipient_email.clone().into_inner(), - }) - } -} - -pub struct InviteRegisteredUser { - pub recipient_email: domain::UserEmail, - pub user_name: domain::UserName, - pub settings: std::sync::Arc<configs::Settings>, - pub subject: &'static str, - pub merchant_id: common_utils::id_type::MerchantId, - pub auth_id: Option<String>, -} - -#[async_trait::async_trait] -impl EmailData for InviteRegisteredUser { - async fn get_email_data(&self) -> CustomResult<EmailContents, EmailError> { - let token = EmailToken::new_token( - self.recipient_email.clone(), - Some(self.merchant_id.clone()), + Some(self.entity.clone()), domain::Origin::AcceptInvitationFromEmail, &self.settings, ) diff --git a/crates/router/src/types/domain/user.rs b/crates/router/src/types/domain/user.rs index 674ea8b5c0d..36af30cd9fa 100644 --- a/crates/router/src/types/domain/user.rs +++ b/crates/router/src/types/domain/user.rs @@ -703,7 +703,6 @@ impl TryFrom<NewUser> for storage_user::UserNew { is_verified: false, created_at: Some(now), last_modified_at: Some(now), - preferred_merchant_id: None, totp_status: TotpStatus::NotSet, totp_secret: None, totp_recovery_codes: None, @@ -931,10 +930,6 @@ impl UserFromStorage { Ok(days_left_for_password_rotate.whole_days() < 0) } - pub fn get_preferred_merchant_id(&self) -> Option<id_type::MerchantId> { - self.0.preferred_merchant_id.clone() - } - pub async fn get_role_from_db_by_merchant_id( &self, state: &SessionState, @@ -950,29 +945,6 @@ impl UserFromStorage { .await } - pub async fn get_preferred_or_active_user_role_from_db( - &self, - state: &SessionState, - ) -> CustomResult<UserRole, errors::StorageError> { - if let Some(preferred_merchant_id) = self.get_preferred_merchant_id() { - self.get_role_from_db_by_merchant_id(state, &preferred_merchant_id) - .await - } else { - state - .store - .list_user_roles_by_user_id_and_version(&self.0.user_id, UserRoleVersion::V1) - .await? - .into_iter() - .find(|role| role.status == UserStatus::Active) - .ok_or( - errors::StorageError::ValueNotFound( - "No active role found for user".to_string(), - ) - .into(), - ) - } - } - pub async fn get_or_create_key_store(&self, state: &SessionState) -> UserResult<UserKeyStore> { let master_key = state.store.get_master_key(); let key_manager_state = &state.into(); diff --git a/crates/router/src/types/domain/user/decision_manager.rs b/crates/router/src/types/domain/user/decision_manager.rs index 4206b16df6d..af9918af673 100644 --- a/crates/router/src/types/domain/user/decision_manager.rs +++ b/crates/router/src/types/domain/user/decision_manager.rs @@ -1,11 +1,15 @@ use common_enums::TokenPurpose; -use diesel_models::{enums::UserStatus, user_role::UserRole}; +use diesel_models::{ + enums::{UserRoleVersion, UserStatus}, + user_role::UserRole, +}; use error_stack::{report, ResultExt}; use masking::Secret; use super::UserFromStorage; use crate::{ - core::errors::{StorageErrorExt, UserErrors, UserResult}, + core::errors::{UserErrors, UserResult}, + db::user_role::ListUserRolesByUserIdPayload, routes::SessionState, services::authentication as auth, utils, @@ -284,11 +288,22 @@ impl NextFlow { { self.user.get_verification_days_left(state)?; } - let user_role = self - .user - .get_preferred_or_active_user_role_from_db(state) + let user_role = state + .store + .list_user_roles_by_user_id(ListUserRolesByUserIdPayload { + user_id: self.user.get_user_id(), + org_id: None, + merchant_id: None, + profile_id: None, + entity_id: None, + version: Some(UserRoleVersion::V1), + status: Some(UserStatus::Active), + limit: Some(1), + }) .await - .to_not_found_response(UserErrors::InternalServerError)?; + .change_context(UserErrors::InternalServerError)? + .pop() + .ok_or(UserErrors::InternalServerError)?; utils::user_role::set_role_permissions_in_cache_by_user_role(state, &user_role) .await; diff --git a/crates/router/src/utils/user_role.rs b/crates/router/src/utils/user_role.rs index dbe3ed6d585..aeb866d8d03 100644 --- a/crates/router/src/utils/user_role.rs +++ b/crates/router/src/utils/user_role.rs @@ -4,7 +4,7 @@ use api_models::user_role as user_role_api; use common_enums::{EntityType, PermissionGroup}; use common_utils::id_type; use diesel_models::{ - enums::UserRoleVersion, + enums::{UserRoleVersion, UserStatus}, user_role::{UserRole, UserRoleUpdate}, }; use error_stack::{report, Report, ResultExt}; @@ -14,6 +14,7 @@ use storage_impl::errors::StorageError; use crate::{ consts, core::errors::{UserErrors, UserResult}, + db::user_role::ListUserRolesByUserIdPayload, routes::SessionState, services::authorization::{self as authz, permissions::Permission, roles}, types::domain, @@ -247,3 +248,113 @@ pub async fn get_single_merchant_id( .attach_printable("merchant_id not found"), } } + +pub async fn get_lineage_for_user_id_and_entity_for_accepting_invite( + state: &SessionState, + user_id: &str, + entity_id: String, + entity_type: EntityType, +) -> UserResult< + Option<( + id_type::OrganizationId, + id_type::MerchantId, + Option<id_type::ProfileId>, + )>, +> { + match entity_type { + EntityType::Internal | EntityType::Organization => { + Err(UserErrors::InvalidRoleOperation.into()) + } + EntityType::Merchant => { + let Ok(merchant_id) = id_type::MerchantId::wrap(entity_id) else { + return Ok(None); + }; + + let user_roles = state + .store + .list_user_roles_by_user_id(ListUserRolesByUserIdPayload { + user_id, + org_id: None, + merchant_id: Some(&merchant_id), + profile_id: None, + entity_id: None, + version: None, + status: Some(UserStatus::InvitationSent), + limit: None, + }) + .await + .change_context(UserErrors::InternalServerError)? + .into_iter() + .collect::<HashSet<_>>(); + + if user_roles.len() > 1 { + return Ok(None); + } + + if let Some(user_role) = user_roles.into_iter().next() { + let (_entity_id, entity_type) = user_role + .get_entity_id_and_type() + .ok_or(UserErrors::InternalServerError)?; + + if entity_type != EntityType::Merchant { + return Ok(None); + } + + return Ok(Some(( + user_role.org_id.ok_or(UserErrors::InternalServerError)?, + merchant_id, + None, + ))); + } + + Ok(None) + } + EntityType::Profile => { + let Ok(profile_id) = id_type::ProfileId::try_from(std::borrow::Cow::from(entity_id)) + else { + return Ok(None); + }; + + let user_roles = state + .store + .list_user_roles_by_user_id(ListUserRolesByUserIdPayload { + user_id, + org_id: None, + merchant_id: None, + profile_id: Some(&profile_id), + entity_id: None, + version: None, + status: Some(UserStatus::InvitationSent), + limit: None, + }) + .await + .change_context(UserErrors::InternalServerError)? + .into_iter() + .collect::<HashSet<_>>(); + + if user_roles.len() > 1 { + return Ok(None); + } + + if let Some(user_role) = user_roles.into_iter().next() { + let (_entity_id, entity_type) = user_role + .get_entity_id_and_type() + .ok_or(UserErrors::InternalServerError)?; + + if entity_type != EntityType::Profile { + return Ok(None); + } + + return Ok(Some(( + user_role.org_id.ok_or(UserErrors::InternalServerError)?, + user_role + .merchant_id + .ok_or(UserErrors::InternalServerError)?, + Some(profile_id), + ))); + } + + Ok(None) + } + } +} diff --git a/crates/router_env/src/logger/types.rs b/crates/router_env/src/logger/types.rs index 3aae72d8aa7..34e4dc72036 100644 --- a/crates/router_env/src/logger/types.rs +++ b/crates/router_env/src/logger/types.rs @@ -424,10 +424,14 @@ pub enum Flow { VerifyEmailRequest, /// Update user account details UpdateUserAccountDetails, - /// Accept user invitation + /// Accept user invitation using merchant_ids AcceptInvitation, + /// Accept user invitation using entities + AcceptInvitationsV2, /// Select merchant from invitations MerchantSelect, + /// Accept user invitation using entities before user login + AcceptInvitationsPreAuth, /// Initiate external authentication for a payment PaymentsExternalAuthentication, /// Authorize the payment after external 3ds authentication diff --git a/migrations/2024-09-01-094614_remove-preferred-merchant-from-users/down.sql b/migrations/2024-09-01-094614_remove-preferred-merchant-from-users/down.sql new file mode 100644 index 00000000000..ab5ef65be8b --- /dev/null +++ b/migrations/2024-09-01-094614_remove-preferred-merchant-from-users/down.sql @@ -0,0 +1,2 @@ +-- This file should undo anything in `up.sql` +ALTER TABLE users ADD COLUMN preferred_merchant_id VARCHAR(64); diff --git a/migrations/2024-09-01-094614_remove-preferred-merchant-from-users/up.sql b/migrations/2024-09-01-094614_remove-preferred-merchant-from-users/up.sql new file mode 100644 index 00000000000..84af1f99e0c --- /dev/null +++ b/migrations/2024-09-01-094614_remove-preferred-merchant-from-users/up.sql @@ -0,0 +1,2 @@ +-- Your SQL goes here +ALTER TABLE users DROP COLUMN preferred_merchant_id;
feat
Add profile level invites (#5793)
8b89969476b7476f5b2e2dd63e69881dd9c9247c
2023-09-22 12:35:06
github-actions
chore(version): v1.44.0
false
diff --git a/CHANGELOG.md b/CHANGELOG.md index cbfec4643f9..aafd516d80d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,33 @@ All notable changes to HyperSwitch will be documented here. - - - +## 1.44.0 (2023-09-22) + +### Features + +- **connector:** [Trustpay] Add descriptor for card payment method for trustpay ([#2256](https://github.com/juspay/hyperswitch/pull/2256)) ([`b9ddc4f`](https://github.com/juspay/hyperswitch/commit/b9ddc4fb69396a2ced73bc24e3d947eb8c4e091a)) +- **db:** Add find_config_by_key_unwrap_or ([#2214](https://github.com/juspay/hyperswitch/pull/2214)) ([`2bd2526`](https://github.com/juspay/hyperswitch/commit/2bd25261b43b8b89ff2042e944ffa6008cc77c8f)) + +### Bug Fixes + +- **connector:** Fix dispute webhook failure bug in checkout during get_webhook_resource_object ([#2257](https://github.com/juspay/hyperswitch/pull/2257)) ([`1d73be0`](https://github.com/juspay/hyperswitch/commit/1d73be08fb3a747ab22ee42eed9f396d78a949dd)) + +### Refactors + +- **connector:** + - [Stripe] refactor stripe payment method not implemented errors ([#1927](https://github.com/juspay/hyperswitch/pull/1927)) ([`417f793`](https://github.com/juspay/hyperswitch/commit/417f793284a11218fc520319ed717759f60e3934)) + - [Adyen] Enhance currency Mapping with ConnectorCurrencyCommon Trait ([#2209](https://github.com/juspay/hyperswitch/pull/2209)) ([`3d18f20`](https://github.com/juspay/hyperswitch/commit/3d18f2062e5d7c14fc5725547eeaf80d7b2a86da)) + +### Miscellaneous Tasks + +- **CODEOWNERS:** Update CODEOWNERS ([#2254](https://github.com/juspay/hyperswitch/pull/2254)) ([`7af4c92`](https://github.com/juspay/hyperswitch/commit/7af4c92ef25b8e2b71a6839fcd80925c09897779)) +- **deps:** Bump phonenumber from 0.3.2+8.13.9 to 0.3.3+8.13.9 ([#2255](https://github.com/juspay/hyperswitch/pull/2255)) ([`8f3721d`](https://github.com/juspay/hyperswitch/commit/8f3721d16b27962923bff0968f7074cef2471e36)) + +**Full Changelog:** [`v1.43.1...v1.44.0`](https://github.com/juspay/hyperswitch/compare/v1.43.1...v1.44.0) + +- - - + + ## 1.43.1 (2023-09-21) ### Bug Fixes
chore
v1.44.0
548d1b0c0ed9ed21fefbe8bf1289540cb4a7cec1
2024-11-12 19:59:58
Sanchith Hegde
docs(api-reference): remove redundant webhooks page (#6538)
false
diff --git a/api-reference-v2/essentials/webhooks.mdx b/api-reference-v2/essentials/webhooks.mdx deleted file mode 100644 index 20ce3518ea7..00000000000 --- a/api-reference-v2/essentials/webhooks.mdx +++ /dev/null @@ -1,45 +0,0 @@ -# Webhooks - -Webhooks are HTTP-based real-time push notifications that Hyperswitch would use for instant status communication to your server. Webhooks are vital in payments for the following reasons: - -- Preventing merchants from losing business due to delayed status communication (say, in case of flight or movie reservations where there is a need for instant payment confirmation). -- Prevent payment reconciliation issues where payments change from “Failed” to “Succeeded”. -- Providing the best payment experience for the end-user by instantly communicating payment status and fulfilling the purchase. - -## Configuring Webhooks -<Steps> -<Step title="Create an endpoint on your server">You would need to set up a dedicated HTTPS or HTTP endpoint on your server with a URL as a webhook listener that will receive push notifications in the form of a POST request with JSON payload from the Hyperswitch server</Step> -<Step title="Update your webhook endpoint on Hyperswitch Dashboard"> Update the above endpoint on your Hyperswitch dashboard under Settings -> Webhooks</Step> -<Step title= "Update Hyperswitch’s webhook endpoints on your connector Dashboard">In order for Hyperswitch to receive updates from the connectors you have selected, you would need to update Hyperswitch’s corresponding endpoints on your respective connector dashboard instead of your webhook endpoints</Step> -</Steps> - -Hyperswitch’s webhook endpoint format is as follows: - -| Environment | Webhook Endpoint | -| ----------- | ---------------- | -| Sandbox | sandbox.hyperswitch.io/webhooks/`{merchant_id}`/`{connector_name}` | -| Production | api.hyperswitch.io/webhooks/`{merchant_id}`/`{connector_name}`| - -## Handling Webhooks - -- **Select the events for Webhooks:** On the same page on the dashboard, select the events for which you would like to receive notifications. Currently, Webhooks are available on Hyperswitch for the following events: - - 1. payment_succeeded - 2. payment_failed - 3. payment_processing - 4. action_required - 5. refund_succeeded - 6. refund_failed - 7. dispute_opened - 8. dispute_expired - 9. dispute_accepted - 10. dispute_cancelled - 11. dispute_challenged - 12. dispute_won - 13. dispute_lost - -<Info>Click [**here**](https://juspay-78.mintlify.app/api-reference/schemas/outgoing--webhook) to see the webhook payload your endpoint would need to parse for each of the above events</Info> - -- **Return a 2xx response:** Your server must return a successful 2xx response on successful receipt of webhooks. - -- **Retries:** In case of 3xx, 4xx, or 5xx response or no response from your endpoint for webhooks, Hyperswitch has a retry mechanism that tries sending the webhooks again up to 3 times before marking the event as failed. diff --git a/api-reference-v2/mint.json b/api-reference-v2/mint.json index dc47cf5d4c0..9964806ec95 100644 --- a/api-reference-v2/mint.json +++ b/api-reference-v2/mint.json @@ -28,7 +28,6 @@ { "group": "Essentials", "pages": [ - "essentials/webhooks", "essentials/error_codes", "essentials/rate_limit", "essentials/go-live" diff --git a/api-reference/essentials/webhooks.mdx b/api-reference/essentials/webhooks.mdx deleted file mode 100644 index 20ce3518ea7..00000000000 --- a/api-reference/essentials/webhooks.mdx +++ /dev/null @@ -1,45 +0,0 @@ -# Webhooks - -Webhooks are HTTP-based real-time push notifications that Hyperswitch would use for instant status communication to your server. Webhooks are vital in payments for the following reasons: - -- Preventing merchants from losing business due to delayed status communication (say, in case of flight or movie reservations where there is a need for instant payment confirmation). -- Prevent payment reconciliation issues where payments change from “Failed” to “Succeeded”. -- Providing the best payment experience for the end-user by instantly communicating payment status and fulfilling the purchase. - -## Configuring Webhooks -<Steps> -<Step title="Create an endpoint on your server">You would need to set up a dedicated HTTPS or HTTP endpoint on your server with a URL as a webhook listener that will receive push notifications in the form of a POST request with JSON payload from the Hyperswitch server</Step> -<Step title="Update your webhook endpoint on Hyperswitch Dashboard"> Update the above endpoint on your Hyperswitch dashboard under Settings -> Webhooks</Step> -<Step title= "Update Hyperswitch’s webhook endpoints on your connector Dashboard">In order for Hyperswitch to receive updates from the connectors you have selected, you would need to update Hyperswitch’s corresponding endpoints on your respective connector dashboard instead of your webhook endpoints</Step> -</Steps> - -Hyperswitch’s webhook endpoint format is as follows: - -| Environment | Webhook Endpoint | -| ----------- | ---------------- | -| Sandbox | sandbox.hyperswitch.io/webhooks/`{merchant_id}`/`{connector_name}` | -| Production | api.hyperswitch.io/webhooks/`{merchant_id}`/`{connector_name}`| - -## Handling Webhooks - -- **Select the events for Webhooks:** On the same page on the dashboard, select the events for which you would like to receive notifications. Currently, Webhooks are available on Hyperswitch for the following events: - - 1. payment_succeeded - 2. payment_failed - 3. payment_processing - 4. action_required - 5. refund_succeeded - 6. refund_failed - 7. dispute_opened - 8. dispute_expired - 9. dispute_accepted - 10. dispute_cancelled - 11. dispute_challenged - 12. dispute_won - 13. dispute_lost - -<Info>Click [**here**](https://juspay-78.mintlify.app/api-reference/schemas/outgoing--webhook) to see the webhook payload your endpoint would need to parse for each of the above events</Info> - -- **Return a 2xx response:** Your server must return a successful 2xx response on successful receipt of webhooks. - -- **Retries:** In case of 3xx, 4xx, or 5xx response or no response from your endpoint for webhooks, Hyperswitch has a retry mechanism that tries sending the webhooks again up to 3 times before marking the event as failed. diff --git a/api-reference/mint.json b/api-reference/mint.json index 264f5366836..04b16682e3c 100644 --- a/api-reference/mint.json +++ b/api-reference/mint.json @@ -32,7 +32,6 @@ { "group": "Essentials", "pages": [ - "essentials/webhooks", "essentials/error_codes", "essentials/rate_limit", "essentials/go-live" @@ -52,8 +51,7 @@ "api-reference/payments/payments-link--retrieve", "api-reference/payments/payments--list", "api-reference/payments/payments--external-3ds-authentication", - "api-reference/payments/payments--complete-authorize", - "api-reference/payments/post-session-tokens" + "api-reference/payments/payments--complete-authorize" ] }, {
docs
remove redundant webhooks page (#6538)
f3897dd6b57318b681a2c5dc099d787aa8233f24
2024-11-19 21:54:12
Uzair Khan
feat(analytics): add `smart_retries` only metrics for analytics v2 dashboard (#6575)
false
diff --git a/crates/analytics/src/payments/accumulator.rs b/crates/analytics/src/payments/accumulator.rs index 5ca9fdf7516..291d7364071 100644 --- a/crates/analytics/src/payments/accumulator.rs +++ b/crates/analytics/src/payments/accumulator.rs @@ -76,8 +76,11 @@ pub struct PaymentsDistributionAccumulator { pub failed: u32, pub total: u32, pub success_without_retries: u32, + pub success_with_only_retries: u32, pub failed_without_retries: u32, + pub failed_with_only_retries: u32, pub total_without_retries: u32, + pub total_with_only_retries: u32, } pub trait PaymentMetricAccumulator { @@ -181,7 +184,14 @@ impl PaymentMetricAccumulator for SuccessRateAccumulator { } impl PaymentMetricAccumulator for PaymentsDistributionAccumulator { - type MetricOutput = (Option<f64>, Option<f64>, Option<f64>, Option<f64>); + type MetricOutput = ( + Option<f64>, + Option<f64>, + Option<f64>, + Option<f64>, + Option<f64>, + Option<f64>, + ); fn add_metrics_bucket(&mut self, metrics: &PaymentMetricRow) { if let Some(ref status) = metrics.status { @@ -193,6 +203,8 @@ impl PaymentMetricAccumulator for PaymentsDistributionAccumulator { self.success += success; if metrics.first_attempt.unwrap_or(false) { self.success_without_retries += success; + } else { + self.success_with_only_retries += success; } } } @@ -201,6 +213,8 @@ impl PaymentMetricAccumulator for PaymentsDistributionAccumulator { self.failed += failed; if metrics.first_attempt.unwrap_or(false) { self.failed_without_retries += failed; + } else { + self.failed_with_only_retries += failed; } } } @@ -208,6 +222,8 @@ impl PaymentMetricAccumulator for PaymentsDistributionAccumulator { self.total += total; if metrics.first_attempt.unwrap_or(false) { self.total_without_retries += total; + } else { + self.total_with_only_retries += total; } } } @@ -215,14 +231,17 @@ impl PaymentMetricAccumulator for PaymentsDistributionAccumulator { fn collect(self) -> Self::MetricOutput { if self.total == 0 { - (None, None, None, None) + (None, None, None, None, None, None) } else { let success = Some(self.success); let success_without_retries = Some(self.success_without_retries); + let success_with_only_retries = Some(self.success_with_only_retries); let failed = Some(self.failed); + let failed_with_only_retries = Some(self.failed_with_only_retries); let failed_without_retries = Some(self.failed_without_retries); let total = Some(self.total); let total_without_retries = Some(self.total_without_retries); + let total_with_only_retries = Some(self.total_with_only_retries); let success_rate = match (success, total) { (Some(s), Some(t)) if t > 0 => Some(f64::from(s) * 100.0 / f64::from(t)), @@ -235,6 +254,12 @@ impl PaymentMetricAccumulator for PaymentsDistributionAccumulator { _ => None, }; + let success_rate_with_only_retries = + match (success_with_only_retries, total_with_only_retries) { + (Some(s), Some(t)) if t > 0 => Some(f64::from(s) * 100.0 / f64::from(t)), + _ => None, + }; + let failed_rate = match (failed, total) { (Some(s), Some(t)) if t > 0 => Some(f64::from(s) * 100.0 / f64::from(t)), _ => None, @@ -245,11 +270,19 @@ impl PaymentMetricAccumulator for PaymentsDistributionAccumulator { (Some(s), Some(t)) if t > 0 => Some(f64::from(s) * 100.0 / f64::from(t)), _ => None, }; + + let failed_rate_with_only_retries = + match (failed_with_only_retries, total_with_only_retries) { + (Some(s), Some(t)) if t > 0 => Some(f64::from(s) * 100.0 / f64::from(t)), + _ => None, + }; ( success_rate, success_rate_without_retries, + success_rate_with_only_retries, failed_rate, failed_rate_without_retries, + failed_rate_with_only_retries, ) } } @@ -393,8 +426,10 @@ impl PaymentMetricsAccumulator { let ( payments_success_rate_distribution, payments_success_rate_distribution_without_smart_retries, + payments_success_rate_distribution_with_only_retries, payments_failure_rate_distribution, payments_failure_rate_distribution_without_smart_retries, + payments_failure_rate_distribution_with_only_retries, ) = self.payments_distribution.collect(); let (failure_reason_count, failure_reason_count_without_smart_retries) = self.failure_reasons_distribution.collect(); @@ -413,8 +448,10 @@ impl PaymentMetricsAccumulator { connector_success_rate: self.connector_success_rate.collect(), payments_success_rate_distribution, payments_success_rate_distribution_without_smart_retries, + payments_success_rate_distribution_with_only_retries, payments_failure_rate_distribution, payments_failure_rate_distribution_without_smart_retries, + payments_failure_rate_distribution_with_only_retries, failure_reason_count, failure_reason_count_without_smart_retries, payment_processed_amount_in_usd, diff --git a/crates/api_models/src/analytics/payments.rs b/crates/api_models/src/analytics/payments.rs index b34f8c9293c..1bade6b5ec8 100644 --- a/crates/api_models/src/analytics/payments.rs +++ b/crates/api_models/src/analytics/payments.rs @@ -283,8 +283,10 @@ pub struct PaymentMetricsBucketValue { pub connector_success_rate: Option<f64>, pub payments_success_rate_distribution: Option<f64>, pub payments_success_rate_distribution_without_smart_retries: Option<f64>, + pub payments_success_rate_distribution_with_only_retries: Option<f64>, pub payments_failure_rate_distribution: Option<f64>, pub payments_failure_rate_distribution_without_smart_retries: Option<f64>, + pub payments_failure_rate_distribution_with_only_retries: Option<f64>, pub failure_reason_count: Option<u64>, pub failure_reason_count_without_smart_retries: Option<u64>, }
feat
add `smart_retries` only metrics for analytics v2 dashboard (#6575)
d848b55a119e426f809b46bd9d30b356ecd7ba2a
2023-09-15 11:30:31
Hrithikesh
fix: make amount_capturable zero when payment intent status is processing (#2163)
false
diff --git a/crates/router/src/core/payments/operations/payment_response.rs b/crates/router/src/core/payments/operations/payment_response.rs index 454c748779e..3d91faf119d 100644 --- a/crates/router/src/core/payments/operations/payment_response.rs +++ b/crates/router/src/core/payments/operations/payment_response.rs @@ -18,7 +18,10 @@ use crate::{ services::RedirectForm, types::{ self, api, - storage::{self, enums, payment_attempt::PaymentAttemptExt}, + storage::{ + self, enums, + payment_attempt::{AttemptStatusExt, PaymentAttemptExt}, + }, transformers::ForeignTryFrom, CaptureSyncResponse, }, @@ -320,7 +323,11 @@ async fn payment_response_update_tracker<F: Clone, T: types::Capturable>( error_message: Some(Some(err.message)), error_code: Some(Some(err.code)), error_reason: Some(err.reason), - amount_capturable: if status.is_terminal_status() { + amount_capturable: if status.is_terminal_status() + || router_data + .status + .maps_to_intent_status(enums::IntentStatus::Processing) + { Some(0) } else { None @@ -432,7 +439,11 @@ async fn payment_response_update_tracker<F: Clone, T: types::Capturable>( error_message: error_status.clone(), error_reason: error_status, connector_response_reference_id, - amount_capturable: if router_data.status.is_terminal_status() { + amount_capturable: if router_data.status.is_terminal_status() + || router_data + .status + .maps_to_intent_status(enums::IntentStatus::Processing) + { Some(0) } else { None diff --git a/crates/router/src/types/storage/payment_attempt.rs b/crates/router/src/types/storage/payment_attempt.rs index 8b78be195ac..b1f53a285ef 100644 --- a/crates/router/src/types/storage/payment_attempt.rs +++ b/crates/router/src/types/storage/payment_attempt.rs @@ -69,6 +69,16 @@ impl PaymentAttemptExt for PaymentAttempt { } } +pub trait AttemptStatusExt { + fn maps_to_intent_status(self, intent_status: enums::IntentStatus) -> bool; +} + +impl AttemptStatusExt for enums::AttemptStatus { + fn maps_to_intent_status(self, intent_status: enums::IntentStatus) -> bool { + enums::IntentStatus::foreign_from(self) == intent_status + } +} + #[cfg(test)] #[cfg(feature = "dummy_connector")] mod tests {
fix
make amount_capturable zero when payment intent status is processing (#2163)
efa53204e8ab1ef1192bcdc07ed99306475badbc
2023-10-12 17:25:13
Panagiotis Ganelis
refactor(worldline): use `connector_request_reference_id` as reference to the connector (#2498)
false
diff --git a/crates/router/src/connector/worldline/transformers.rs b/crates/router/src/connector/worldline/transformers.rs index f1267c09766..d02ab60c8b9 100644 --- a/crates/router/src/connector/worldline/transformers.rs +++ b/crates/router/src/connector/worldline/transformers.rs @@ -40,11 +40,18 @@ pub struct AmountOfMoney { pub currency_code: String, } +#[derive(Default, Debug, Serialize, Eq, PartialEq)] +#[serde(rename_all = "camelCase")] +pub struct References { + pub merchant_reference: String, +} + #[derive(Default, Debug, Serialize, Eq, PartialEq)] #[serde(rename_all = "camelCase")] pub struct Order { pub amount_of_money: AmountOfMoney, pub customer: Customer, + pub references: References, } #[derive(Default, Debug, Serialize, Eq, PartialEq)] @@ -202,6 +209,9 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for PaymentsRequest { currency_code: item.request.currency.to_string().to_uppercase(), }, customer, + references: References { + merchant_reference: item.connector_request_reference_id.clone(), + }, }; let shipping = item
refactor
use `connector_request_reference_id` as reference to the connector (#2498)
19744cec1042f8b7c5cc496c3b4d201604aca204
2024-07-08 21:36:30
SamraatBansal
fix(connector): remove mandatory payment_method_type check in MIT (#5246)
false
diff --git a/crates/router/src/connector/adyen/transformers.rs b/crates/router/src/connector/adyen/transformers.rs index d320475e61c..d56ec571ac6 100644 --- a/crates/router/src/connector/adyen/transformers.rs +++ b/crates/router/src/connector/adyen/transformers.rs @@ -2528,16 +2528,14 @@ impl<'a> let browser_info = None; let additional_data = get_additional_data(item.router_data); let return_url = item.router_data.request.get_return_url()?; - let payment_method_type = item - .router_data - .request - .payment_method_type - .as_ref() - .ok_or(errors::ConnectorError::MissingPaymentMethodType)?; + let payment_method_type = item.router_data.request.payment_method_type; let payment_method = match mandate_ref_id { payments::MandateReferenceId::ConnectorMandateId(connector_mandate_ids) => { let adyen_mandate = AdyenMandate { - payment_type: PaymentType::try_from(payment_method_type)?, + payment_type: match payment_method_type { + Some(pm_type) => PaymentType::try_from(&pm_type)?, + None => PaymentType::Scheme, + }, stored_payment_method_id: Secret::new( connector_mandate_ids.get_connector_mandate_id()?, ),
fix
remove mandatory payment_method_type check in MIT (#5246)
74f6d0025e34c26dd0ff429baed0b90dd02edb64
2023-01-17 11:38:47
Sanchith Hegde
chore: fix typos and introduce ci check (#390)
false
diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 513d4a74cfb..55ac4615030 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -184,3 +184,13 @@ jobs: # - name: Run tests # shell: bash # run: cargo nextest run --all-features + + typos: + name: Spell check + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/[email protected] + + - name: Spell check + uses: crate-ci/typos@master diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 00000000000..25f1286adb7 --- /dev/null +++ b/.typos.toml @@ -0,0 +1,17 @@ +[default] +check-filename = true + +[default.extend-identifiers] +payment_vas = "payment_vas" +PaymentVas = "PaymentVas" + +[default.extend-words] +aci = "aci" # Name of a connector +encrypter = "encrypter" # Used by the `ring` crate +nin = "nin" # National identification number, a field used by PayU connector +substituters = "substituters" # Present in `flake.nix` + +[files] +extend-exclude = [ + "config/redis.conf", # `typos` also checked "AKE" in the file, which is present as a quoted string +] diff --git a/Dockerfile b/Dockerfile index d52495366da..a491f564558 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,7 +42,7 @@ ARG RUN_ENV=Sandbox # args for deciding the executable to export. three binaries: # 1. BINARY=router - for main application -# 2. BINARY=scheduler, SCHEDULER_FLOW=Consumer - part of proces tracker +# 2. BINARY=scheduler, SCHEDULER_FLOW=Consumer - part of process tracker # 3. BINARY=scheduler, SCHEDULER_FLOW=Producer - part of process tracker ARG BINARY=router ARG SCHEDULER_FLOW=Consumer diff --git a/INSTALL_dependencies.sh b/INSTALL_dependencies.sh index 87a8df85e4a..e13f2247805 100755 --- a/INSTALL_dependencies.sh +++ b/INSTALL_dependencies.sh @@ -188,7 +188,7 @@ if [[ ! -x "`command -v psql`" ]] || [[ ! -x "`command -v redis-server`" ]] ; th install_dep postgresql-contrib # not needed for macos? install_dep postgresql-devel # needed for diesel_cli in some linux distributions install_dep postgresql-libs # needed for diesel_cli in some linux distributions - init_start_postgres # installling libpq messes with initdb creating two copies. better to run it better libpq. + init_start_postgres # installing libpq messes with initdb creating two copies. better to run it better libpq. install_dep libpq-dev || install_dep libpq else print_info "Postgres found. skipping..." diff --git a/add_connector.md b/add_connector.md index 90837ce6ccf..e372fc0dc62 100644 --- a/add_connector.md +++ b/add_connector.md @@ -8,7 +8,7 @@ This is a guide to contributing new connector to Router. This guide includes ins - Understanding of the Connector APIs which you wish to integrate with Router - Setup of Router repository and running it on local -- Access to API credentials for testing the Connector API (you can quickly sign up for sandbox/uat credentials by visting the website of the connector you wish to integrate) +- Access to API credentials for testing the Connector API (you can quickly sign up for sandbox/uat credentials by visiting the website of the connector you wish to integrate) In Router, there are Connectors and Payment Methods, examples of both are shown below from which the difference is apparent. @@ -53,6 +53,7 @@ sh add_connector.sh <connector-name> For this tutorial `<connector-name>` would be `checkout`. The folder structure will be modified as below + ``` crates/router/src/connector ├── checkout @@ -76,7 +77,7 @@ The Connector module is implemented as a stateless module, so that you will not Lets add code in `transformers.rs` file. A little planning and designing is required for implementing the Requests and Responses of the connector, as it depends on the API spec of the connector. -For example, in case of checkout, the [request](https://api-reference.checkout.com/#tag/Payments) has a required parameter `currency` and few other required parameters in `source`. But the fields in “source” vary depending on the `source type`. An enum is needed to accomodate this in the Request type. You may need to add the serde tags to convert enum into json or url encoded based on your requirements. Here `serde(untagged)` is added to make the whole structure into the proper json acceptable to the connector. +For example, in case of checkout, the [request](https://api-reference.checkout.com/#tag/Payments) has a required parameter `currency` and few other required parameters in `source`. But the fields in “source” vary depending on the `source type`. An enum is needed to accommodate this in the Request type. You may need to add the serde tags to convert enum into json or url encoded based on your requirements. Here `serde(untagged)` is added to make the whole structure into the proper json acceptable to the connector. Now let's implement Request type for checkout @@ -277,17 +278,19 @@ And the below derive traits There is a trait bound to implement refunds, if you don't want to implement refunds you can mark them as `todo!()` but code panics when you initiate refunds then. Don’t forget to add logs lines in appropriate places. -Refer to other conector code for trait implementations. mostly tThe rust compiler will guide you to do it easily. +Refer to other connector code for trait implementations. mostly tThe rust compiler will guide you to do it easily. Feel free to connect with us in case of any queries and if you want to confirm the status mapping. ### **Test the connector** + Try running the tests in `crates/router/tests/connectors/{{connector-name}}.rs`. -All tests should pass and add appropiate tests for connector specific payment flows. +All tests should pass and add appropriate tests for connector specific payment flows. ### **Build payment request and response from json schema** + Some connectors will provide [json schema](https://developer.worldpay.com/docs/access-worldpay/api/references/payments) for each request and response supported. We can directly convert that schema to rust code by using below script. On running the script a `temp.rs` file will be created in `src/connector/<connector-name>` folder -*Note: The code generated may not be production ready and might fail for some case, we have to clean up the code as per our standards.* +_Note: The code generated may not be production ready and might fail for some case, we have to clean up the code as per our standards._ ```bash brew install openapi-generator @@ -297,33 +300,33 @@ openapi-generator generate -g rust -i ${SCHEMA_PATH} -o temp && cat temp/src/m ``` JSON example + ```json { - "openapi": "3.0.1", - "paths": {}, - "info": { - "title": "", - "version": "" - }, - "components": { - "schemas": { - "PaymentsResponse": { - "type": "object", - "properties": { - "outcome": { - "type": "string" - } - }, - "required": [ - "outcome" - ] - } - } + "openapi": "3.0.1", + "paths": {}, + "info": { + "title": "", + "version": "" + }, + "components": { + "schemas": { + "PaymentsResponse": { + "type": "object", + "properties": { + "outcome": { + "type": "string" + } + }, + "required": ["outcome"] + } } + } } ``` YAML example + ```yaml --- openapi: 3.0.1 @@ -334,10 +337,10 @@ info: components: schemas: PaymentsResponse: - type: object - properties: - outcome: - type: string - required: - - outcome + type: object + properties: + outcome: + type: string + required: + - outcome ``` diff --git a/architecture.md b/architecture.md deleted file mode 100644 index 55969704a78..00000000000 --- a/architecture.md +++ /dev/null @@ -1,2 +0,0 @@ - -![directory image](/docs/imgs/observability_arch.svg) \ No newline at end of file diff --git a/crates/common_utils/src/errors.rs b/crates/common_utils/src/errors.rs index 6069e1eb152..5ae75da347a 100644 --- a/crates/common_utils/src/errors.rs +++ b/crates/common_utils/src/errors.rs @@ -55,7 +55,7 @@ pub enum ValidationError { InvalidValue { message: String }, } -/// Cryptograpic algorithm errors +/// Cryptographic algorithm errors #[derive(Debug, thiserror::Error)] pub enum CryptoError { /// The cryptographic algorithm was unable to encode the message diff --git a/crates/common_utils/src/pii.rs b/crates/common_utils/src/pii.rs index 8ad1a7419b3..bf7c70bbbb2 100644 --- a/crates/common_utils/src/pii.rs +++ b/crates/common_utils/src/pii.rs @@ -213,7 +213,7 @@ mod pii_masking_strategy_tests { } #[test] - fn test_invalid_lient_secret_masking() { + fn test_invalid_client_secret_masking() { let secret: Secret<String, IpAddress> = Secret::new("pay_uszFB2QGe9MmLY65ojhT_secret".to_string()); assert_eq!("*** alloc::string::String ***", format!("{:?}", secret)); diff --git a/crates/drainer/src/lib.rs b/crates/drainer/src/lib.rs index 23db8e4bce2..a0f5afcb323 100644 --- a/crates/drainer/src/lib.rs +++ b/crates/drainer/src/lib.rs @@ -33,7 +33,7 @@ async fn drainer_handler( let drainer_result = drainer(store.clone(), max_read_count, stream_name.as_str()).await; if let Err(_e) = drainer_result { - //TODO: LOG ERRORs + //TODO: LOG errors } let flag_stream_name = utils::get_stream_key_flag(store.clone(), stream_index); diff --git a/crates/drainer/src/utils.rs b/crates/drainer/src/utils.rs index b0df588480c..506faa5467e 100644 --- a/crates/drainer/src/utils.rs +++ b/crates/drainer/src/utils.rs @@ -56,7 +56,7 @@ pub async fn trim_from_stream( .map_err(DrainerError::from) .into_report()?; - // Since xtrim deletes entires below given id excluding the given id. + // Since xtrim deletes entries below given id excluding the given id. // Hence, deleting the minimum entry id redis .stream_delete_entries(stream_name, minimum_entry_id) diff --git a/crates/router/src/connector/adyen/transformers.rs b/crates/router/src/connector/adyen/transformers.rs index b066bb191e5..cd0bf7ffd52 100644 --- a/crates/router/src/connector/adyen/transformers.rs +++ b/crates/router/src/connector/adyen/transformers.rs @@ -738,7 +738,7 @@ pub struct ErrorResponse { // use super::*; // #[test] -// fn verify_tranform_from_router_to_adyen_req() { +// fn verify_transform_from_router_to_adyen_req() { // let router_req = PaymentsRequest { // amount: 0.0, // currency: "None".to_string(), diff --git a/crates/router/src/connector/braintree.rs b/crates/router/src/connector/braintree.rs index 72a3a217163..ea50fb01d28 100644 --- a/crates/router/src/connector/braintree.rs +++ b/crates/router/src/connector/braintree.rs @@ -152,7 +152,7 @@ impl logger::debug!(payment_session_response_braintree=?res); let response: braintree::BraintreeSessionTokenResponse = res .response - .parse_struct("braintree SessionTokenReponse") + .parse_struct("braintree SessionTokenResponse") .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; types::RouterData::try_from(types::ResponseRouterData { response, diff --git a/crates/router/src/connector/globalpay/requests.rs b/crates/router/src/connector/globalpay/requests.rs index f955d0d822a..3ccd8ff7661 100644 --- a/crates/router/src/connector/globalpay/requests.rs +++ b/crates/router/src/connector/globalpay/requests.rs @@ -360,7 +360,7 @@ pub struct StoredCredential { pub model: Option<Model>, /// The reason stored credentials are being used to to create a transaction. pub reason: Option<Reason>, - /// Indiciates the order of this transaction in the sequence of a planned repeating + /// Indicates the order of this transaction in the sequence of a planned repeating /// transaction processing model. pub sequence: Option<Sequence>, } @@ -506,10 +506,10 @@ pub enum GlobalpayPaymentsRequestType { #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum Initiator { - /// The transaction was initated by the merchant, who is getting paid by the + /// The transaction was initiated by the merchant, who is getting paid by the /// payer.' Merchant, - /// The transaction was initated by the customer who is paying the merchant. + /// The transaction was initiated by the customer who is paying the merchant. Payer, } @@ -789,7 +789,7 @@ pub enum Reason { Resubmission, } -/// Indiciates the order of this transaction in the sequence of a planned repeating +/// Indicates the order of this transaction in the sequence of a planned repeating /// transaction processing model. #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "SCREAMING_SNAKE_CASE")] diff --git a/crates/router/src/connector/globalpay/response.rs b/crates/router/src/connector/globalpay/response.rs index 19574c4d508..32064add8a0 100644 --- a/crates/router/src/connector/globalpay/response.rs +++ b/crates/router/src/connector/globalpay/response.rs @@ -162,7 +162,7 @@ pub struct Bank { pub iban: Option<String>, /// The international identifier code for the bank. pub identifier_code: Option<String>, - /// The name assocaited with the bank account + /// The name associated with the bank account pub name: Option<String>, } diff --git a/crates/router/src/connector/payu/transformers.rs b/crates/router/src/connector/payu/transformers.rs index 1a526ef373d..dea2cd1a095 100644 --- a/crates/router/src/connector/payu/transformers.rs +++ b/crates/router/src/connector/payu/transformers.rs @@ -374,7 +374,8 @@ pub struct PayuOrderResponseBuyerData { phone: Option<String>, first_name: Option<String>, last_name: Option<String>, - nin: Option<String>, + #[serde(rename = "nin")] + national_identification_number: Option<String>, language: Option<String>, delivery: Option<String>, customer_id: Option<String>, diff --git a/crates/router/src/connector/stripe/transformers.rs b/crates/router/src/connector/stripe/transformers.rs index 9482ae25e79..928f573f99c 100644 --- a/crates/router/src/connector/stripe/transformers.rs +++ b/crates/router/src/connector/stripe/transformers.rs @@ -155,7 +155,7 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for PaymentIntentRequest { fn try_from(item: &types::PaymentsAuthorizeRouterData) -> Result<Self, Self::Error> { let metadata_order_id = item.payment_id.to_string(); let metadata_txn_id = format!("{}_{}_{}", item.merchant_id, item.payment_id, "1"); - let metadata_txn_uuid = Uuid::new_v4().to_string(); //Fetch autogenrated txn_uuid from Database. + let metadata_txn_uuid = Uuid::new_v4().to_string(); //Fetch autogenerated txn_uuid from Database. // let api::PaymentMethod::Card(a) = item.payment_method_data; // let api::PaymentMethod::Card(a) = item.payment_method_data; @@ -721,7 +721,7 @@ impl TryFrom<&types::PaymentsCaptureRouterData> for CaptureRequest { // use super::*; // #[test] -// fn verify_tranform_from_router_to_stripe_req() { +// fn verify_transform_from_router_to_stripe_req() { // let router_req = PaymentsRequest { // amount: 100.0, // currency: "USD".to_string(), diff --git a/crates/router/src/connector/worldline.rs b/crates/router/src/connector/worldline.rs index 50419ee2b9c..44985c578f8 100644 --- a/crates/router/src/connector/worldline.rs +++ b/crates/router/src/connector/worldline.rs @@ -141,10 +141,10 @@ impl ConnectorIntegration<api::Void, types::PaymentsCancelData, types::PaymentsR ) -> CustomResult<String, errors::ConnectorError> { let base_url = self.base_url(connectors); let auth: worldline::AuthType = worldline::AuthType::try_from(&req.connector_auth_type)?; - let merchat_account_id = auth.merchant_account_id; + let merchant_account_id = auth.merchant_account_id; let payment_id: &str = req.request.connector_transaction_id.as_ref(); Ok(format!( - "{base_url}v1/{merchat_account_id}/payments/{payment_id}/cancel" + "{base_url}v1/{merchant_account_id}/payments/{payment_id}/cancel" )) } @@ -222,9 +222,9 @@ impl ConnectorIntegration<api::PSync, types::PaymentsSyncData, types::PaymentsRe .change_context(errors::ConnectorError::MissingConnectorTransactionID)?; let base_url = self.base_url(connectors); let auth = worldline::AuthType::try_from(&req.connector_auth_type)?; - let merchat_account_id = auth.merchant_account_id; + let merchant_account_id = auth.merchant_account_id; Ok(format!( - "{base_url}v1/{merchat_account_id}/payments/{payment_id}" + "{base_url}v1/{merchant_account_id}/payments/{payment_id}" )) } @@ -329,8 +329,8 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P ) -> CustomResult<String, errors::ConnectorError> { let base_url = self.base_url(connectors); let auth = worldline::AuthType::try_from(&req.connector_auth_type)?; - let merchat_account_id = auth.merchant_account_id; - Ok(format!("{base_url}v1/{merchat_account_id}/payments")) + let merchant_account_id = auth.merchant_account_id; + Ok(format!("{base_url}v1/{merchant_account_id}/payments")) } fn get_request_body( @@ -436,9 +436,9 @@ impl ConnectorIntegration<api::Execute, types::RefundsData, types::RefundsRespon let payment_id = req.request.connector_transaction_id.clone(); let base_url = self.base_url(connectors); let auth = worldline::AuthType::try_from(&req.connector_auth_type)?; - let merchat_account_id = auth.merchant_account_id; + let merchant_account_id = auth.merchant_account_id; Ok(format!( - "{base_url}v1/{merchat_account_id}/payments/{payment_id}/refund" + "{base_url}v1/{merchant_account_id}/payments/{payment_id}/refund" )) } @@ -532,9 +532,9 @@ impl ConnectorIntegration<api::RSync, types::RefundsData, types::RefundsResponse .clone(); let base_url = self.base_url(connectors); let auth: worldline::AuthType = worldline::AuthType::try_from(&req.connector_auth_type)?; - let merchat_account_id = auth.merchant_account_id; + let merchant_account_id = auth.merchant_account_id; Ok(format!( - "{base_url}v1/{merchat_account_id}/refunds/{refund_id}/" + "{base_url}v1/{merchant_account_id}/refunds/{refund_id}/" )) } diff --git a/crates/router/src/core/errors.rs b/crates/router/src/core/errors.rs index f506f242dc9..d10a58175b9 100644 --- a/crates/router/src/core/errors.rs +++ b/crates/router/src/core/errors.rs @@ -300,15 +300,15 @@ pub enum ProcessTrackerError { NotImplemented, #[error("Job not found")] JobNotFound, - #[error("Recieved Error ApiResponseError: {0}")] + #[error("Received Error ApiResponseError: {0}")] EApiErrorResponse(error_stack::Report<ApiErrorResponse>), - #[error("Recieved Error StorageError: {0}")] + #[error("Received Error StorageError: {0}")] EStorageError(error_stack::Report<StorageError>), - #[error("Recieved Error RedisError: {0}")] + #[error("Received Error RedisError: {0}")] ERedisError(error_stack::Report<RedisError>), - #[error("Recieved Error ParsingError: {0}")] + #[error("Received Error ParsingError: {0}")] EParsingError(error_stack::Report<ParsingError>), - #[error("Validation Error Recieved: {0}")] + #[error("Validation Error Received: {0}")] EValidationError(error_stack::Report<ValidationError>), } diff --git a/crates/router/src/core/payments/flows/session_flow.rs b/crates/router/src/core/payments/flows/session_flow.rs index af6b96c8304..5c60719c98a 100644 --- a/crates/router/src/core/payments/flows/session_flow.rs +++ b/crates/router/src/core/payments/flows/session_flow.rs @@ -65,7 +65,7 @@ fn create_gpay_session_token( .parse_value::<payment_types::GpaySessionTokenData>("GpaySessionTokenData") .change_context(errors::ConnectorError::NoConnectorMetaData) .attach_printable(format!( - "cannnot parse gpay metadata from the given value {:?}", + "cannot parse gpay metadata from the given value {:?}", connector_metadata )) .change_context(errors::ApiErrorResponse::InvalidDataFormat { diff --git a/crates/router/tests/connectors/checkout.rs b/crates/router/tests/connectors/checkout.rs index 3e2cb72a8a7..ad83a494163 100644 --- a/crates/router/tests/connectors/checkout.rs +++ b/crates/router/tests/connectors/checkout.rs @@ -280,7 +280,7 @@ async fn test_checkout_refund_failure() { _ => panic!("Connector transaction id not found"), }; - // Higher amout than that of payment + // Higher amount than that of payment refund_request.request.refund_amount = 696969; let response = services::api::execute_connector_processing_step( &state, diff --git a/crates/router/tests/connectors/payu.rs b/crates/router/tests/connectors/payu.rs index ecfd0426e71..04bc5369298 100644 --- a/crates/router/tests/connectors/payu.rs +++ b/crates/router/tests/connectors/payu.rs @@ -32,7 +32,7 @@ impl utils::Connector for Payu { #[actix_web::test] async fn should_authorize_card_payment() { - //Authorize Card Payment in PLN currenct + //Authorize Card Payment in PLN currency let authorize_response = Payu {} .authorize_payment( Some(types::PaymentsAuthorizeData { @@ -42,7 +42,7 @@ async fn should_authorize_card_payment() { None, ) .await; - // in Payu need Psync to get status therfore set to pending + // in Payu need Psync to get status therefore set to pending assert_eq!(authorize_response.status, enums::AttemptStatus::Pending); if let Some(transaction_id) = utils::get_connector_transaction_id(authorize_response) { let sync_response = Payu {} diff --git a/crates/router_env/src/logger/formatter.rs b/crates/router_env/src/logger/formatter.rs index 17f4dea6ed1..13e12f628ef 100644 --- a/crates/router_env/src/logger/formatter.rs +++ b/crates/router_env/src/logger/formatter.rs @@ -137,7 +137,7 @@ where /// Constructor of `FormattingLayer`. /// /// A `name` will be attached to all records during formatting. - /// A `dst_writer` to forward all recrods. + /// A `dst_writer` to forward all records. /// /// ## Example /// ```rust @@ -357,7 +357,7 @@ where where S: Subscriber + for<'a> LookupSpan<'a>, { - // Get value of ket "message" or "target" if does not exist. + // Get value of kept "message" or "target" if does not exist. let mut message = storage .values .get("message") diff --git a/crates/router_env/src/logger/storage.rs b/crates/router_env/src/logger/storage.rs index 1438ca7e3a2..973ec8013b1 100644 --- a/crates/router_env/src/logger/storage.rs +++ b/crates/router_env/src/logger/storage.rs @@ -15,7 +15,7 @@ use tracing_subscriber::{layer::Context, Layer}; #[derive(Clone, Debug)] pub struct StorageSubscription; -/// Sotrage to store key value pairs of spans. +/// Storage to store key value pairs of spans. /// When new entry is crated it stores it in [HashMap] which is owned by `extensions`. #[derive(Clone, Debug)] pub struct Storage<'a> { diff --git a/docs/imgs/observability_arch.svg b/docs/imgs/observability_arch.svg deleted file mode 100644 index eaeebdc4c62..00000000000 --- a/docs/imgs/observability_arch.svg +++ /dev/null @@ -1,70 +0,0 @@ -<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 3048 2016" width="3048" height="2016" style="background-color: transparent;"><defs><style>@import url('https://fonts.googleapis.com/css2?family=Caveat+Brush&amp;family=Source+Code+Pro&amp;family=Source+Sans+Pro&amp;family=Crimson+Pro&amp;display=block');</style></defs><g text-align="center" text-anchor="middle" transform="translate(16.00, 432.00) rotate(0.00, 128.00, 48.00)"><g id="c6054c52-d788-4477-0adf-3c8189f023cb_svg" class="tl-centered-g"><path d="M256.76,65.84 Q256.95,75.00 257.04,80.78 T255.27,90.05 246.54,94.49 231.79,95.60 215.77,95.75 199.41,95.72 182.96,95.64 166.49,95.55 150.01,95.46 133.53,95.41 117.04,95.44 100.56,95.52 84.08,95.60 67.60,95.68 51.11,95.76 34.63,95.84 18.12,95.91 5.75,94.11 0.60,87.01 -0.52,75.86 -0.49,63.94 -0.33,51.84 -0.29,39.69 -0.33,27.53 -0.36,15.33 1.50,5.64 10.23,1.07 24.92,-0.11 40.87,-0.32 57.16,-0.34 73.53,-0.32 89.93,-0.28 106.34,-0.24 122.74,-0.25 139.15,-0.34 155.56,-0.47 171.96,-0.61 188.37,-0.74 204.77,-0.87 221.18,-1.01 237.61,-1.14 249.94,0.62 255.14,7.75 256.39,19.00 256.52,31.03 256.52,43.24 256.65,55.50 256.85,69.89 256.92,78.36 256.77,78.80 256.49,79.18 256.10,79.44 255.65,79.57 255.18,79.54 254.75,79.37 254.39,79.07 254.15,78.67 254.05,78.21 254.10,77.74 254.29,77.32 254.61,76.98 255.03,76.76 255.49,76.68 255.95,76.76 256.36,76.98 256.69,77.32 256.88,77.74 256.93,78.21 256.83,78.66 256.59,79.06 256.24,79.37 255.80,79.54 255.34,79.57 254.88,79.44 254.50,79.18 254.21,78.81 254.06,78.36 254.03,78.13 254.11,69.89 254.27,55.51 254.33,43.26 254.15,31.09 253.68,19.32 252.62,8.98 248.81,3.23 237.57,2.07 221.19,2.03 204.78,1.99 188.38,1.95 171.97,1.91 155.56,1.87 139.16,1.83 122.75,1.84 106.34,1.93 89.94,2.06 73.54,2.20 57.18,2.35 40.93,2.55 25.16,2.92 11.32,3.77 4.04,6.87 2.74,15.43 2.41,27.56 2.08,39.72 1.86,51.86 1.88,63.91 2.20,75.57 3.13,85.81 6.89,91.52 18.17,92.71 34.63,92.80 51.11,92.89 67.60,92.99 84.08,93.08 100.56,93.17 117.04,93.27 133.53,93.32 150.01,93.28 166.49,93.20 182.96,93.12 199.40,93.02 215.73,92.88 231.57,92.57 245.47,91.79 252.75,88.82 253.95,80.70 254.11,70.42 254.22,65.69 254.29,65.40 254.43,65.13 254.63,64.90 254.89,64.72 255.17,64.61 255.48,64.58 255.78,64.61 256.07,64.72 256.32,64.89 256.52,65.12 256.66,65.39 256.74,65.69 Z" fill="#1d1d1d" stroke="#1d1d1d" stroke-width="2" pointer-events="none"/></g><text font-size="28px" font-family="Caveat Brush" font-weight="normal" line-height="28px" letter-spacing="-0.03em" text-align="center" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="middle" transform="translate(44, 29)" fill="#1d1d1d" transform-origin="center center"><tspan y="14px" x="88">ORCA Application -</tspan></text></g><g id="ff402048-bc67-431f-22a6-6691d5a4d6cd_svg" class="tl-centered-g" transform="translate(1456.00, 112.00) rotate(0.00, 592.00, 128.00)"><g pointer-events="none" stroke="#1d1d1d" stroke-width="4.23" stroke-linecap="round"><line x1="2.11" y1="2.11" x2="1181.88" y2="2.11" stroke-dasharray="6.47 6.49" stroke-dashoffset="3.23"/><line x1="1181.88" y1="2.11" x2="1181.88" y2="253.88" stroke-dasharray="6.47 6.77" stroke-dashoffset="3.23"/><line x1="1181.88" y1="253.88" x2="2.11" y2="253.88" stroke-dasharray="6.47 6.49" stroke-dashoffset="3.23"/><line x1="2.11" y1="253.88" x2="2.11" y2="2.11" stroke-dasharray="6.47 6.77" stroke-dashoffset="3.23"/></g></g><text font-size="68.52584741710051px" font-family="Caveat Brush" font-weight="normal" line-height="68.52584741710051px" letter-spacing="-0.03em" text-align="left" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="start" fill="#1d1d1d" transform="translate(1616.00, 16.00) rotate(0.00, 381.50, 39.50)"><tspan y="34.262923708550254px" x="4">System/Developer specific Metrics -</tspan></text><g text-align="center" text-anchor="middle" transform="translate(752.00, 944.00) rotate(0.00, 128.00, 64.00)"><g id="64574d05-3416-46f5-1acd-9308c53448fa_svg" class="tl-centered-g"><path d="M87.26,0.11 Q99.46,0.18 107.11,0.21 T122.81,0.22 139.01,0.15 155.34,0.04 171.70,-0.07 188.07,-0.19 204.44,-0.30 220.81,-0.42 237.20,-0.53 249.53,1.28 254.75,10.16 256.05,25.26 256.25,41.68 256.32,58.45 256.53,75.32 256.81,92.21 257.08,109.13 255.36,121.79 246.67,127.11 231.97,128.42 215.98,128.61 199.66,128.57 183.25,128.47 166.83,128.36 150.39,128.25 133.96,128.17 117.52,128.19 101.08,128.24 84.65,128.30 68.21,128.36 51.77,128.41 35.33,128.47 18.87,128.52 6.51,126.67 1.32,117.82 0.15,102.83 0.08,86.52 0.15,69.87 0.09,53.13 -0.05,36.36 -0.19,19.56 1.62,6.99 10.31,1.68 24.96,0.31 40.89,0.07 57.14,0.05 73.48,0.09 89.84,0.15 106.21,0.21 122.58,0.22 138.95,0.15 158.13,0.03 169.31,0.00 169.68,0.13 169.99,0.36 170.20,0.68 170.31,1.06 170.29,1.45 170.14,1.81 169.89,2.10 169.56,2.30 169.18,2.39 168.80,2.35 168.44,2.18 168.16,1.92 167.98,1.57 167.91,1.19 167.98,0.81 168.16,0.46 168.44,0.20 168.79,0.03 169.18,-0.01 169.56,0.07 169.89,0.27 170.14,0.57 170.29,0.93 170.31,1.32 170.21,1.69 169.99,2.01 169.68,2.25 169.31,2.37 169.12,2.41 158.13,2.38 138.96,2.33 122.59,2.31 106.22,2.38 89.85,2.50 73.49,2.61 57.16,2.75 40.95,2.94 25.23,3.34 11.42,4.34 4.16,8.16 2.92,19.62 2.69,36.37 2.46,53.13 2.33,69.87 2.45,86.48 2.88,102.60 3.91,116.75 7.69,124.15 18.93,125.32 35.34,125.43 51.78,125.55 68.21,125.66 84.65,125.78 101.09,125.90 117.52,126.01 133.96,126.09 150.40,126.07 166.83,126.02 183.26,125.95 199.65,125.88 215.93,125.75 231.71,125.40 245.57,124.43 252.84,120.62 253.98,109.10 254.07,92.22 254.16,75.33 254.14,58.48 253.88,41.74 253.32,25.50 252.18,11.26 248.36,3.81 237.16,2.68 220.81,2.62 204.44,2.56 188.07,2.50 171.70,2.45 155.34,2.39 139.02,2.33 122.82,2.31 107.11,2.38 93.36,2.49 87.12,2.52 86.84,2.46 86.58,2.32 86.36,2.13 86.19,1.89 86.09,1.62 86.05,1.33 86.09,1.04 86.19,0.77 86.36,0.53 86.57,0.33 86.83,0.20 87.11,0.13 Z" fill="#36b24d" stroke="#36b24d" stroke-width="2" pointer-events="none"/></g><text font-size="28px" font-family="Caveat Brush" font-weight="normal" line-height="28px" letter-spacing="-0.03em" text-align="center" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="middle" transform="translate(55.5, 31)" fill="#36b24d" transform-origin="center center"><tspan y="14px" x="76.5">OpenTelemetry -</tspan><tspan y="42px" x="76.5"> -Collector -</tspan></text></g><g text-align="center" text-anchor="middle" transform="translate(1552.00, 176.00) rotate(0.00, 224.00, 64.00)"><g id="ffa3784a-ef18-4a24-06ca-730932bb513b_svg" class="tl-centered-g"><path d="M-0.14,38.85 Q-0.28,26.37 -0.34,18.51 T1.47,6.63 10.10,1.48 24.64,0.13 40.42,-0.13 56.53,-0.18 72.73,-0.17 88.94,-0.15 105.16,-0.12 121.39,-0.10 137.61,-0.07 153.83,-0.04 170.06,-0.02 186.28,0.01 202.51,0.04 218.73,0.04 234.95,-0.01 251.18,-0.08 267.40,-0.15 283.62,-0.22 299.85,-0.29 316.07,-0.36 332.30,-0.43 348.52,-0.50 364.74,-0.57 380.97,-0.64 397.19,-0.71 413.41,-0.78 429.66,-0.84 441.90,1.00 447.07,9.91 448.28,25.06 448.39,41.56 448.37,58.41 448.48,75.35 448.68,92.32 448.86,109.31 447.08,122.02 438.45,127.36 423.91,128.71 408.11,128.94 391.98,128.93 375.77,128.87 359.54,128.79 343.30,128.71 327.06,128.62 310.82,128.54 294.58,128.46 278.34,128.37 262.10,128.29 245.86,128.20 229.62,128.14 213.37,128.13 197.13,128.15 180.89,128.16 164.65,128.17 148.41,128.18 132.17,128.20 115.93,128.21 99.69,128.22 83.45,128.23 67.21,128.25 50.97,128.26 34.73,128.27 18.46,128.28 6.22,126.40 1.07,117.56 -0.09,102.59 -0.13,86.30 -0.05,69.68 -0.10,52.95 -0.22,33.34 -0.23,21.86 -0.08,21.42 0.21,21.05 0.60,20.79 1.05,20.67 1.51,20.69 1.95,20.87 2.30,21.17 2.54,21.57 2.64,22.03 2.59,22.50 2.39,22.92 2.07,23.26 1.65,23.47 1.19,23.55 0.73,23.47 0.32,23.25 -0.00,22.91 -0.20,22.48 -0.24,22.02 -0.14,21.56 0.10,21.16 0.46,20.86 0.89,20.69 1.36,20.67 1.81,20.79 2.20,21.06 2.48,21.43 2.63,21.88 2.66,22.11 2.53,33.35 2.27,52.96 2.13,69.67 2.24,86.27 2.64,102.37 3.66,116.49 7.40,123.89 18.52,125.04 34.73,125.12 50.97,125.20 67.22,125.28 83.46,125.37 99.70,125.45 115.94,125.53 132.18,125.62 148.42,125.70 164.66,125.79 180.90,125.87 197.14,125.95 213.38,126.04 229.62,126.10 245.86,126.11 262.10,126.10 278.34,126.08 294.58,126.07 310.82,126.06 327.06,126.05 343.30,126.03 359.54,126.02 375.77,126.00 391.97,125.97 408.05,125.88 423.64,125.58 437.34,124.65 444.55,120.85 445.75,109.27 445.93,92.32 446.11,75.35 446.19,58.42 446.02,41.61 445.55,25.30 444.49,10.98 440.72,3.52 429.62,2.40 413.42,2.38 397.19,2.35 380.97,2.33 364.75,2.30 348.52,2.27 332.30,2.25 316.07,2.22 299.85,2.19 283.63,2.17 267.40,2.14 251.18,2.12 234.96,2.09 218.73,2.09 202.51,2.13 186.28,2.20 170.06,2.27 153.84,2.34 137.61,2.41 121.39,2.48 105.17,2.55 88.95,2.62 72.73,2.70 56.55,2.79 40.48,2.93 24.90,3.27 11.22,4.19 4.01,7.81 2.76,18.57 2.53,32.62 2.39,39.02 2.32,39.31 2.18,39.58 1.97,39.81 1.72,39.98 1.43,40.09 1.13,40.13 0.83,40.09 0.54,39.98 0.29,39.80 0.09,39.57 -0.05,39.30 -0.13,39.01 Z" fill="#ff2133" stroke="#ff2133" stroke-width="2" pointer-events="none"/></g><text font-size="28px" font-family="Caveat Brush" font-weight="normal" line-height="28px" letter-spacing="-0.03em" text-align="center" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="middle" transform="translate(128.5, 45)" fill="#ff2133" transform-origin="center center"><tspan y="14px" x="99.5">Prometheus Metrics -</tspan></text></g><g text-align="center" text-anchor="middle" transform="translate(2192.00, 176.00) rotate(0.00, 192.00, 64.00)"><g id="0985b72e-2922-4cc4-2e6b-c4fceac419da_svg" class="tl-centered-g"><path d="M-0.95,39.10 Q-1.13,26.65 -1.21,18.81 T0.57,6.96 9.22,1.82 23.79,0.50 39.63,0.25 55.79,0.23 72.03,0.26 88.30,0.31 104.57,0.36 120.85,0.41 137.12,0.46 153.40,0.51 169.67,0.56 185.95,0.58 202.23,0.55 218.50,0.49 234.78,0.42 251.05,0.36 267.33,0.30 283.60,0.24 299.88,0.17 316.16,0.11 332.43,0.05 348.71,-0.01 365.01,-0.07 377.28,1.77 382.44,10.58 383.63,25.51 383.71,41.74 383.66,58.31 383.74,74.98 383.90,91.67 384.05,108.39 382.26,120.91 373.61,126.22 359.05,127.59 343.21,127.85 327.06,127.88 310.82,127.85 294.56,127.81 278.29,127.77 262.02,127.72 245.75,127.67 229.48,127.63 213.21,127.58 196.94,127.56 180.67,127.60 164.40,127.67 148.13,127.73 131.86,127.80 115.59,127.87 99.33,127.93 83.06,128.00 66.79,128.07 50.52,128.13 34.25,128.20 17.95,128.26 5.69,126.42 0.52,117.61 -0.69,102.67 -0.79,86.43 -0.76,69.84 -0.86,53.16 -1.04,33.60 -1.09,22.16 -0.94,21.71 -0.65,21.34 -0.27,21.08 0.18,20.95 0.65,20.98 1.09,21.15 1.44,21.45 1.68,21.86 1.78,22.31 1.73,22.78 1.54,23.20 1.21,23.54 0.80,23.76 0.34,23.83 -0.12,23.76 -0.54,23.54 -0.86,23.20 -1.05,22.78 -1.10,22.31 -1.00,21.85 -0.76,21.45 -0.40,21.15 0.03,20.98 0.50,20.95 0.95,21.08 1.33,21.34 1.62,21.71 1.77,22.16 1.80,22.39 1.70,33.60 1.51,53.16 1.43,69.83 1.58,86.38 2.04,102.44 3.10,116.53 6.87,123.90 18.00,125.03 34.25,125.07 50.51,125.12 66.78,125.16 83.05,125.21 99.32,125.26 115.59,125.30 131.86,125.35 148.13,125.40 164.40,125.44 180.67,125.49 196.94,125.51 213.21,125.47 229.48,125.40 245.75,125.33 262.02,125.27 278.29,125.20 294.55,125.13 310.81,125.06 327.04,124.98 343.15,124.83 358.77,124.48 372.50,123.52 379.72,119.74 380.95,108.33 381.16,91.66 381.37,74.97 381.48,58.32 381.34,41.78 380.90,25.74 379.86,11.66 376.10,4.29 364.96,3.16 348.71,3.12 332.43,3.07 316.16,3.02 299.88,2.96 283.61,2.91 267.33,2.86 251.05,2.81 234.78,2.76 218.50,2.71 202.23,2.66 185.95,2.64 169.68,2.67 153.40,2.74 137.12,2.80 120.85,2.86 104.57,2.92 88.30,2.99 72.03,3.06 55.80,3.14 39.68,3.27 24.05,3.61 10.33,4.53 3.10,8.13 1.89,18.87 1.70,32.88 1.59,39.25 1.51,39.55 1.37,39.82 1.17,40.05 0.92,40.22 0.63,40.33 0.33,40.37 0.02,40.33 -0.26,40.22 -0.51,40.05 -0.72,39.82 -0.86,39.55 -0.93,39.25 Z" fill="#7746f1" stroke="#7746f1" stroke-width="2" pointer-events="none"/></g><text font-size="28px" font-family="Caveat Brush" font-weight="normal" line-height="28px" letter-spacing="-0.03em" text-align="center" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="middle" transform="translate(149, 45)" fill="#7746f1" transform-origin="center center"><tspan y="14px" x="47">Grafana -</tspan></text></g><g text-align="center" text-anchor="middle" transform="translate(235.20, 528.00) rotate(0.00, 283.77, 200.00)"><g id="cb27c389-5497-4b15-152e-da060fd7be59_svg" class="tl-centered-g"><defs><mask id="cb27c389-5497-4b15-152e-da060fd7be59_clip"><rect x="-100" y="-100" width="767.55" height="600" fill="white"/><rect x="203.27" y="181" width="161" height="38" rx="4" ry="4" fill="black" opacity="1"/></mask></defs><g pointer-events="none" opacity="1" mask="url(#cb27c389-5497-4b15-152e-da060fd7be59_clip)"><path d="M0,0L567.55,400" fill="#1d1d1d" stroke="#1d1d1d" stroke-width="4.23" stroke-dasharray="none" stroke-dashoffset="none" stroke-linecap="round" stroke-linejoin="round" pointer-events="stroke"/><g><path d="M 560.83,385.4784246263368 L 567.55,400 551.61,398.5566762365858" fill="none" stroke="#1d1d1d" stroke-width="4.23" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/></g></g></g><text font-size="28px" font-family="Caveat Brush" font-weight="normal" line-height="28px" letter-spacing="-0.03em" text-align="left" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="start" transform="translate(203.26999999999998, 181)" fill="#1d1d1d" transform-origin="center center"><tspan y="14px" x="4">Metrics + Traces -</tspan></text></g><g text-align="center" text-anchor="middle" transform="translate(954.67, 320.00) rotate(0.00, 364.00, 312.00)"><g id="e050078f-e00c-4f00-0aed-22168941e365_svg" class="tl-centered-g"><defs><mask id="e050078f-e00c-4f00-0aed-22168941e365_clip"><rect x="-100" y="-100" width="928.00" height="824" fill="white"/><rect x="262.40" y="220.55" width="79" height="38" rx="4" ry="4" fill="black" opacity="1"/></mask></defs><g pointer-events="none" opacity="1" mask="url(#e050078f-e00c-4f00-0aed-22168941e365_clip)"><path d="M 0 624 A 1252.04 1252.04 0 0 1 728 0" fill="none" stroke="#1d1d1d" stroke-width="4.23" stroke-dasharray="none" stroke-dashoffset="none" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/><g><path d="M 712.33,-3.2408659849990324 L 728,0 717.35,11.948744976355366" fill="none" stroke="#1d1d1d" stroke-width="4.23" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/></g></g></g><text font-size="28px" font-family="Caveat Brush" font-weight="normal" line-height="28px" letter-spacing="-0.03em" text-align="left" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="start" transform="translate(262.4, 220.55)" fill="#1d1d1d" transform-origin="center center"><tspan y="14px" x="4">Metrics -</tspan></text></g><g id="94d26c52-3886-4fa7-2ce9-4d15cd51c6dd_svg" class="tl-centered-g" transform="translate(2000.00, 240.00) rotate(0.00, 88.00, 0.50)"><defs><mask id="94d26c52-3886-4fa7-2ce9-4d15cd51c6dd_clip"><rect x="-100" y="-100" width="376" height="201" fill="white"/><rect x="88" y="0" width="0" height="0" rx="4" ry="4" fill="black" opacity="1"/></mask></defs><g pointer-events="none" opacity="1" mask=""><path d="M0,0L176,0" fill="#1d1d1d" stroke="#1d1d1d" stroke-width="4.23" stroke-dasharray="none" stroke-dashoffset="none" stroke-linecap="round" stroke-linejoin="round" pointer-events="stroke"/><g><path d="M 162.14,-7.999999999999999 L 176,0 162.14,7.999999999999999" fill="none" stroke="#1d1d1d" stroke-width="4.23" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/></g></g></g><g id="0e29a261-bfe4-4854-30d6-98378d12077f_svg" class="tl-centered-g" transform="translate(1456.00, 496.00) rotate(0.00, 592.00, 128.00)"><g pointer-events="none" stroke="#1d1d1d" stroke-width="4.23" stroke-linecap="round"><line x1="2.11" y1="2.11" x2="1181.88" y2="2.11" stroke-dasharray="6.47 6.49" stroke-dashoffset="3.23"/><line x1="1181.88" y1="2.11" x2="1181.88" y2="253.88" stroke-dasharray="6.47 6.77" stroke-dashoffset="3.23"/><line x1="1181.88" y1="253.88" x2="2.11" y2="253.88" stroke-dasharray="6.47 6.49" stroke-dashoffset="3.23"/><line x1="2.11" y1="253.88" x2="2.11" y2="2.11" stroke-dasharray="6.47 6.77" stroke-dashoffset="3.23"/></g></g><g text-align="center" text-anchor="middle" transform="translate(496.00, 528.00) rotate(0.00, 128.00, 64.00)"><g id="e9a575d4-e939-4a0f-35cd-13dfa4d343cc_svg" class="tl-centered-g"><path d="M168.53,127.92 Q156.30,127.90 148.63,127.90 T132.89,127.94 116.65,128.07 100.29,128.25 83.89,128.43 67.48,128.60 51.07,128.78 34.66,128.96 18.23,129.13 5.87,127.34 0.73,118.47 -0.35,103.40 -0.30,86.99 -0.11,70.23 -0.06,53.38 -0.08,36.50 -0.10,19.59 1.78,6.95 10.50,1.64 25.17,0.30 41.13,0.09 57.41,0.11 73.77,0.18 90.16,0.27 106.55,0.36 122.95,0.41 139.34,0.37 155.74,0.29 172.14,0.21 188.53,0.13 204.93,0.05 221.32,-0.03 237.74,-0.11 250.09,1.73 255.23,10.54 256.33,25.45 256.32,41.66 256.16,58.22 256.14,74.86 256.19,91.54 256.24,108.24 254.38,120.75 245.67,126.06 230.98,127.47 215.01,127.78 198.72,127.86 182.34,127.88 165.94,127.89 149.53,127.89 133.12,127.94 116.71,128.07 97.49,128.26 86.29,128.34 85.92,128.22 85.61,127.98 85.39,127.66 85.28,127.29 85.30,126.90 85.44,126.54 85.69,126.24 86.02,126.04 86.40,125.95 86.79,125.99 87.14,126.15 87.43,126.42 87.61,126.76 87.67,127.15 87.61,127.53 87.43,127.87 87.15,128.14 86.80,128.31 86.41,128.35 86.03,128.27 85.70,128.07 85.45,127.78 85.30,127.42 85.28,127.03 85.38,126.65 85.60,126.33 85.91,126.09 86.27,125.97 86.47,125.94 97.48,125.92 116.70,125.90 133.11,125.85 149.52,125.72 165.92,125.54 182.32,125.36 198.69,125.16 214.94,124.91 230.70,124.45 244.54,123.40 251.84,119.57 253.13,108.17 253.45,91.52 253.77,74.85 253.98,58.21 253.94,41.69 253.60,25.67 252.65,11.60 248.90,4.24 237.69,3.09 221.32,3.01 204.93,2.91 188.53,2.82 172.13,2.73 155.74,2.64 139.34,2.54 122.95,2.49 106.55,2.53 90.16,2.61 73.77,2.70 57.42,2.80 41.18,2.96 25.44,3.33 11.61,4.31 4.31,8.14 3.01,19.67 2.66,36.53 2.31,53.40 2.07,70.24 2.07,86.96 2.39,103.19 3.32,117.43 7.05,124.84 18.26,125.92 34.65,125.92 51.06,125.91 67.47,125.91 83.87,125.91 100.27,125.90 116.64,125.90 132.88,125.85 148.62,125.72 162.40,125.56 168.66,125.50 168.94,125.57 169.20,125.70 169.42,125.90 169.59,126.13 169.69,126.41 169.73,126.69 169.70,126.98 169.59,127.26 169.43,127.50 169.21,127.69 168.96,127.83 168.67,127.90 Z" fill="#36b24d" stroke="#36b24d" stroke-width="2" pointer-events="none"/></g><text font-size="28px" font-family="Caveat Brush" font-weight="normal" line-height="28px" letter-spacing="-0.03em" text-align="center" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="middle" transform="translate(84, 45)" fill="#36b24d" transform-origin="center center"><tspan y="14px" x="48">Promtail -</tspan></text></g><g text-align="center" text-anchor="middle" transform="translate(1584.00, 560.00) rotate(0.00, 208.00, 64.00)"><g id="0b9ab56b-afdc-4620-293d-737b46034732_svg" class="tl-centered-g"><path d="M329.54,129.13 Q317.42,129.07 309.82,129.05 T294.22,128.99 278.13,128.94 261.92,128.89 245.67,128.84 229.41,128.78 213.15,128.76 196.89,128.78 180.63,128.83 164.37,128.88 148.11,128.94 131.85,128.99 115.59,129.04 99.33,129.09 83.07,129.14 66.81,129.19 50.55,129.24 34.29,129.29 18.00,129.34 5.74,127.48 0.62,118.53 -0.49,103.30 -0.47,86.72 -0.33,69.79 -0.31,52.76 -0.37,35.70 -0.43,18.62 1.43,5.87 10.08,0.51 24.64,-0.86 40.45,-1.09 56.59,-1.10 72.80,-1.05 89.05,-0.98 105.29,-0.91 121.54,-0.84 137.79,-0.77 154.04,-0.69 170.28,-0.62 186.53,-0.55 202.78,-0.50 219.03,-0.51 235.28,-0.54 251.53,-0.57 267.78,-0.61 284.02,-0.64 300.27,-0.67 316.52,-0.70 332.77,-0.74 349.02,-0.77 365.27,-0.80 381.52,-0.83 397.79,-0.86 410.04,1.01 415.18,9.94 416.32,25.11 416.34,41.63 416.24,58.49 416.26,75.45 416.37,92.44 416.46,109.46 414.63,122.17 405.99,127.52 391.42,128.90 375.60,129.16 359.45,129.18 343.22,129.15 326.97,129.10 310.71,129.05 294.45,128.99 278.19,128.94 261.93,128.89 245.67,128.84 229.41,128.78 213.15,128.76 196.89,128.78 177.85,128.83 166.75,128.83 166.41,128.71 166.12,128.50 165.92,128.20 165.83,127.85 165.84,127.49 165.98,127.15 166.21,126.88 166.52,126.69 166.87,126.61 167.23,126.65 167.56,126.81 167.82,127.05 167.99,127.37 168.05,127.73 167.99,128.08 167.82,128.40 167.56,128.65 167.23,128.80 166.87,128.84 166.52,128.76 166.21,128.58 165.98,128.30 165.84,127.97 165.83,127.61 165.92,127.26 166.12,126.96 166.41,126.74 166.75,126.63 166.93,126.60 177.85,126.62 196.89,126.68 213.15,126.70 229.41,126.68 245.67,126.63 261.93,126.58 278.19,126.53 294.45,126.47 310.71,126.42 326.97,126.37 343.22,126.31 359.44,126.24 375.54,126.12 391.15,125.78 404.87,124.82 412.10,120.99 413.36,109.40 413.63,92.43 413.89,75.44 414.05,58.49 413.97,41.66 413.59,25.33 412.59,11.00 408.86,3.52 397.74,2.38 381.51,2.31 365.26,2.24 349.02,2.17 332.77,2.10 316.52,2.02 300.27,1.95 284.02,1.88 267.77,1.81 251.52,1.74 235.28,1.67 219.03,1.59 202.78,1.55 186.53,1.55 170.28,1.59 154.03,1.62 137.79,1.65 121.54,1.68 105.29,1.72 89.04,1.75 72.80,1.79 56.60,1.84 40.51,1.95 24.91,2.27 11.20,3.21 3.96,7.04 2.68,18.69 2.37,35.72 2.06,52.77 1.86,69.79 1.90,86.69 2.24,103.09 3.20,117.48 6.93,124.98 18.05,126.10 34.29,126.15 50.55,126.20 66.81,126.26 83.07,126.31 99.33,126.36 115.59,126.41 131.85,126.47 148.11,126.52 164.37,126.57 180.63,126.63 196.89,126.68 213.15,126.70 229.41,126.68 245.67,126.63 261.92,126.58 278.13,126.53 294.22,126.47 309.82,126.42 323.48,126.37 329.70,126.37 330.03,126.45 330.32,126.60 330.57,126.82 330.76,127.10 330.88,127.41 330.92,127.74 330.88,128.07 330.76,128.38 330.57,128.65 330.32,128.87 330.03,129.03 329.70,129.11 Z" fill="#ff2133" stroke="#ff2133" stroke-width="2" pointer-events="none"/></g><text font-size="28px" font-family="Caveat Brush" font-weight="normal" line-height="28px" letter-spacing="-0.03em" text-align="center" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="middle" transform="translate(185, 45)" fill="#ff2133" transform-origin="center center"><tspan y="14px" x="27">Loki -</tspan></text></g><g text-align="center" text-anchor="middle" transform="translate(2192.00, 560.00) rotate(0.00, 192.00, 64.00)"><g id="a66be7bd-3db7-4020-347a-39cb1ce8aa8d_svg" class="tl-centered-g"><path d="M298.15,128.01 Q286.01,128.00 278.38,128.00 T262.74,128.00 246.61,128.00 230.35,128.01 214.05,128.01 197.75,128.04 181.44,128.13 165.14,128.25 148.83,128.37 132.53,128.48 116.22,128.60 99.92,128.72 83.61,128.84 67.31,128.95 51.00,129.07 34.70,129.19 18.37,129.30 6.08,127.49 0.92,118.56 -0.23,103.38 -0.28,86.85 -0.19,69.96 -0.23,52.99 -0.34,35.98 -0.45,18.95 1.37,6.22 10.00,0.88 24.53,-0.49 40.33,-0.72 56.44,-0.73 72.64,-0.68 88.86,-0.61 105.09,-0.54 121.32,-0.47 137.54,-0.40 153.77,-0.32 170.00,-0.25 186.23,-0.21 202.45,-0.22 218.68,-0.26 234.91,-0.30 251.14,-0.35 267.37,-0.39 283.59,-0.43 299.82,-0.47 316.05,-0.51 332.28,-0.55 348.51,-0.59 364.76,-0.63 376.99,1.22 382.22,10.05 383.59,25.03 383.88,41.33 384.04,57.96 384.34,74.69 384.71,91.44 385.07,108.23 383.41,120.80 374.79,126.15 360.21,127.57 344.34,127.88 328.15,127.96 311.88,127.98 295.58,127.99 279.28,127.99 262.97,128.00 246.67,128.00 230.36,128.01 214.05,128.01 197.75,128.04 181.44,128.13 162.35,128.26 151.22,128.30 150.88,128.18 150.59,127.97 150.38,127.66 150.28,127.31 150.30,126.95 150.43,126.61 150.67,126.33 150.98,126.14 151.34,126.06 151.70,126.10 152.03,126.25 152.30,126.50 152.47,126.82 152.53,127.18 152.47,127.54 152.30,127.87 152.04,128.12 151.71,128.27 151.34,128.31 150.99,128.24 150.67,128.05 150.44,127.77 150.30,127.43 150.28,127.07 150.38,126.72 150.58,126.42 150.87,126.19 151.21,126.08 151.40,126.05 162.34,126.03 181.44,126.02 197.74,125.99 214.05,125.90 230.35,125.78 246.66,125.66 262.96,125.55 279.27,125.43 295.57,125.31 311.86,125.19 328.13,125.05 344.27,124.86 359.93,124.46 373.67,123.45 380.88,119.65 381.97,108.21 381.97,91.48 381.97,74.72 381.86,58.00 381.51,41.40 380.87,25.29 379.66,11.16 375.82,3.76 364.71,2.60 348.50,2.54 332.28,2.47 316.05,2.39 299.82,2.32 283.59,2.25 267.36,2.18 251.14,2.11 234.91,2.03 218.68,1.96 202.45,1.89 186.22,1.85 170.00,1.86 153.77,1.90 137.54,1.94 121.31,1.98 105.09,2.03 88.86,2.07 72.64,2.11 56.46,2.17 40.39,2.29 24.81,2.62 11.12,3.57 3.90,7.40 2.65,19.01 2.40,35.99 2.15,52.99 2.00,69.96 2.09,86.81 2.50,103.16 3.51,117.50 7.25,124.98 18.40,126.07 34.69,126.06 50.99,126.05 67.30,126.05 83.60,126.04 99.91,126.04 116.21,126.04 132.52,126.03 148.82,126.03 165.13,126.02 181.44,126.02 197.74,125.99 214.04,125.90 230.34,125.78 246.60,125.66 262.73,125.55 278.37,125.43 292.07,125.33 298.31,125.29 298.63,125.37 298.92,125.52 299.16,125.74 299.35,126.01 299.47,126.31 299.51,126.64 299.47,126.96 299.35,127.27 299.17,127.54 298.92,127.76 298.64,127.91 298.32,127.99 Z" fill="#7746f1" stroke="#7746f1" stroke-width="2" pointer-events="none"/></g><text font-size="28px" font-family="Caveat Brush" font-weight="normal" line-height="28px" letter-spacing="-0.03em" text-align="center" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="middle" transform="translate(149, 45)" fill="#7746f1" transform-origin="center center"><tspan y="14px" x="47">Grafana -</tspan></text></g><g text-align="center" text-anchor="middle" transform="translate(272.00, 490.16) rotate(0.00, 104.00, 44.07)"><g id="49d36352-0907-4b69-1b2a-0660f843c953_svg" class="tl-centered-g"><defs><mask id="49d36352-0907-4b69-1b2a-0660f843c953_clip"><rect x="-100" y="-100" width="408" height="288.14" fill="white"/><rect x="81.5" y="25.07" width="45" height="38" rx="4" ry="4" fill="black" opacity="1"/></mask></defs><g pointer-events="none" opacity="1" mask="url(#49d36352-0907-4b69-1b2a-0660f843c953_clip)"><path d="M0.39,-0.92 Q51.91,20.97 77.67,31.92 T129.19,53.79 180.72,75.66 206.60,86.66 206.80,86.84 206.93,87.07 206.98,87.33 206.95,87.60 206.83,87.84 206.64,88.03 206.40,88.15 206.14,88.18 205.88,88.13 205.65,88.00 205.47,87.81 205.36,87.56 205.34,87.30 205.40,87.04 205.54,86.81 205.75,86.64 206.00,86.55 206.27,86.54 206.52,86.62 206.74,86.77 206.89,86.99 206.97,87.24 206.97,87.51 206.88,87.76 206.71,87.97 206.49,88.12 206.23,88.18 205.96,88.16 205.83,88.13 180.06,77.22 128.51,55.41 76.95,33.60 25.39,11.81 -0.50,0.86 -0.69,0.72 -0.84,0.53 -0.94,0.32 -0.99,0.08 -0.98,-0.16 -0.92,-0.39 -0.80,-0.60 -0.63,-0.77 -0.43,-0.90 -0.20,-0.98 0.04,-0.99 0.28,-0.96 Z" fill="#1d1d1d" stroke="#1d1d1d" stroke-width="2.11" stroke-dasharray="none" stroke-dashoffset="none" stroke-linecap="round" stroke-linejoin="round" pointer-events="stroke"/><g><path d="M 198.36,75.36774954285242 L 208,88.14 192.12,90.09966494940936" fill="none" stroke="#1d1d1d" stroke-width="4.23" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/></g></g></g><text font-size="28px" font-family="Caveat Brush" font-weight="normal" line-height="28px" letter-spacing="-0.03em" text-align="left" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="start" transform="translate(81.5, 25.07)" fill="#1d1d1d" transform-origin="center center"><tspan y="14px" x="4">logs -</tspan></text></g><g id="f345775e-659e-45b5-2ef7-39bd0f577538_svg" class="tl-centered-g" transform="translate(660.03, 656.00) rotate(0.00, 76.57, 136.00)"><defs><mask id="f345775e-659e-45b5-2ef7-39bd0f577538_clip"><rect x="-100" y="-100" width="353.14" height="472" fill="white"/><rect x="76.57" y="136" width="0" height="0" rx="4" ry="4" fill="black" opacity="1"/></mask></defs><g pointer-events="none" opacity="1" mask=""><path d="M0.82,-0.46 Q38.80,67.14 57.80,100.93 T95.80,168.52 133.81,236.10 152.86,270.00 152.90,270.24 152.87,270.48 152.76,270.69 152.59,270.86 152.38,270.97 152.14,271.00 151.90,270.95 151.69,270.83 151.53,270.66 151.44,270.43 151.42,270.20 151.48,269.96 151.61,269.76 151.80,269.61 152.02,269.53 152.26,269.52 152.49,269.59 152.68,269.73 152.82,269.93 152.89,270.16 152.89,270.40 152.80,270.62 152.65,270.81 152.45,270.94 152.22,271.00 151.98,270.98 151.76,270.88 151.58,270.72 151.50,270.63 132.47,236.85 94.40,169.30 56.32,101.76 18.23,34.23 -0.86,0.36 -0.92,0.14 -0.93,-0.09 -0.88,-0.31 -0.79,-0.51 -0.64,-0.68 -0.46,-0.82 -0.25,-0.90 -0.03,-0.94 0.20,-0.91 0.41,-0.84 0.60,-0.72 0.75,-0.55 Z" fill="#1d1d1d" stroke="#1d1d1d" stroke-width="2.11" stroke-dasharray="none" stroke-dashoffset="none" stroke-linecap="round" stroke-linejoin="round" pointer-events="stroke"/><g><path d="M 153.31,256.0009362944967 L 153.14,272 139.37,263.85056681158073" fill="none" stroke="#1d1d1d" stroke-width="4.23" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/></g></g></g><g id="670563a3-2c47-4438-1a8a-86b5c9626a87_svg" class="tl-centered-g" transform="translate(2000.00, 624.00) rotate(0.00, 88.00, 0.50)"><defs><mask id="670563a3-2c47-4438-1a8a-86b5c9626a87_clip"><rect x="-100" y="-100" width="376" height="201" fill="white"/><rect x="88" y="0" width="0" height="0" rx="4" ry="4" fill="black" opacity="1"/></mask></defs><g pointer-events="none" opacity="1" mask=""><path d="M0.00,-0.98 Q43.50,-0.91 65.25,-0.89 T108.75,-0.85 152.25,-0.82 174.13,-0.78 174.37,-0.70 174.58,-0.55 174.72,-0.33 174.79,-0.09 174.77,0.17 174.68,0.41 174.51,0.60 174.29,0.74 174.04,0.79 173.79,0.76 173.56,0.66 173.37,0.48 173.25,0.25 173.21,-0.00 173.25,-0.25 173.37,-0.48 173.56,-0.66 173.79,-0.76 174.04,-0.79 174.29,-0.74 174.51,-0.60 174.68,-0.41 174.77,-0.17 174.79,0.09 174.72,0.33 174.58,0.55 174.37,0.70 174.13,0.78 174.00,0.80 152.25,0.82 108.75,0.85 65.25,0.89 21.75,0.95 -0.12,0.97 -0.34,0.91 -0.55,0.80 -0.73,0.64 -0.86,0.45 -0.94,0.23 -0.97,-0.00 -0.94,-0.23 -0.86,-0.45 -0.73,-0.64 -0.55,-0.80 -0.34,-0.91 -0.12,-0.97 Z" fill="#1d1d1d" stroke="#1d1d1d" stroke-width="2.11" stroke-dasharray="none" stroke-dashoffset="none" stroke-linecap="round" stroke-linejoin="round" pointer-events="stroke"/><g><path d="M 162.14,-7.999999999999999 L 176,0 162.14,7.999999999999999" fill="none" stroke="#1d1d1d" stroke-width="4.23" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/></g></g></g><text font-size="68.52584741710051px" font-family="Caveat Brush" font-weight="normal" line-height="68.52584741710051px" letter-spacing="-0.03em" text-align="left" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="start" fill="#1d1d1d" transform="translate(1584.00, 400.00) rotate(0.00, 220.00, 39.50)"><tspan y="34.262923708550254px" x="4">Application Logging -</tspan></text><g id="14c489f0-1beb-4f10-2006-41dcfb955c24_svg" class="tl-centered-g" transform="translate(1200.00, 880.00) rotate(0.00, 720.00, 240.00)"><g pointer-events="none" stroke="#1d1d1d" stroke-width="4.23" stroke-linecap="round"><line x1="2.11" y1="2.11" x2="1437.88" y2="2.11" stroke-dasharray="6.47 6.58" stroke-dashoffset="3.23"/><line x1="1437.88" y1="2.11" x2="1437.88" y2="477.88" stroke-dasharray="6.47 6.74" stroke-dashoffset="3.23"/><line x1="1437.88" y1="477.88" x2="2.11" y2="477.88" stroke-dasharray="6.47 6.58" stroke-dashoffset="3.23"/><line x1="2.11" y1="477.88" x2="2.11" y2="2.11" stroke-dasharray="6.47 6.74" stroke-dashoffset="3.23"/></g></g><g text-align="center" text-anchor="middle" transform="translate(1584.00, 944.00) rotate(0.00, 208.00, 64.00)"><g id="30344a64-05a4-4091-065f-efc855077046_svg" class="tl-centered-g"><path d="M-0.73,38.88 Q-0.98,26.31 -1.11,18.40 T0.62,6.44 9.24,1.28 23.80,-0.07 39.62,-0.32 55.76,-0.36 72.00,-0.34 88.25,-0.30 104.51,-0.27 120.77,-0.23 137.03,-0.19 153.29,-0.15 169.55,-0.12 185.82,-0.08 202.08,-0.07 218.34,-0.11 234.60,-0.17 250.86,-0.24 267.12,-0.31 283.38,-0.37 299.65,-0.44 315.91,-0.50 332.17,-0.57 348.43,-0.64 364.69,-0.70 380.95,-0.77 397.24,-0.83 409.50,1.01 414.66,9.92 415.84,25.06 415.92,41.53 415.86,58.36 415.94,75.28 416.09,92.22 416.24,109.19 414.44,121.88 405.81,127.23 391.28,128.60 375.48,128.85 359.37,128.86 343.17,128.82 326.95,128.77 310.73,128.71 294.50,128.65 278.27,128.59 262.05,128.53 245.82,128.47 229.59,128.41 213.37,128.37 197.14,128.39 180.91,128.43 164.68,128.48 148.46,128.52 132.23,128.57 116.00,128.61 99.77,128.65 83.55,128.70 67.32,128.74 51.09,128.78 34.86,128.83 18.61,128.87 6.38,127.02 1.18,118.14 -0.11,103.07 -0.30,86.67 -0.37,69.92 -0.56,53.08 -0.85,33.33 -0.97,21.78 -0.82,21.33 -0.54,20.96 -0.15,20.70 0.30,20.57 0.76,20.59 1.20,20.76 1.56,21.06 1.80,21.46 1.90,21.92 1.85,22.38 1.66,22.81 1.34,23.15 0.93,23.37 0.47,23.45 0.01,23.38 -0.41,23.16 -0.73,22.82 -0.93,22.40 -0.98,21.93 -0.88,21.48 -0.65,21.07 -0.29,20.77 0.14,20.59 0.61,20.57 1.06,20.69 1.45,20.95 1.73,21.32 1.89,21.76 1.92,22.00 1.89,33.32 1.81,53.07 1.82,69.90 2.07,86.61 2.62,102.82 3.75,117.05 7.55,124.49 18.66,125.63 34.87,125.68 51.09,125.74 67.32,125.80 83.55,125.86 99.78,125.92 116.00,125.99 132.23,126.05 148.46,126.11 164.68,126.17 180.91,126.23 197.14,126.29 213.37,126.32 229.59,126.30 245.82,126.26 262.05,126.22 278.28,126.17 294.50,126.13 310.73,126.08 326.95,126.04 343.17,125.99 359.36,125.93 375.43,125.81 391.00,125.47 404.69,124.52 411.91,120.71 413.13,109.14 413.35,92.22 413.57,75.27 413.68,58.36 413.55,41.57 413.11,25.28 412.08,10.99 408.32,3.53 397.19,2.41 380.96,2.37 364.69,2.34 348.43,2.30 332.17,2.26 315.91,2.22 299.65,2.19 283.39,2.15 267.13,2.11 250.86,2.07 234.60,2.03 218.34,2.00 202.08,1.98 185.82,2.02 169.56,2.09 153.29,2.16 137.03,2.22 120.77,2.29 104.51,2.36 88.25,2.42 72.00,2.49 55.78,2.58 39.68,2.72 24.06,3.06 10.35,3.98 3.15,7.61 1.99,18.44 1.89,32.58 1.81,39.02 1.73,39.32 1.59,39.59 1.39,39.82 1.14,40.00 0.86,40.11 0.55,40.15 0.25,40.11 -0.04,40.00 -0.29,39.83 -0.50,39.60 -0.64,39.33 -0.71,39.04 Z" fill="#ff2133" stroke="#ff2133" stroke-width="2" pointer-events="none"/></g><text font-size="28px" font-family="Caveat Brush" font-weight="normal" line-height="28px" letter-spacing="-0.03em" text-align="center" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="middle" transform="translate(185, 45)" fill="#ff2133" transform-origin="center center"><tspan y="14px" x="27">Loki -</tspan></text></g><g text-align="center" text-anchor="middle" transform="translate(2192.00, 944.00) rotate(0.00, 192.00, 64.00)"><g id="bae4f8e9-36aa-4b49-34e8-56fe551c936a_svg" class="tl-centered-g"><path d="M86.40,0.06 Q98.48,0.09 106.07,0.10 T121.63,0.12 137.69,0.14 153.87,0.16 170.09,0.18 186.31,0.17 202.53,0.10 218.76,0.01 234.98,-0.09 251.21,-0.18 267.43,-0.27 283.66,-0.37 299.88,-0.46 316.11,-0.56 332.33,-0.65 348.56,-0.74 364.81,-0.83 377.05,0.99 382.21,9.91 383.41,25.07 383.52,41.58 383.49,58.44 383.59,75.39 383.77,92.37 383.94,109.38 382.16,122.09 373.52,127.43 358.96,128.77 343.12,128.98 326.97,128.96 310.74,128.89 294.48,128.80 278.22,128.70 261.95,128.61 245.69,128.51 229.42,128.41 213.15,128.32 196.89,128.25 180.62,128.24 164.36,128.26 148.09,128.28 131.82,128.29 115.56,128.31 99.29,128.33 83.02,128.35 66.76,128.36 50.49,128.38 34.23,128.40 17.94,128.41 5.67,126.53 0.55,117.70 -0.54,102.74 -0.51,86.47 -0.35,69.86 -0.32,53.16 -0.36,36.43 -0.40,19.67 1.46,7.13 10.11,1.81 24.64,0.41 40.43,0.12 56.54,0.07 72.74,0.07 88.96,0.08 105.18,0.10 121.41,0.12 137.63,0.14 153.86,0.16 170.08,0.18 186.31,0.17 202.53,0.10 221.53,0.00 232.61,-0.02 232.95,0.09 233.24,0.31 233.45,0.61 233.54,0.96 233.53,1.33 233.39,1.67 233.16,1.95 232.84,2.13 232.49,2.21 232.13,2.17 231.80,2.02 231.53,1.77 231.36,1.45 231.30,1.09 231.36,0.73 231.53,0.41 231.79,0.16 232.12,0.00 232.48,-0.04 232.84,0.04 233.15,0.23 233.39,0.51 233.52,0.84 233.55,1.21 233.45,1.56 233.24,1.86 232.95,2.08 232.61,2.20 232.43,2.23 221.54,2.23 202.54,2.21 186.31,2.22 170.09,2.29 153.86,2.38 137.64,2.48 121.41,2.57 105.19,2.66 88.96,2.76 72.75,2.86 56.57,2.97 40.50,3.14 24.92,3.52 11.23,4.50 4.00,8.31 2.70,19.74 2.38,36.45 2.06,53.17 1.84,69.87 1.86,86.45 2.19,102.53 3.14,116.64 6.86,124.02 17.99,125.18 34.23,125.27 50.50,125.36 66.77,125.46 83.03,125.55 99.30,125.65 115.56,125.75 131.83,125.84 148.10,125.94 164.36,126.03 180.63,126.13 196.89,126.19 213.16,126.21 229.43,126.19 245.69,126.17 261.96,126.15 278.22,126.14 294.49,126.12 310.74,126.09 326.97,126.06 343.07,125.96 358.69,125.65 372.41,124.72 379.63,120.92 380.84,109.33 381.03,92.37 381.22,75.39 381.30,58.45 381.15,41.62 380.69,25.30 379.63,10.98 375.87,3.51 364.76,2.40 348.56,2.39 332.34,2.37 316.11,2.35 299.89,2.33 283.66,2.31 267.44,2.29 251.21,2.27 234.99,2.25 218.76,2.23 202.54,2.21 186.31,2.22 170.09,2.29 153.88,2.38 137.69,2.48 121.64,2.57 106.07,2.66 92.45,2.75 86.24,2.77 85.92,2.69 85.63,2.54 85.39,2.33 85.20,2.06 85.08,1.75 85.04,1.43 85.08,1.10 85.20,0.80 85.38,0.53 85.63,0.31 85.92,0.16 86.23,0.08 Z" fill="#7746f1" stroke="#7746f1" stroke-width="2" pointer-events="none"/></g><text font-size="28px" font-family="Caveat Brush" font-weight="normal" line-height="28px" letter-spacing="-0.03em" text-align="center" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="middle" transform="translate(149, 45)" fill="#7746f1" transform-origin="center center"><tspan y="14px" x="47">Grafana -</tspan></text></g><g id="c1273747-2024-43cb-3ff9-f5e285e818cf_svg" class="tl-centered-g" transform="translate(2000.00, 1008.00) rotate(0.00, 88.00, 0.50)"><defs><mask id="c1273747-2024-43cb-3ff9-f5e285e818cf_clip"><rect x="-100" y="-100" width="376" height="201" fill="white"/><rect x="88" y="0" width="0" height="0" rx="4" ry="4" fill="black" opacity="1"/></mask></defs><g pointer-events="none" opacity="1" mask=""><path d="M0.00,-0.95 Q43.50,-0.88 65.25,-0.85 T108.75,-0.81 152.25,-0.78 174.12,-0.74 174.35,-0.66 174.55,-0.52 174.68,-0.32 174.75,-0.08 174.73,0.16 174.64,0.39 174.49,0.57 174.28,0.70 174.04,0.75 173.80,0.73 173.58,0.62 173.40,0.46 173.29,0.24 173.25,-0.00 173.29,-0.24 173.40,-0.46 173.58,-0.62 173.80,-0.73 174.04,-0.75 174.28,-0.70 174.49,-0.57 174.64,-0.39 174.73,-0.16 174.75,0.08 174.68,0.32 174.55,0.52 174.35,0.66 174.12,0.74 174.00,0.76 152.25,0.78 108.75,0.81 65.25,0.85 21.75,0.92 -0.11,0.94 -0.33,0.88 -0.54,0.78 -0.71,0.63 -0.84,0.44 -0.92,0.23 -0.94,-0.00 -0.92,-0.23 -0.84,-0.44 -0.71,-0.63 -0.54,-0.78 -0.33,-0.88 -0.11,-0.94 Z" fill="#1d1d1d" stroke="#1d1d1d" stroke-width="2.11" stroke-dasharray="none" stroke-dashoffset="none" stroke-linecap="round" stroke-linejoin="round" pointer-events="stroke"/><g><path d="M 162.14,-7.999999999999999 L 176,0 162.14,7.999999999999999" fill="none" stroke="#1d1d1d" stroke-width="4.23" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/></g></g></g><text font-size="68.52584741710051px" font-family="Caveat Brush" font-weight="normal" line-height="68.52584741710051px" letter-spacing="-0.03em" text-align="left" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="start" fill="#1d1d1d" transform="translate(1584.00, 784.00) rotate(0.00, 190.00, 39.50)"><tspan y="34.262923708550254px" x="4">Business Metrics -</tspan></text><g text-align="center" text-anchor="middle" transform="translate(1616.00, 1200.00) rotate(0.00, 208.00, 64.00)"><g id="5b585d52-09f4-425e-01b9-0f8ee18bf3ff_svg" class="tl-centered-g"><path d="M416.39,89.91 Q416.52,102.46 416.57,110.36 T414.75,122.29 406.10,127.43 391.54,128.74 375.71,128.95 359.56,128.94 343.33,128.88 327.07,128.80 310.81,128.72 294.54,128.64 278.28,128.56 262.02,128.48 245.75,128.39 229.49,128.31 213.22,128.26 196.96,128.25 180.69,128.28 164.43,128.30 148.16,128.32 131.90,128.34 115.63,128.37 99.37,128.39 83.10,128.41 66.84,128.43 50.57,128.46 34.31,128.48 18.02,128.50 5.76,126.63 0.61,117.72 -0.56,102.61 -0.61,86.16 -0.53,69.36 -0.59,52.47 -0.72,35.55 -0.84,18.60 0.98,5.93 9.62,0.61 24.19,-0.73 40.03,-0.93 56.18,-0.90 72.42,-0.81 88.68,-0.71 104.94,-0.61 121.21,-0.51 137.48,-0.40 153.75,-0.30 170.02,-0.19 186.28,-0.09 202.55,-0.01 218.82,0.02 235.09,0.02 251.36,0.02 267.63,0.02 283.90,0.02 300.17,0.02 316.43,0.02 332.70,0.03 348.97,0.03 365.24,0.03 381.51,0.03 397.80,0.03 410.06,1.92 415.21,10.79 416.36,25.84 416.40,42.21 416.31,58.93 416.35,75.74 416.46,95.45 416.46,106.99 416.31,107.43 416.03,107.80 415.64,108.06 415.19,108.18 414.72,108.16 414.29,107.98 413.93,107.68 413.69,107.28 413.60,106.82 413.65,106.36 413.85,105.93 414.17,105.59 414.58,105.38 415.04,105.30 415.51,105.38 415.92,105.60 416.24,105.94 416.43,106.37 416.48,106.83 416.38,107.29 416.14,107.69 415.78,107.99 415.34,108.16 414.88,108.18 414.43,108.06 414.04,107.79 413.76,107.42 413.61,106.98 413.57,106.74 413.71,95.44 413.98,75.73 414.13,58.93 414.03,42.25 413.63,26.07 412.62,11.86 408.88,4.43 397.74,3.27 381.50,3.17 365.23,3.07 348.96,2.96 332.69,2.86 316.42,2.75 300.16,2.65 283.89,2.54 267.62,2.44 251.35,2.33 235.08,2.23 218.81,2.12 202.55,2.04 186.28,2.02 170.01,2.02 153.74,2.02 137.47,2.01 121.20,2.01 104.94,2.01 88.67,2.01 72.41,2.02 56.18,2.04 40.07,2.11 24.46,2.40 10.73,3.31 3.50,7.11 2.27,18.66 2.03,35.56 1.79,52.47 1.65,69.36 1.76,86.12 2.17,102.38 3.19,116.66 6.94,124.11 18.07,125.26 34.31,125.33 50.58,125.42 66.84,125.50 83.11,125.58 99.37,125.66 115.64,125.74 131.90,125.82 148.17,125.90 164.43,125.99 180.70,126.07 196.96,126.15 213.22,126.20 229.49,126.21 245.75,126.19 262.02,126.16 278.28,126.14 294.55,126.12 310.81,126.10 327.08,126.07 343.33,126.04 359.55,126.00 375.66,125.91 391.28,125.61 405.00,124.72 412.23,121.10 413.47,110.29 413.71,96.17 413.85,89.75 413.93,89.45 414.07,89.18 414.27,88.95 414.53,88.78 414.81,88.67 415.12,88.64 415.42,88.68 415.71,88.78 415.96,88.96 416.16,89.19 416.30,89.46 416.37,89.76 Z" fill="#ff2133" stroke="#ff2133" stroke-width="2" pointer-events="none"/></g><text font-size="28px" font-family="Caveat Brush" font-weight="normal" line-height="28px" letter-spacing="-0.03em" text-align="center" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="middle" transform="translate(156, 45)" fill="#ff2133" transform-origin="center center"><tspan y="14px" x="56">Clickhouse -</tspan></text></g><g text-align="center" text-anchor="middle" transform="translate(2192.00, 1200.00) rotate(0.00, 192.00, 64.00)"><g id="c0ea3ffa-230c-4216-3706-26a112f863d4_svg" class="tl-centered-g"><path d="M-0.26,38.42 Q-0.47,25.87 -0.57,17.97 T1.19,6.03 9.82,0.88 24.37,-0.44 40.18,-0.68 56.31,-0.69 72.53,-0.65 88.77,-0.59 105.02,-0.53 121.27,-0.47 137.52,-0.41 153.77,-0.35 170.02,-0.29 186.27,-0.26 202.52,-0.28 218.76,-0.33 235.01,-0.39 251.26,-0.44 267.51,-0.49 283.76,-0.55 300.01,-0.60 316.26,-0.65 332.51,-0.70 348.76,-0.76 365.03,-0.80 377.28,1.05 382.45,9.91 383.66,24.95 383.77,41.32 383.75,58.03 383.86,74.84 384.05,91.67 384.23,108.53 382.45,121.15 373.82,126.48 359.28,127.84 343.48,128.09 327.35,128.11 311.14,128.07 294.91,128.02 278.67,127.96 262.43,127.90 246.19,127.84 229.95,127.79 213.71,127.73 197.47,127.70 181.23,127.72 164.99,127.78 148.75,127.83 132.51,127.89 116.27,127.94 100.03,128.00 83.79,128.05 67.55,128.11 51.31,128.16 35.07,128.22 18.81,128.27 6.57,126.42 1.39,117.55 0.15,102.50 0.01,86.13 0.00,69.41 -0.14,52.60 -0.36,32.88 -0.44,21.34 -0.29,20.90 -0.01,20.53 0.38,20.26 0.83,20.14 1.30,20.16 1.73,20.33 2.09,20.64 2.33,21.04 2.43,21.49 2.38,21.96 2.19,22.38 1.87,22.72 1.45,22.94 0.99,23.02 0.53,22.94 0.12,22.72 -0.20,22.39 -0.40,21.96 -0.45,21.50 -0.35,21.04 -0.11,20.64 0.24,20.34 0.68,20.16 1.14,20.14 1.59,20.26 1.98,20.52 2.27,20.89 2.42,21.34 2.45,21.57 2.38,32.87 2.23,52.59 2.19,69.40 2.38,86.08 2.88,102.27 3.96,116.47 7.74,123.89 18.86,125.03 35.07,125.09 51.31,125.14 67.55,125.20 83.79,125.26 100.03,125.32 116.27,125.38 132.51,125.44 148.75,125.49 164.99,125.55 181.23,125.61 197.47,125.64 213.71,125.61 229.95,125.56 246.19,125.50 262.43,125.45 278.67,125.39 294.91,125.34 311.14,125.28 327.34,125.20 343.42,125.07 359.01,124.73 372.71,123.78 379.92,119.98 381.12,108.48 381.31,91.67 381.49,74.84 381.57,58.04 381.40,41.37 380.93,25.19 379.87,10.99 376.10,3.57 364.98,2.43 348.76,2.38 332.51,2.31 316.26,2.25 300.01,2.19 283.76,2.13 267.51,2.07 251.26,2.01 235.01,1.95 218.76,1.89 202.51,1.83 186.27,1.80 170.02,1.82 153.77,1.88 137.52,1.93 121.27,1.98 105.02,2.03 88.77,2.09 72.54,2.15 56.33,2.22 40.24,2.34 24.63,2.67 10.93,3.58 3.72,7.21 2.54,18.02 2.38,32.14 2.28,38.57 2.21,38.87 2.06,39.14 1.86,39.37 1.61,39.54 1.32,39.65 1.02,39.69 0.72,39.65 0.43,39.54 0.18,39.37 -0.03,39.14 -0.17,38.87 -0.24,38.57 Z" fill="#7746f1" stroke="#7746f1" stroke-width="2" pointer-events="none"/></g><text font-size="28px" font-family="Caveat Brush" font-weight="normal" line-height="28px" letter-spacing="-0.03em" text-align="center" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="middle" transform="translate(147, 45)" fill="#7746f1" transform-origin="center center"><tspan y="14px" x="49">Superset -</tspan></text></g><g id="b8191198-89b8-4ed5-27dc-af585bb206b6_svg" class="tl-centered-g" transform="translate(2032.00, 1264.00) rotate(0.00, 72.00, 0.50)"><defs><mask id="b8191198-89b8-4ed5-27dc-af585bb206b6_clip"><rect x="-100" y="-100" width="344" height="201" fill="white"/><rect x="72" y="0" width="0" height="0" rx="4" ry="4" fill="black" opacity="1"/></mask></defs><g pointer-events="none" opacity="1" mask=""><path d="M0.00,-1.03 Q35.50,-0.97 53.25,-0.95 T88.75,-0.91 124.25,-0.88 142.14,-0.84 142.40,-0.76 142.62,-0.59 142.78,-0.36 142.85,-0.09 142.84,0.18 142.73,0.44 142.55,0.65 142.32,0.80 142.05,0.85 141.77,0.82 141.52,0.71 141.32,0.52 141.19,0.27 141.14,-0.00 141.19,-0.27 141.32,-0.52 141.52,-0.71 141.77,-0.82 142.05,-0.85 142.32,-0.79 142.55,-0.65 142.73,-0.44 142.84,-0.18 142.85,0.09 142.78,0.36 142.62,0.59 142.40,0.76 142.14,0.84 142.00,0.87 124.25,0.88 88.75,0.91 53.25,0.95 17.75,1.00 -0.12,1.01 -0.36,0.95 -0.58,0.84 -0.76,0.68 -0.90,0.47 -0.99,0.24 -1.02,-0.00 -0.99,-0.24 -0.90,-0.47 -0.76,-0.68 -0.58,-0.84 -0.36,-0.95 -0.12,-1.01 Z" fill="#1d1d1d" stroke="#1d1d1d" stroke-width="2.11" stroke-dasharray="none" stroke-dashoffset="none" stroke-linecap="round" stroke-linejoin="round" pointer-events="stroke"/><g><path d="M 130.14,-7.999999999999999 L 144,0 130.14,7.999999999999999" fill="none" stroke="#1d1d1d" stroke-width="4.23" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/></g></g></g><g id="6d0ed028-ad21-41a5-16e4-edfd7357e386_svg" class="tl-centered-g" transform="translate(1941.44, 1011.47) rotate(0.00, 117.28, 94.27)"><defs><mask id="6d0ed028-ad21-41a5-16e4-edfd7357e386_clip"><rect x="-100" y="-100" width="434.56" height="388.53" fill="white"/><rect x="117.28" y="94.26" width="0" height="0" rx="4" ry="4" fill="black" opacity="1"/></mask></defs><g pointer-events="none" opacity="1" mask=""><path d="M-0.60,187.78 Q57.69,141.01 86.83,117.62 T145.11,70.84 203.38,24.04 232.62,0.58 232.86,0.50 233.11,0.49 233.34,0.56 233.55,0.71 233.69,0.91 233.77,1.15 233.76,1.40 233.67,1.63 233.52,1.83 233.31,1.96 233.06,2.02 232.81,2.00 232.59,1.90 232.40,1.74 232.28,1.52 232.23,1.27 232.26,1.03 232.37,0.80 232.55,0.63 232.77,0.52 233.02,0.48 233.27,0.53 233.48,0.65 233.65,0.84 233.75,1.07 233.77,1.32 233.71,1.56 233.57,1.77 233.49,1.86 204.37,25.28 146.14,72.13 87.92,118.98 29.71,165.85 0.51,189.34 0.30,189.44 0.07,189.48 -0.16,189.47 -0.38,189.41 -0.58,189.29 -0.75,189.13 -0.87,188.93 -0.94,188.71 -0.96,188.48 -0.92,188.26 -0.83,188.05 -0.68,187.86 Z" fill="#1d1d1d" stroke="#1d1d1d" stroke-width="2.11" stroke-dasharray="none" stroke-dashoffset="none" stroke-linecap="round" stroke-linejoin="round" pointer-events="stroke"/><g><path d="M 218.74,2.4452721812590292 L 234.56,0 228.77,14.91626537470431" fill="none" stroke="#1d1d1d" stroke-width="4.23" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/></g></g></g><g text-align="center" text-anchor="middle" transform="translate(16.00, 1424.00) rotate(0.00, 128.00, 48.00)"><g id="4f4c62c2-989b-466a-1cbb-b45fb4c234de_svg" class="tl-centered-g"><path d="M168.73,96.28 Q156.57,96.24 148.93,96.22 T133.28,96.24 117.13,96.34 100.85,96.48 84.54,96.63 68.22,96.77 51.90,96.92 35.57,97.06 19.23,97.21 6.95,95.46 1.72,88.31 0.36,76.98 0.11,64.87 -0.01,52.57 -0.25,40.22 -0.58,27.85 -0.90,15.44 0.79,5.61 9.49,1.03 24.21,-0.09 40.19,-0.22 56.52,-0.16 72.94,-0.05 89.38,0.07 105.82,0.20 122.27,0.28 138.72,0.28 155.17,0.23 171.62,0.18 188.07,0.13 204.52,0.09 220.97,0.04 237.44,-0.00 249.80,1.82 254.94,8.92 256.07,20.07 256.06,31.98 255.91,44.08 255.89,56.22 255.95,68.38 255.99,80.58 254.14,90.26 245.45,94.83 230.82,96.02 214.96,96.25 198.75,96.28 182.46,96.27 166.15,96.25 149.83,96.22 133.51,96.23 117.18,96.34 98.07,96.49 86.92,96.54 86.55,96.42 86.24,96.19 86.02,95.87 85.92,95.49 85.94,95.10 86.08,94.74 86.33,94.45 86.66,94.25 87.04,94.16 87.43,94.20 87.78,94.36 88.06,94.63 88.25,94.97 88.31,95.35 88.25,95.74 88.07,96.08 87.79,96.35 87.44,96.51 87.05,96.56 86.67,96.48 86.34,96.28 86.08,95.98 85.94,95.62 85.92,95.23 86.02,94.86 86.24,94.54 86.54,94.30 86.91,94.17 87.11,94.14 98.06,94.15 117.18,94.16 133.50,94.15 149.82,94.05 166.14,93.90 182.45,93.75 198.73,93.59 214.90,93.38 230.59,92.99 244.35,92.14 251.60,89.03 252.90,80.47 253.21,68.35 253.52,56.20 253.73,44.07 253.69,32.02 253.35,20.36 252.41,10.12 248.65,4.41 237.39,3.20 220.96,3.08 204.51,2.95 188.06,2.83 171.61,2.70 155.17,2.58 138.72,2.45 122.27,2.37 105.82,2.37 89.37,2.42 72.93,2.47 56.52,2.54 40.23,2.65 24.42,2.94 10.56,3.72 3.31,6.81 2.20,15.48 2.16,27.82 2.12,40.19 2.18,52.53 2.48,64.78 3.08,76.64 4.24,87.05 8.07,92.84 19.27,94.00 35.56,94.02 51.89,94.05 68.21,94.08 84.53,94.11 100.84,94.14 117.12,94.16 133.27,94.15 148.93,94.05 162.64,93.91 168.86,93.87 169.15,93.93 169.40,94.07 169.62,94.26 169.79,94.50 169.89,94.77 169.93,95.06 169.90,95.35 169.79,95.62 169.63,95.86 169.41,96.06 169.15,96.19 168.87,96.26 Z" fill="#1d1d1d" stroke="#1d1d1d" stroke-width="2" pointer-events="none"/></g><text font-size="28px" font-family="Caveat Brush" font-weight="normal" line-height="28px" letter-spacing="-0.03em" text-align="center" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="middle" transform="translate(67, 29)" fill="#1d1d1d" transform-origin="center center"><tspan y="14px" x="65">PostGres DB -</tspan></text></g><g text-align="center" text-anchor="middle" transform="translate(144.00, 528.00) rotate(0.00, 0.50, 440.00)"><g id="5dbc0ba2-e571-448a-11cd-872941e40de0_svg" class="tl-centered-g"><defs><mask id="5dbc0ba2-e571-448a-11cd-872941e40de0_clip"><rect x="-100" y="-100" width="201" height="1080" fill="white"/><rect x="-48.5" y="407" width="97" height="66" rx="4" ry="4" fill="black" opacity="1"/></mask></defs><g pointer-events="none" opacity="1" mask="url(#5dbc0ba2-e571-448a-11cd-872941e40de0_clip)"><path d="M0.99,0.00 Q0.93,219.50 0.91,329.25 T0.87,548.75 0.84,768.25 0.80,878.13 0.72,878.38 0.56,878.59 0.34,878.74 0.09,878.81 -0.17,878.79 -0.42,878.70 -0.62,878.53 -0.75,878.30 -0.81,878.04 -0.78,877.78 -0.67,877.54 -0.49,877.35 -0.26,877.23 0.00,877.19 0.26,877.23 0.49,877.35 0.67,877.54 0.78,877.78 0.81,878.04 0.75,878.30 0.62,878.53 0.42,878.70 0.17,878.79 -0.09,878.81 -0.34,878.74 -0.56,878.59 -0.72,878.38 -0.80,878.13 -0.82,878.00 -0.84,768.25 -0.87,548.75 -0.91,329.25 -0.96,109.75 -0.98,-0.12 -0.92,-0.35 -0.81,-0.56 -0.65,-0.74 -0.46,-0.87 -0.24,-0.96 0.00,-0.99 0.24,-0.96 0.46,-0.87 0.65,-0.74 0.81,-0.56 0.92,-0.35 0.98,-0.12 Z" fill="#1d1d1d" stroke="#1d1d1d" stroke-width="2.11" stroke-dasharray="none" stroke-dashoffset="none" stroke-linecap="round" stroke-linejoin="round" pointer-events="stroke"/><g><path d="M 7.99,866.143593539449 L 0,880 -7.999999999999999,866.143593539449" fill="none" stroke="#1d1d1d" stroke-width="4.23" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/></g></g></g><text font-size="28px" font-family="Caveat Brush" font-weight="normal" line-height="28px" letter-spacing="-0.03em" text-align="left" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="start" transform="translate(-48.5, 407)" fill="#1d1d1d" transform-origin="center center"><tspan y="14px" x="4">Database -</tspan><tspan y="42px" x="4"> -Objects -</tspan></text></g><g id="595e12c5-c275-4c02-287f-d432f2adeb96_svg" class="tl-centered-g" transform="translate(272.00, 1312.10) rotate(0.00, 664.00, 64.14)"><defs><mask id="595e12c5-c275-4c02-287f-d432f2adeb96_clip"><rect x="-100" y="-100" width="1528" height="328.28" fill="white"/><rect x="664" y="64.14" width="0" height="0" rx="4" ry="4" fill="black" opacity="1"/></mask></defs><g pointer-events="none" opacity="1" mask=""><path d="M-0.09,127.34 Q331.42,95.39 497.17,79.40 T828.68,47.43 1160.18,15.44 1326.06,-0.55 1326.29,-0.50 1326.50,-0.37 1326.65,-0.18 1326.74,0.04 1326.75,0.28 1326.68,0.51 1326.54,0.71 1326.35,0.85 1326.12,0.93 1325.88,0.93 1325.65,0.85 1325.46,0.70 1325.33,0.50 1325.27,0.26 1325.28,0.02 1325.38,-0.20 1325.53,-0.38 1325.74,-0.50 1325.98,-0.55 1326.22,-0.52 1326.43,-0.42 1326.61,-0.25 1326.72,-0.04 1326.75,0.20 1326.71,0.44 1326.60,0.65 1326.42,0.81 1326.20,0.91 1326.08,0.94 1160.33,16.97 828.83,49.02 497.33,81.09 165.84,113.17 -0.02,129.22 -0.25,129.18 -0.46,129.10 -0.64,128.97 -0.78,128.79 -0.88,128.59 -0.93,128.37 -0.93,128.14 -0.87,127.93 -0.76,127.73 -0.60,127.56 -0.42,127.44 -0.20,127.36 Z" fill="#1d1d1d" stroke="#1d1d1d" stroke-width="2.11" stroke-dasharray="none" stroke-dashoffset="none" stroke-linecap="round" stroke-linejoin="round" pointer-events="stroke"/><g><path d="M 1313.43,-6.630658169675435 L 1328,0 1314.97,9.295213297537819" fill="none" stroke="#1d1d1d" stroke-width="4.23" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/></g></g></g><g id="94a12c0a-5ce9-4210-307d-ec8115fc1f3e_svg" class="tl-centered-g" transform="translate(1456.00, 1584.00) rotate(0.00, 592.00, 128.00)"><g pointer-events="none" stroke="#1d1d1d" stroke-width="4.23" stroke-linecap="round"><line x1="2.11" y1="2.11" x2="1181.88" y2="2.11" stroke-dasharray="6.47 6.49" stroke-dashoffset="3.23"/><line x1="1181.88" y1="2.11" x2="1181.88" y2="253.88" stroke-dasharray="6.47 6.77" stroke-dashoffset="3.23"/><line x1="1181.88" y1="253.88" x2="2.11" y2="253.88" stroke-dasharray="6.47 6.49" stroke-dashoffset="3.23"/><line x1="2.11" y1="253.88" x2="2.11" y2="2.11" stroke-dasharray="6.47 6.77" stroke-dashoffset="3.23"/></g></g><g text-align="center" text-anchor="middle" transform="translate(1584.00, 1648.00) rotate(0.00, 208.00, 64.00)"><g id="cf688a39-0d33-4110-27f5-9efb18d06ef2_svg" class="tl-centered-g"><path d="M416.03,89.46 Q416.24,102.10 416.35,110.06 T414.59,122.07 405.96,127.23 391.42,128.53 375.61,128.73 359.48,128.71 343.26,128.63 327.02,128.54 310.77,128.45 294.53,128.35 278.28,128.25 262.03,128.16 245.78,128.06 229.54,127.97 213.29,127.90 197.04,127.88 180.79,127.89 164.55,127.90 148.30,127.90 132.05,127.91 115.80,127.92 99.56,127.93 83.31,127.94 67.06,127.94 50.81,127.95 34.57,127.96 18.29,127.96 6.04,126.08 0.93,117.21 -0.17,102.18 -0.14,85.83 0.02,69.14 0.05,52.35 -0.00,35.54 -0.04,18.70 1.82,6.10 10.46,0.78 24.97,-0.60 40.74,-0.85 56.82,-0.87 72.99,-0.84 89.18,-0.79 105.37,-0.74 121.57,-0.68 137.77,-0.63 153.96,-0.58 170.16,-0.52 186.36,-0.47 202.56,-0.44 218.75,-0.47 234.95,-0.52 251.15,-0.57 267.35,-0.62 283.54,-0.67 299.74,-0.72 315.94,-0.77 332.14,-0.82 348.33,-0.87 364.53,-0.92 380.73,-0.97 396.95,-1.02 409.17,0.83 414.35,9.74 415.59,24.90 415.74,41.39 415.75,58.24 415.90,75.18 416.13,95.04 416.21,106.66 416.07,107.11 415.78,107.48 415.40,107.74 414.95,107.87 414.48,107.84 414.05,107.67 413.69,107.37 413.45,106.97 413.35,106.51 413.39,106.05 413.59,105.62 413.91,105.28 414.32,105.06 414.79,104.99 415.25,105.06 415.66,105.28 415.98,105.62 416.18,106.04 416.23,106.51 416.13,106.96 415.89,107.37 415.54,107.67 415.10,107.84 414.63,107.87 414.18,107.75 413.80,107.48 413.51,107.11 413.36,106.67 413.32,106.44 413.39,95.05 413.53,75.18 413.57,58.25 413.36,41.44 412.86,25.14 411.77,10.83 407.99,3.35 396.90,2.22 380.73,2.17 364.53,2.12 348.33,2.07 332.14,2.01 315.94,1.96 299.74,1.90 283.54,1.85 267.35,1.80 251.15,1.74 234.95,1.69 218.75,1.64 202.56,1.61 186.36,1.63 170.16,1.68 153.96,1.73 137.77,1.79 121.57,1.84 105.37,1.89 89.18,1.94 72.99,1.99 56.83,2.06 40.79,2.19 25.24,2.53 11.58,3.48 4.36,7.28 3.06,18.77 2.74,35.56 2.42,52.37 2.20,69.15 2.23,85.81 2.57,101.97 3.52,116.16 7.23,123.57 18.35,124.73 34.57,124.82 50.82,124.91 67.07,125.01 83.32,125.10 99.56,125.20 115.81,125.30 132.06,125.39 148.31,125.49 164.55,125.58 180.80,125.68 197.05,125.77 213.30,125.84 229.54,125.86 245.79,125.85 262.04,125.85 278.29,125.84 294.53,125.83 310.78,125.82 327.02,125.81 343.26,125.80 359.47,125.77 375.56,125.69 391.16,125.40 404.86,124.52 412.06,120.90 413.24,110.02 413.39,95.79 413.49,89.31 413.56,89.01 413.71,88.74 413.91,88.51 414.16,88.34 414.45,88.23 414.75,88.19 415.05,88.23 415.34,88.34 415.59,88.51 415.79,88.74 415.94,89.01 416.01,89.31 Z" fill="#ff2133" stroke="#ff2133" stroke-width="2" pointer-events="none"/></g><text font-size="28px" font-family="Caveat Brush" font-weight="normal" line-height="28px" letter-spacing="-0.03em" text-align="center" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="middle" transform="translate(185, 45)" fill="#ff2133" transform-origin="center center"><tspan y="14px" x="27">Loki -</tspan></text></g><g text-align="center" text-anchor="middle" transform="translate(2192.00, 1648.00) rotate(0.00, 192.00, 64.00)"><g id="0735376f-13f2-4f0d-034b-fc85abcfd0d1_svg" class="tl-centered-g"><path d="M86.33,-0.23 Q98.46,-0.19 106.06,-0.18 T121.67,-0.15 137.77,-0.12 154.00,-0.10 170.26,-0.07 186.53,-0.07 202.80,-0.13 219.07,-0.22 235.34,-0.31 251.61,-0.40 267.88,-0.48 284.15,-0.57 300.42,-0.66 316.69,-0.74 332.96,-0.83 349.24,-0.92 365.53,-1.00 377.80,0.83 382.93,9.73 384.03,24.83 384.02,41.28 383.88,58.07 383.86,74.95 383.92,91.86 383.98,108.80 382.12,121.46 373.47,126.80 358.91,128.18 343.09,128.44 326.95,128.46 310.72,128.43 294.48,128.38 278.22,128.33 261.97,128.28 245.71,128.23 229.46,128.18 213.20,128.13 196.95,128.11 180.69,128.14 164.44,128.20 148.18,128.26 131.93,128.33 115.67,128.39 99.42,128.45 83.16,128.51 66.90,128.58 50.65,128.64 34.39,128.70 18.11,128.76 5.86,126.91 0.71,118.05 -0.44,103.01 -0.47,86.64 -0.38,69.93 -0.41,53.13 -0.53,36.30 -0.63,19.44 1.19,6.83 9.84,1.50 24.41,0.10 40.24,-0.18 56.40,-0.23 72.64,-0.22 88.90,-0.20 105.17,-0.18 121.44,-0.15 137.71,-0.12 153.99,-0.10 170.26,-0.07 186.53,-0.07 202.80,-0.13 221.85,-0.23 232.96,-0.25 233.30,-0.13 233.59,0.09 233.80,0.39 233.90,0.74 233.88,1.11 233.74,1.45 233.51,1.72 233.19,1.91 232.84,1.99 232.48,1.95 232.15,1.80 231.88,1.55 231.71,1.23 231.65,0.87 231.71,0.51 231.88,0.19 232.14,-0.06 232.47,-0.22 232.83,-0.26 233.19,-0.18 233.50,0.01 233.74,0.28 233.88,0.62 233.90,0.99 233.80,1.34 233.59,1.64 233.30,1.86 232.96,1.98 232.78,2.01 221.86,2.00 202.80,1.98 186.53,1.98 170.26,2.04 153.99,2.13 137.72,2.21 121.45,2.30 105.18,2.39 88.91,2.48 72.65,2.57 56.42,2.68 40.31,2.84 24.69,3.21 10.96,4.19 3.72,8.01 2.47,19.50 2.21,36.31 1.96,53.14 1.81,69.93 1.90,86.61 2.29,102.78 3.30,116.98 7.04,124.40 18.16,125.52 34.39,125.57 50.65,125.62 66.90,125.67 83.16,125.72 99.41,125.77 115.67,125.82 131.93,125.87 148.18,125.93 164.44,125.98 180.69,126.03 196.95,126.05 213.20,126.02 229.46,125.95 245.71,125.89 261.97,125.83 278.22,125.77 294.48,125.71 310.72,125.64 326.94,125.56 343.03,125.42 358.64,125.07 372.35,124.10 379.59,120.28 380.87,108.73 381.18,91.84 381.49,74.94 381.69,58.06 381.65,41.30 381.30,25.05 380.34,10.78 376.62,3.34 365.49,2.23 349.24,2.21 332.97,2.19 316.70,2.16 300.43,2.13 284.16,2.11 267.89,2.08 251.62,2.06 235.34,2.03 219.07,2.01 202.80,1.98 186.53,1.98 170.26,2.04 154.00,2.13 137.78,2.21 121.67,2.30 106.07,2.39 92.40,2.47 86.18,2.49 85.86,2.41 85.57,2.26 85.32,2.04 85.14,1.77 85.02,1.47 84.98,1.14 85.02,0.82 85.13,0.51 85.32,0.24 85.56,0.03 85.85,-0.13 86.17,-0.21 Z" fill="#7746f1" stroke="#7746f1" stroke-width="2" pointer-events="none"/></g><text font-size="28px" font-family="Caveat Brush" font-weight="normal" line-height="28px" letter-spacing="-0.03em" text-align="center" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="middle" transform="translate(149, 45)" fill="#7746f1" transform-origin="center center"><tspan y="14px" x="47">Grafana -</tspan></text></g><g id="416ebb91-2648-4b54-3d60-9d07f8571216_svg" class="tl-centered-g" transform="translate(2000.00, 1712.00) rotate(0.00, 88.00, 0.50)"><defs><mask id="416ebb91-2648-4b54-3d60-9d07f8571216_clip"><rect x="-100" y="-100" width="376" height="201" fill="white"/><rect x="88" y="0" width="0" height="0" rx="4" ry="4" fill="black" opacity="1"/></mask></defs><g pointer-events="none" opacity="1" mask=""><path d="M0.00,-1.00 Q43.50,-0.94 65.25,-0.92 T108.75,-0.88 152.25,-0.85 174.13,-0.82 174.39,-0.73 174.60,-0.57 174.75,-0.35 174.82,-0.09 174.81,0.18 174.71,0.43 174.54,0.63 174.31,0.77 174.04,0.83 173.78,0.80 173.54,0.68 173.34,0.50 173.22,0.26 173.17,-0.00 173.22,-0.26 173.34,-0.50 173.54,-0.68 173.78,-0.80 174.04,-0.83 174.31,-0.77 174.54,-0.63 174.71,-0.43 174.81,-0.18 174.82,0.09 174.75,0.35 174.60,0.57 174.39,0.73 174.13,0.82 174.00,0.84 152.25,0.85 108.75,0.88 65.25,0.92 21.75,0.97 -0.12,0.99 -0.35,0.93 -0.57,0.82 -0.75,0.66 -0.88,0.46 -0.97,0.24 -1.00,-0.00 -0.97,-0.24 -0.88,-0.46 -0.75,-0.66 -0.57,-0.82 -0.35,-0.93 -0.12,-0.99 Z" fill="#1d1d1d" stroke="#1d1d1d" stroke-width="2.11" stroke-dasharray="none" stroke-dashoffset="none" stroke-linecap="round" stroke-linejoin="round" pointer-events="stroke"/><g><path d="M 162.14,-7.999999999999999 L 176,0 162.14,7.999999999999999" fill="none" stroke="#1d1d1d" stroke-width="4.23" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/></g></g></g><text font-size="68.52584741710051px" font-family="Caveat Brush" font-weight="normal" line-height="68.52584741710051px" letter-spacing="-0.03em" text-align="left" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="start" fill="#1d1d1d" transform="translate(1584.00, 1488.00) rotate(0.00, 218.00, 39.50)"><tspan y="34.262923708550254px" x="4">LogViewer For Apps -</tspan></text><g text-align="center" text-anchor="middle" transform="translate(997.67, 633.79) rotate(0.00, 285.17, 155.11)"><g id="19b28a05-6c6d-45cd-34ae-f5f07e55653e_svg" class="tl-centered-g"><defs><mask id="19b28a05-6c6d-45cd-34ae-f5f07e55653e_clip"><rect x="-100" y="-100" width="770.33" height="510.21" fill="white"/><rect x="196.81" y="83.06" width="119" height="38" rx="4" ry="4" fill="black" opacity="1"/></mask></defs><g pointer-events="none" opacity="1" mask="url(#19b28a05-6c6d-45cd-34ae-f5f07e55653e_clip)"><path d="M-1.38,309.03 Q0.01,306.74 0.83,305.78 T2.88,303.39 5.85,299.98 9.89,295.38 15.22,289.42 22.04,281.95 30.56,272.84 41.02,261.99 53.71,249.31 68.91,234.76 86.96,218.33 108.21,200.09 133.06,180.16 161.92,158.72 195.26,136.08 233.56,112.64 275.04,89.99 315.47,70.45 352.55,54.65 386.20,41.96 416.41,31.84 443.26,23.82 466.84,17.53 487.31,12.61 504.85,8.79 519.65,5.85 531.92,3.61 541.89,1.92 549.79,0.66 555.86,-0.25 560.33,-0.90 564.86,-1.53 567.88,-1.85 568.57,-1.66 569.16,-1.25 569.60,-0.68 569.83,0.00 569.83,0.72 569.59,1.40 569.16,1.97 568.56,2.37 567.87,2.57 567.15,2.53 566.49,2.26 565.94,1.79 565.57,1.18 565.42,0.47 565.50,-0.24 565.80,-0.89 566.29,-1.41 566.93,-1.75 567.64,-1.86 568.35,-1.75 568.98,-1.41 569.47,-0.89 569.77,-0.23 569.85,0.48 569.70,1.18 569.32,1.80 568.78,2.26 568.11,2.53 567.75,2.60 565.29,2.95 560.98,3.55 556.53,4.19 550.50,5.11 542.64,6.36 532.73,8.04 520.52,10.27 505.80,13.19 488.36,16.98 468.00,21.87 444.54,28.14 417.84,36.10 387.78,46.17 354.31,58.79 317.42,74.51 277.19,93.94 235.91,116.47 197.80,139.80 164.61,162.33 135.87,183.66 111.14,203.51 89.99,221.66 72.03,238.00 56.90,252.49 44.27,265.11 33.84,275.92 25.36,284.99 18.58,292.42 13.28,298.35 9.24,302.94 6.30,306.33 4.25,308.70 2.40,310.52 1.21,311.53 0.86,311.79 0.46,311.95 0.03,312.01 -0.40,311.96 -0.81,311.82 -1.17,311.58 -1.46,311.26 -1.67,310.88 -1.78,310.46 -1.79,310.02 -1.69,309.60 -1.50,309.21 Z" fill="#1d1d1d" stroke="#1d1d1d" stroke-width="0" stroke-dasharray="none" stroke-dashoffset="none" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/><g><path d="M 555.51,-6.049250701386985 L 570.33,0 557.68,9.803270987515095" fill="none" stroke="#1d1d1d" stroke-width="4.23" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/></g></g></g><text font-size="28px" font-family="Caveat Brush" font-weight="normal" line-height="28px" letter-spacing="-0.03em" text-align="left" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="start" transform="translate(196.82, 83.07)" fill="#1d1d1d" transform-origin="center center"><tspan y="14px" x="4">Normal Logs -</tspan></text></g><g text-align="center" text-anchor="middle" transform="translate(1008.00, 983.85) rotate(0.00, 280.00, 20.64)"><g id="24b44b2a-c28e-40b5-0251-70966509c4da_svg" class="tl-centered-g"><defs><mask id="24b44b2a-c28e-40b5-0251-70966509c4da_clip"><rect x="-100" y="-100" width="760" height="241.28" fill="white"/><rect x="223" y="1.64" width="114" height="38" rx="4" ry="4" fill="black" opacity="1"/></mask></defs><g pointer-events="none" opacity="1" mask="url(#24b44b2a-c28e-40b5-0251-70966509c4da_clip)"><path d="M-0.07,40.38 Q139.44,30.17 209.19,25.06 T348.70,14.83 488.20,4.58 558.07,-0.54 558.28,-0.48 558.47,-0.36 558.61,-0.19 558.68,0.02 558.68,0.24 558.62,0.46 558.49,0.64 558.31,0.76 558.09,0.83 557.87,0.82 557.66,0.74 557.49,0.60 557.37,0.41 557.32,0.20 557.34,-0.02 557.43,-0.23 557.58,-0.39 557.77,-0.50 557.99,-0.54 558.21,-0.51 558.41,-0.41 558.57,-0.25 558.66,-0.05 558.69,0.17 558.65,0.39 558.54,0.58 558.37,0.73 558.17,0.81 558.06,0.84 488.31,6.00 348.81,16.32 209.31,26.65 69.81,37.00 -0.04,42.17 -0.26,42.14 -0.45,42.05 -0.62,41.92 -0.76,41.75 -0.85,41.56 -0.89,41.35 -0.88,41.13 -0.82,40.92 -0.71,40.74 -0.56,40.58 -0.38,40.47 -0.17,40.40 Z" fill="#1d1d1d" stroke="#1d1d1d" stroke-width="2.11" stroke-dasharray="none" stroke-dashoffset="none" stroke-linecap="round" stroke-linejoin="round" pointer-events="stroke"/><g><path d="M 545.59,-6.959701712900695 L 560,0 546.76,8.997004278181308" fill="none" stroke="#1d1d1d" stroke-width="4.23" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/></g></g></g><text font-size="28px" font-family="Caveat Brush" font-weight="normal" line-height="28px" letter-spacing="-0.03em" text-align="left" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="start" transform="translate(223, 1.64)" fill="#1d1d1d" transform-origin="center center"><tspan y="14px" x="4">Metric Logs -</tspan></text></g><g text-align="center" text-anchor="middle" transform="translate(943.81, 1072.00) rotate(0.00, 312.10, 313.04)"><g id="2f9c8b59-fa42-4ff4-2b54-a05801131b78_svg" class="tl-centered-g"><defs><mask id="2f9c8b59-fa42-4ff4-2b54-a05801131b78_clip"><rect x="-100" y="-100" width="824.19" height="826.08" fill="white"/><rect x="240.59" y="294.04" width="143" height="38" rx="4" ry="4" fill="black" opacity="1"/></mask></defs><g pointer-events="none" opacity="1" mask="url(#2f9c8b59-fa42-4ff4-2b54-a05801131b78_clip)"><path d="M0.69,-0.69 Q156.34,155.53 234.17,233.63 T389.83,389.82 545.50,546.01 623.41,624.21 623.53,624.43 623.56,624.69 623.51,624.93 623.39,625.16 623.20,625.32 622.97,625.42 622.71,625.44 622.47,625.38 622.25,625.25 622.10,625.05 622.01,624.81 622.00,624.56 622.08,624.31 622.22,624.11 622.43,623.96 622.67,623.89 622.93,623.89 623.16,623.98 623.36,624.14 623.50,624.36 623.56,624.60 623.54,624.85 623.44,625.09 623.27,625.28 623.05,625.40 622.80,625.45 622.55,625.41 622.32,625.30 622.22,625.22 544.36,547.15 388.64,391.01 232.92,234.87 77.18,78.75 -0.76,0.59 -0.88,0.40 -0.95,0.17 -0.96,-0.06 -0.92,-0.29 -0.83,-0.50 -0.68,-0.68 -0.50,-0.83 -0.29,-0.92 -0.06,-0.96 0.18,-0.95 0.40,-0.88 0.60,-0.76 Z" fill="#1d1d1d" stroke="#1d1d1d" stroke-width="2.11" stroke-dasharray="none" stroke-dashoffset="none" stroke-linecap="round" stroke-linejoin="round" pointer-events="stroke"/><g><path d="M 620.07,610.6189444466528 L 624.19,626.08 608.74,621.9155374053206" fill="none" stroke="#1d1d1d" stroke-width="4.23" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/></g></g></g><text font-size="28px" font-family="Caveat Brush" font-weight="normal" line-height="28px" letter-spacing="-0.03em" text-align="left" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="start" transform="translate(240.60000000000002, 294.04)" fill="#1d1d1d" transform-origin="center center"><tspan y="14px" x="4">LogViewer Logs -</tspan></text></g><g text-align="center" text-anchor="middle" transform="translate(1264.00, 1200.00) rotate(0.00, 112.00, 64.00)"><g id="7be9afae-68ee-45d0-2a93-a99171ce61ab_svg" class="tl-centered-g"><path d="M136.55,127.90 Q124.34,127.80 116.68,127.80 T100.96,127.86 84.73,127.96 68.39,128.07 52.01,128.17 35.62,128.27 19.21,128.37 6.87,126.55 1.65,117.66 0.39,102.54 0.23,86.08 0.19,69.27 0.03,52.37 -0.21,35.45 -0.44,18.50 1.31,5.82 10.01,0.53 24.72,-0.73 40.73,-0.84 57.06,-0.73 73.47,-0.56 89.91,-0.37 106.36,-0.23 122.81,-0.19 139.26,-0.20 155.71,-0.21 172.16,-0.22 188.61,-0.23 205.08,-0.23 217.46,1.65 222.63,10.50 223.81,25.48 223.87,41.77 223.79,58.40 223.85,75.12 223.98,91.87 224.11,108.65 222.29,121.21 213.60,126.50 198.93,127.83 182.98,128.04 166.71,128.02 150.35,127.94 133.96,127.85 117.57,127.80 101.18,127.86 81.99,127.96 70.79,127.98 70.41,127.85 70.09,127.61 69.87,127.28 69.76,126.90 69.78,126.50 69.93,126.13 70.19,125.82 70.53,125.62 70.92,125.53 71.32,125.58 71.68,125.74 71.97,126.02 72.16,126.37 72.22,126.76 72.16,127.16 71.97,127.51 71.68,127.79 71.32,127.95 70.92,128.00 70.53,127.91 70.19,127.71 69.93,127.40 69.78,127.03 69.76,126.63 69.87,126.25 70.09,125.92 70.41,125.68 70.79,125.55 70.99,125.52 81.99,125.56 101.18,125.66 117.57,125.70 133.96,125.65 150.34,125.54 166.69,125.42 182.92,125.24 198.66,124.85 212.49,123.84 219.76,120.03 221.00,108.59 221.24,91.86 221.48,75.12 221.61,58.40 221.50,41.80 221.08,25.71 220.05,11.57 216.27,4.17 205.02,2.96 188.59,2.77 172.14,2.58 155.70,2.39 139.25,2.20 122.80,2.01 106.35,1.87 89.90,1.83 73.46,1.84 57.05,1.87 40.77,1.96 24.97,2.26 11.10,3.19 3.82,6.99 2.66,18.54 2.53,35.44 2.40,52.37 2.38,69.26 2.60,86.03 3.12,102.29 4.23,116.57 8.04,124.03 19.25,125.18 35.62,125.27 52.01,125.37 68.39,125.47 84.73,125.56 100.95,125.66 116.68,125.70 130.44,125.65 136.69,125.62 136.96,125.68 137.20,125.81 137.41,125.99 137.56,126.22 137.66,126.48 137.69,126.75 137.66,127.02 137.56,127.28 137.41,127.51 137.20,127.69 136.96,127.82 136.69,127.88 Z" fill="#36b24d" stroke="#36b24d" stroke-width="2" pointer-events="none"/></g><text font-size="28px" font-family="Caveat Brush" font-weight="normal" line-height="28px" letter-spacing="-0.03em" text-align="center" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="middle" transform="translate(79.5, 45)" fill="#36b24d" transform-origin="center center"><tspan y="14px" x="36.5">Kafka -</tspan></text></g><g text-align="center" text-anchor="middle" transform="translate(1000.69, 1072.00) rotate(0.00, 123.66, 73.44)"><g id="5308523f-eed3-4a68-075f-97b819d9bb01_svg" class="tl-centered-g"><defs><mask id="5308523f-eed3-4a68-075f-97b819d9bb01_clip"><rect x="-100" y="-100" width="447.31" height="346.87" fill="white"/><rect x="44.15" y="54.43" width="159" height="38" rx="4" ry="4" fill="black" opacity="1"/></mask></defs><g pointer-events="none" opacity="1" mask="url(#5308523f-eed3-4a68-075f-97b819d9bb01_clip)"><path d="M0.46,-0.77 Q61.82,35.76 92.50,54.01 T153.87,90.52 215.25,127.01 246.03,145.33 246.17,145.49 246.25,145.70 246.27,145.92 246.21,146.13 246.09,146.31 245.91,146.45 245.70,146.52 245.48,146.52 245.27,146.45 245.10,146.32 244.97,146.14 244.91,145.93 244.92,145.71 245.00,145.50 245.15,145.33 245.33,145.22 245.55,145.17 245.77,145.19 245.97,145.28 246.13,145.43 246.23,145.63 246.27,145.85 246.24,146.06 246.13,146.26 245.98,146.41 245.78,146.50 245.56,146.53 245.34,146.48 245.24,146.44 214.53,128.22 153.11,91.79 91.69,55.37 30.26,18.97 -0.54,0.71 -0.70,0.56 -0.81,0.37 -0.88,0.17 -0.89,-0.05 -0.85,-0.26 -0.77,-0.46 -0.64,-0.63 -0.47,-0.76 -0.27,-0.85 -0.06,-0.89 0.15,-0.88 0.36,-0.82 Z" fill="#1d1d1d" stroke="#1d1d1d" stroke-width="2.11" stroke-dasharray="none" stroke-dashoffset="none" stroke-linecap="round" stroke-linejoin="round" pointer-events="stroke"/><g><path d="M 239.48,132.91623469829068 L 247.31,146.87 231.31,146.67318559574946" fill="none" stroke="#1d1d1d" stroke-width="4.23" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/></g></g></g><text font-size="28px" font-family="Caveat Brush" font-weight="normal" line-height="28px" letter-spacing="-0.03em" text-align="left" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="start" transform="translate(44.16, 54.44)" fill="#1d1d1d" transform-origin="center center"><tspan y="14px" x="4">Log derived data -</tspan></text></g><g id="26e37cfa-ce32-4bef-2486-fc3c47befba2_svg" class="tl-centered-g" transform="translate(1488.00, 1264.00) rotate(0.00, 56.00, 0.50)"><defs><mask id="26e37cfa-ce32-4bef-2486-fc3c47befba2_clip"><rect x="-100" y="-100" width="312" height="201" fill="white"/><rect x="56" y="0" width="0" height="0" rx="3.5" ry="3.5" fill="black" opacity="1"/></mask></defs><g pointer-events="none" opacity="1" mask=""><path d="M0.00,-1.56 Q27.13,-1.42 40.69,-1.37 T67.81,-1.28 94.94,-1.22 108.69,-1.16 109.05,-1.04 109.35,-0.81 109.57,-0.49 109.67,-0.13 109.65,0.25 109.51,0.61 109.26,0.90 108.93,1.09 108.56,1.17 108.19,1.13 107.84,0.97 107.57,0.71 107.39,0.37 107.33,-0.00 107.39,-0.38 107.57,-0.71 107.84,-0.97 108.19,-1.13 108.56,-1.17 108.93,-1.09 109.26,-0.89 109.51,-0.61 109.65,-0.25 109.67,0.13 109.57,0.49 109.35,0.81 109.05,1.04 108.69,1.16 108.50,1.19 94.94,1.22 67.81,1.28 40.69,1.37 13.56,1.49 -0.19,1.54 -0.55,1.45 -0.88,1.27 -1.16,1.03 -1.37,0.72 -1.50,0.37 -1.55,-0.00 -1.50,-0.37 -1.37,-0.72 -1.16,-1.03 -0.88,-1.27 -0.55,-1.45 -0.19,-1.54 Z" fill="#1d1d1d" stroke="#1d1d1d" stroke-width="3.33" stroke-dasharray="none" stroke-dashoffset="none" stroke-linecap="round" stroke-linejoin="round" pointer-events="stroke"/><g><path d="M 87.75,-13.999999999999998 L 112,0 87.75,13.999999999999998" fill="none" stroke="#1d1d1d" stroke-width="6.66" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/></g></g></g><g transform="translate(2672.00, 976.00) rotate(0.00, 100.00, 112.00)"><rect width="200" height="224" fill="#fddf8e" rx="3" ry="3"/><text font-size="24px" font-family="Caveat Brush" font-weight="normal" line-height="24px" letter-spacing="-0.03em" text-align="center" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="middle" fill="#0d0d0d" transform="translate(16, 16)"><tspan y="12px" x="88">Grafana-Loki + -</tspan><tspan y="36px" x="88">Superset-Clickhouse -</tspan><tspan y="60px" x="88">will both derive -</tspan><tspan y="84px" x="88">business metrics - -</tspan><tspan y="108px" x="88"> - -</tspan><tspan y="132px" x="88">We'll be comparing -</tspan><tspan y="156px" x="88">these for latency &amp; -</tspan><tspan y="180px" x="88">performance -</tspan></text></g><g transform="translate(2832.00, 464.00) rotate(0.00, 100.00, 124.00)"><rect width="200" height="248" fill="#fddf8e" rx="3" ry="3"/><text font-size="24px" font-family="Caveat Brush" font-weight="normal" line-height="24px" letter-spacing="-0.03em" text-align="center" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="middle" fill="#0d0d0d" transform="translate(16, 16)"><tspan y="12px" x="88">Each of the separate -</tspan><tspan y="36px" x="88">loki box shown here -</tspan><tspan y="60px" x="88">can be a single -</tspan><tspan y="84px" x="88">instance but it will be -</tspan><tspan y="108px" x="88">different data series -</tspan><tspan y="132px" x="88">(tables) due the -</tspan><tspan y="156px" x="88">labels we'll be -</tspan><tspan y="180px" x="88">assigning. - -</tspan></text></g><g id="c9f67597-78f8-4608-08fd-34554d81945a_svg" class="tl-centered-g" transform="translate(1856.94, 702.88) rotate(0.00, 479.53, 472.56)"><defs><mask id="c9f67597-78f8-4608-08fd-34554d81945a_clip"><rect x="-100" y="-100" width="1159.06" height="1145.12" fill="white"/><rect x="479.53" y="472.56" width="0" height="0" rx="4" ry="4" fill="black" opacity="1"/></mask></defs><g pointer-events="none" opacity="1" mask=""><path d="M0,945.12L959.06,0" fill="#1d1d1d" stroke="#1d1d1d" stroke-width="4.23" stroke-dasharray="0.03 6.47" stroke-dashoffset="0" stroke-linecap="round" stroke-linejoin="round" pointer-events="stroke"/><g><path d="M 943.57,4.027856175257493 L 959.06,0 954.80,15.424083976863564" fill="none" stroke="#1d1d1d" stroke-width="4.23" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/></g></g></g><g id="22b8d2f8-4364-4ce9-3e92-ab467e7ef399_svg" class="tl-centered-g" transform="translate(1957.93, 613.03) rotate(0.00, 429.04, 165.49)"><defs><mask id="22b8d2f8-4364-4ce9-3e92-ab467e7ef399_clip"><rect x="-100" y="-100" width="1058.07" height="530.97" fill="white"/><rect x="429.03" y="165.48" width="0" height="0" rx="4" ry="4" fill="black" opacity="1"/></mask></defs><g pointer-events="none" opacity="1" mask=""><path d="M0,330.97L858.07,0" fill="#1d1d1d" stroke="#1d1d1d" stroke-width="4.23" stroke-dasharray="0.03 6.49" stroke-dashoffset="0" stroke-linecap="round" stroke-linejoin="round" pointer-events="stroke"/><g><path d="M 842.26,-2.4774773249354034 L 858.07,0 848.02,12.450548374420821" fill="none" stroke="#1d1d1d" stroke-width="4.23" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/></g></g></g><g id="cd47b335-1d8c-4aab-1819-94916a24a073_svg" class="tl-centered-g" transform="translate(2000.00, 579.98) rotate(0.00, 408.00, 17.54)"><defs><mask id="cd47b335-1d8c-4aab-1819-94916a24a073_clip"><rect x="-100" y="-100" width="1016" height="235.07" fill="white"/><rect x="408" y="17.54" width="0" height="0" rx="4" ry="4" fill="black" opacity="1"/></mask></defs><g pointer-events="none" opacity="1" mask=""><path d="M0,35.08L816,0" fill="#1d1d1d" stroke="#1d1d1d" stroke-width="4.23" stroke-dasharray="0.03 6.50" stroke-dashoffset="0" stroke-linecap="round" stroke-linejoin="round" pointer-events="stroke"/><g><path d="M 801.81,-7.397477674912619 L 816,0 802.49,8.587757532008666" fill="none" stroke="#1d1d1d" stroke-width="4.23" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/></g></g></g><g text-align="center" text-anchor="middle" transform="translate(16.00, 1616.00) rotate(0.00, 128.00, 64.00)"><g id="7c3e2a53-cac6-452d-2f0d-359de3569531_svg" class="tl-centered-g"><path d="M87.09,-0.53 Q99.26,-0.45 106.90,-0.41 T122.58,-0.37 138.76,-0.43 155.06,-0.52 171.39,-0.62 187.73,-0.72 204.08,-0.81 220.42,-0.91 236.79,-1.00 249.10,0.82 254.30,9.68 255.54,24.71 255.68,41.07 255.68,57.77 255.82,74.56 256.04,91.38 256.25,108.23 254.49,120.84 245.82,126.16 231.16,127.51 215.23,127.75 198.97,127.76 182.63,127.71 166.26,127.65 149.89,127.58 133.51,127.56 117.14,127.62 100.77,127.72 84.39,127.83 68.02,127.94 51.64,128.04 35.27,128.15 18.87,128.25 6.54,126.43 1.36,117.56 0.17,102.51 0.09,86.14 0.15,69.42 0.08,52.61 -0.08,35.77 -0.22,18.90 1.58,6.28 10.25,0.97 24.88,-0.38 40.79,-0.61 57.02,-0.61 73.33,-0.55 89.67,-0.48 106.01,-0.41 122.35,-0.37 138.70,-0.43 157.84,-0.53 169.00,-0.54 169.37,-0.42 169.68,-0.19 169.90,0.14 170.00,0.51 169.98,0.90 169.84,1.26 169.59,1.56 169.25,1.76 168.88,1.84 168.49,1.80 168.14,1.63 167.85,1.37 167.67,1.02 167.61,0.64 167.67,0.26 167.85,-0.09 168.14,-0.35 168.49,-0.52 168.87,-0.56 169.25,-0.48 169.59,-0.27 169.84,0.02 169.98,0.38 170.00,0.77 169.90,1.14 169.68,1.47 169.37,1.70 169.00,1.83 168.81,1.86 157.84,1.82 138.70,1.75 122.35,1.71 106.01,1.77 89.67,1.86 73.33,1.97 57.03,2.08 40.85,2.25 25.15,2.64 11.37,3.64 4.11,7.46 2.88,18.96 2.67,35.78 2.45,52.61 2.34,69.42 2.47,86.10 2.90,102.29 3.94,116.49 7.71,123.91 18.91,125.04 35.26,125.11 51.64,125.17 68.01,125.24 84.39,125.31 100.76,125.38 117.14,125.45 133.51,125.47 149.89,125.41 166.26,125.30 182.62,125.19 198.96,125.06 215.17,124.88 230.89,124.49 244.70,123.49 251.96,119.67 253.14,108.18 253.30,91.38 253.45,74.57 253.50,57.78 253.31,41.11 252.81,24.95 251.72,10.76 247.92,3.34 236.74,2.20 220.42,2.13 204.08,2.05 187.73,1.98 171.39,1.90 155.06,1.82 138.76,1.75 122.58,1.71 106.90,1.77 93.18,1.86 86.94,1.89 86.66,1.82 86.40,1.69 86.18,1.49 86.02,1.25 85.91,0.98 85.88,0.69 85.91,0.40 86.02,0.13 86.18,-0.11 86.40,-0.30 86.66,-0.44 86.94,-0.51 Z" fill="#1d1d1d" stroke="#1d1d1d" stroke-width="2" pointer-events="none"/></g><text font-size="28px" font-family="Caveat Brush" font-weight="normal" line-height="28px" letter-spacing="-0.03em" text-align="center" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="middle" transform="translate(70.5, 45)" fill="#1d1d1d" transform-origin="center center"><tspan y="14px" x="61.5">ORCA SDK's -</tspan></text></g><g text-align="center" text-anchor="middle" transform="translate(528.00, 1520.00) rotate(0.00, 112.00, 48.00)"><g id="1da70a74-0099-4057-2f5c-317b455ec9c3_svg" class="tl-centered-g"><path d="M87.01,-0.20 Q99.32,-0.12 107.05,-0.14 T122.91,-0.21 139.27,-0.34 155.75,-0.47 172.27,-0.60 188.80,-0.72 205.35,-0.85 217.76,0.92 222.98,8.04 224.25,19.30 224.39,31.33 224.39,43.55 224.52,55.81 224.73,68.10 224.93,80.42 223.17,90.19 214.46,94.77 199.74,95.94 183.76,96.14 167.44,96.14 151.03,96.10 134.60,96.05 118.16,96.04 101.71,96.13 85.27,96.27 68.83,96.41 52.39,96.55 35.94,96.70 19.48,96.83 7.13,95.09 1.87,87.96 0.46,76.68 0.16,64.62 -0.00,52.38 -0.30,40.09 -0.67,27.79 -1.04,15.44 0.62,5.64 9.34,1.05 24.13,-0.11 40.19,-0.29 56.60,-0.28 73.09,-0.22 89.62,-0.16 106.15,-0.14 122.68,-0.21 142.04,-0.35 153.33,-0.38 153.71,-0.26 154.03,-0.01 154.25,0.32 154.36,0.70 154.34,1.10 154.19,1.47 153.93,1.77 153.59,1.98 153.20,2.07 152.80,2.02 152.44,1.86 152.15,1.58 151.96,1.23 151.90,0.84 151.96,0.44 152.15,0.09 152.44,-0.18 152.80,-0.35 153.20,-0.40 153.59,-0.31 153.93,-0.11 154.19,0.20 154.34,0.57 154.36,0.97 154.25,1.35 154.03,1.68 153.71,1.92 153.33,2.05 153.13,2.09 142.04,2.05 122.68,1.99 106.15,1.96 89.62,2.04 73.10,2.18 56.61,2.32 40.24,2.51 24.35,2.88 10.42,3.73 3.15,6.84 2.06,15.47 2.07,27.75 2.07,40.05 2.18,52.34 2.53,64.53 3.17,76.33 4.37,86.69 8.25,92.46 19.52,93.64 35.94,93.70 52.38,93.75 68.82,93.81 85.27,93.87 101.71,93.93 118.15,93.94 134.59,93.85 151.02,93.70 167.43,93.54 183.71,93.34 199.52,92.95 213.37,92.10 220.64,88.98 221.84,80.35 221.99,68.10 222.15,55.82 222.20,43.56 222.02,31.40 221.53,19.62 220.46,9.28 216.63,3.52 205.31,2.34 188.81,2.28 172.28,2.20 155.76,2.13 139.27,2.06 122.91,1.99 107.05,1.96 93.17,2.04 86.87,2.08 86.61,2.01 86.36,1.89 86.16,1.70 86.00,1.48 85.90,1.22 85.87,0.95 85.90,0.68 86.00,0.42 86.15,0.19 86.36,0.01 86.60,-0.12 86.87,-0.19 Z" fill="#36b24d" stroke="#36b24d" stroke-width="2" pointer-events="none"/></g><text font-size="28px" font-family="Caveat Brush" font-weight="normal" line-height="28px" letter-spacing="-0.03em" text-align="center" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="middle" transform="translate(79.5, 29)" fill="#36b24d" transform-origin="center center"><tspan y="14px" x="36.5">Kafka -</tspan></text></g><g id="dba66ca0-8cca-4704-013c-4bd293c69a79_svg" class="tl-centered-g" transform="translate(272.00, 1599.62) rotate(0.00, 120.00, 26.21)"><defs><mask id="dba66ca0-8cca-4704-013c-4bd293c69a79_clip"><rect x="-100" y="-100" width="440" height="252.42" fill="white"/><rect x="120" y="26.21" width="0" height="0" rx="4" ry="4" fill="black" opacity="1"/></mask></defs><g pointer-events="none" opacity="1" mask=""><path d="M-0.20,51.52 Q59.33,38.59 89.09,32.12 T148.61,19.17 208.13,6.21 238.01,-0.28 238.24,-0.26 238.45,-0.16 238.61,-0.00 238.72,0.20 238.76,0.43 238.72,0.66 238.61,0.86 238.44,1.02 238.24,1.11 238.01,1.14 237.78,1.09 237.58,0.97 237.43,0.79 237.35,0.58 237.34,0.35 237.40,0.13 237.53,-0.06 237.71,-0.20 237.93,-0.28 238.16,-0.28 238.38,-0.20 238.56,-0.06 238.69,0.13 238.75,0.35 238.74,0.58 238.66,0.80 238.51,0.97 238.31,1.09 238.20,1.13 208.45,7.65 148.94,20.68 89.44,33.72 29.94,46.78 0.09,53.33 -0.13,53.32 -0.35,53.27 -0.54,53.16 -0.70,53.01 -0.82,52.82 -0.89,52.62 -0.91,52.40 -0.88,52.18 -0.80,51.97 -0.67,51.80 -0.50,51.65 -0.30,51.56 Z" fill="#1d1d1d" stroke="#1d1d1d" stroke-width="2.11" stroke-dasharray="none" stroke-dashoffset="none" stroke-linecap="round" stroke-linejoin="round" pointer-events="stroke"/><g><path d="M 224.75,-4.8589793100848535 L 240,0 228.16,10.772507922904829" fill="none" stroke="#1d1d1d" stroke-width="4.23" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/></g></g></g><g text-align="center" text-anchor="middle" transform="translate(659.96, 1088.00) rotate(0.00, 89.83, 216.00)"><g id="12d69ddd-880d-48af-3748-8da308fa7492_svg" class="tl-centered-g"><defs><mask id="12d69ddd-880d-48af-3748-8da308fa7492_clip"><rect x="-100" y="-100" width="379.66" height="632" fill="white"/><rect x="-29.165000000000006" y="183" width="238" height="66" rx="4" ry="4" fill="black" opacity="1"/></mask></defs><g pointer-events="none" opacity="1" mask="url(#12d69ddd-880d-48af-3748-8da308fa7492_clip)"><path d="M-0.97,431.60 Q43.80,324.08 66.19,270.32 T110.94,162.79 155.69,55.26 178.14,1.37 178.33,1.16 178.58,1.01 178.87,0.95 179.15,0.99 179.41,1.12 179.62,1.32 179.75,1.57 179.79,1.86 179.74,2.14 179.60,2.40 179.39,2.59 179.13,2.71 178.84,2.74 178.56,2.67 178.31,2.52 178.13,2.30 178.03,2.03 178.02,1.74 178.10,1.46 178.26,1.22 178.50,1.05 178.77,0.96 179.06,0.97 179.33,1.06 179.56,1.24 179.72,1.48 179.79,1.76 179.77,2.05 179.74,2.19 157.38,55.97 112.68,163.52 67.99,271.07 23.31,378.62 0.91,432.52 0.76,432.72 0.57,432.88 0.34,432.99 0.09,433.04 -0.16,433.03 -0.40,432.97 -0.62,432.84 -0.80,432.67 -0.94,432.46 -1.02,432.22 -1.05,431.97 -1.01,431.72 Z" fill="#1d1d1d" stroke="#1d1d1d" stroke-width="2.11" stroke-dasharray="none" stroke-dashoffset="none" stroke-linecap="round" stroke-linejoin="round" pointer-events="stroke"/><g><path d="M 166.96,9.721881534260655 L 179.67,0 181.73,15.86611066928773" fill="none" stroke="#1d1d1d" stroke-width="4.23" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/></g></g></g><text font-size="28px" font-family="Caveat Brush" font-weight="normal" line-height="28px" letter-spacing="-0.03em" text-align="left" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="start" transform="translate(-29.159999999999997, 183)" fill="#1d1d1d" transform-origin="center center"><tspan y="14px" x="4">Logs for Logviewer -</tspan><tspan y="42px" x="4"> -(+ Metrics or other data) -</tspan></text></g><g transform="translate(752.00, 1680.00) rotate(0.00, 100.00, 160.00)"><rect width="200" height="320" fill="#fddf8e" rx="3" ry="3"/><text font-size="24px" font-family="Caveat Brush" font-weight="normal" line-height="24px" letter-spacing="-0.03em" text-align="center" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="middle" fill="#0d0d0d" transform="translate(16, 16)"><tspan y="12px" x="88">Can think of -</tspan><tspan y="36px" x="88">alternative solutions -</tspan><tspan y="60px" x="88">to kafka, based on -</tspan><tspan y="84px" x="88">what the sdk -</tspan><tspan y="108px" x="88">supports, - -</tspan><tspan y="132px" x="88"> - -</tspan><tspan y="156px" x="88">But the rest of the -</tspan><tspan y="180px" x="88">pipeline would be -</tspan><tspan y="204px" x="88">mostly unaffected -</tspan><tspan y="228px" x="88">since it ingests into -</tspan><tspan y="252px" x="88">opentel collector any -</tspan><tspan y="276px" x="88">way -</tspan></text></g><g id="27e6df4e-27fc-44ef-3de9-439f9c5c302e_svg" class="tl-centered-g" transform="translate(697.55, 1616.00) rotate(0.00, 28.77, 24.00)"><defs><mask id="27e6df4e-27fc-44ef-3de9-439f9c5c302e_clip"><rect x="-100" y="-100" width="257.55" height="248" fill="white"/><rect x="28.77" y="24" width="0" height="0" rx="2.34" ry="2.34" fill="black" opacity="1"/></mask></defs><g pointer-events="none" opacity="1" mask=""><path d="M0,0L57.55,48" fill="#1d1d1d" stroke="#1d1d1d" stroke-width="4.23" stroke-dasharray="0.03 8.29" stroke-dashoffset="0" stroke-linecap="round" stroke-linejoin="round" pointer-events="stroke"/><g><path d="M 52.03,32.981216702263424 L 57.55,48 41.78,45.268380969384026" fill="none" stroke="#1d1d1d" stroke-width="4.23" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/></g></g></g></svg> \ No newline at end of file diff --git a/openapi/open_api_spec.yaml b/openapi/open_api_spec.yaml index b5bea61af0d..0bc2c1bf437 100644 --- a/openapi/open_api_spec.yaml +++ b/openapi/open_api_spec.yaml @@ -1146,7 +1146,7 @@ paths: capture_on: "2022-09-10T10:11:12Z" amount_to_capture: 6540 amount_capturable: 6540 - amount_recieved: 0 + amount_received: 0 customer_id: "cus_udst2tfldj6upmye2reztkmm4i" email: "[email protected]" name: "John Doe" @@ -3032,7 +3032,7 @@ components: minimum: 100 example: 6540 nullable: true - amount_recieved: + amount_received: type: integer description: The amount which is already captured from the payment minimum: 100 diff --git a/postman/collection.postman.json b/postman/collection.postman.json index 4d1f0b601c8..7e8f391063e 100644 --- a/postman/collection.postman.json +++ b/postman/collection.postman.json @@ -201,7 +201,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -220,7 +220,7 @@ "// Validate status 2xx \npm.test(\"[POST]::/payments - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", "// Validate if response header has matching content-type\npm.test(\"[POST]::/payments - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resPaymentId = jsonData?.payment_id;\n", "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id\nif (_resPaymentId !== undefined) {\n pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);\n console.log(\"- use {{payment_id}} as collection variable for value\",jsonData.payment_id);\n} else {\n console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.');\n};\n", @@ -284,7 +284,7 @@ "// Validate status 2xx \npm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", "// Validate if response header has matching content-type\npm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", "// Validate if response has JSON Body \npm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" + "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" ] } } @@ -447,7 +447,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -466,7 +466,7 @@ "// Validate status 2xx \npm.test(\"[POST]::/payments - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", "// Validate if response header has matching content-type\npm.test(\"[POST]::/payments - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resPaymentId = jsonData?.payment_id;\n", "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id\nif (_resPaymentId !== undefined) {\n pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);\n console.log(\"- use {{payment_id}} as collection variable for value\",jsonData.payment_id);\n} else {\n console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.');\n};\n", @@ -543,7 +543,7 @@ "// Validate status 2xx \npm.test(\"[POST]::/payments/:id - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", "// Validate if response header has matching content-type\npm.test(\"[POST]::/payments/:id - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", "// Validate if response has JSON Body \npm.test(\"[POST]::/payments/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" + "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" ] } } @@ -602,7 +602,7 @@ "// Validate status 2xx \npm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", "// Validate if response header has matching content-type\npm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", "// Validate if response has JSON Body \npm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" + "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" ] } } @@ -672,11 +672,11 @@ "// Validate status 2xx \npm.test(\"[POST]::/payments/:id/capture - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", "// Validate if response header has matching content-type\npm.test(\"[POST]::/payments/:id/capture - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", "// Validate if response has JSON Body \npm.test(\"[POST]::/payments/:id/capture - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id/capture - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id/capture - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Validate status 2xx \npm.test(\"[POST]::/payments/:id/capture - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", "// Validate if response header has matching content-type\npm.test(\"[POST]::/payments/:id/capture - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", "// Validate if response has JSON Body \npm.test(\"[POST]::/payments/:id/capture - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id/capture - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" + "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id/capture - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" ] } } @@ -749,11 +749,11 @@ "// Validate status 2xx \npm.test(\"[POST]::/payments/:id/confirm - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", "// Validate if response header has matching content-type\npm.test(\"[POST]::/payments/:id/confirm - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", "// Validate if response has JSON Body \npm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id/confirm - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id/confirm - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Validate status 2xx \npm.test(\"[POST]::/payments/:id/confirm - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", "// Validate if response header has matching content-type\npm.test(\"[POST]::/payments/:id/confirm - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", "// Validate if response has JSON Body \npm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id/confirm - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" + "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id/confirm - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" ] } } @@ -826,11 +826,11 @@ "// Validate status 2xx \npm.test(\"[POST]::/payments/:id/cancel - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", "// Validate if response header has matching content-type\npm.test(\"[POST]::/payments/:id/cancel - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", "// Validate if response has JSON Body \npm.test(\"[POST]::/payments/:id/cancel - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id/cancel - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id/cancel - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Validate status 2xx \npm.test(\"[POST]::/payments/:id/cancel - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", "// Validate if response header has matching content-type\npm.test(\"[POST]::/payments/:id/cancel - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n", "// Validate if response has JSON Body \npm.test(\"[POST]::/payments/:id/cancel - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id/cancel - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" + "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id/cancel - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n" ] } } @@ -3404,7 +3404,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -3422,7 +3422,7 @@ "exec": [ "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", "// Response body should have \"status\"\npm.test(\"[POST]::/payments - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", @@ -3490,7 +3490,7 @@ "exec": [ "// Validate response status code \npm.test(\"[GET]::/payments/:id - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", "// Response body should have \"status\"\npm.test(\"[GET]::/payments/:id - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", @@ -3745,7 +3745,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": false,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": false,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -3763,7 +3763,7 @@ "exec": [ "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", "// Response body should have \"status\"\npm.test(\"[POST]::/payments - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", @@ -3831,7 +3831,7 @@ "exec": [ "// Validate response status code \npm.test(\"[GET]::/payments/:id - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", "// Response body should have \"status\"\npm.test(\"[GET]::/payments/:id - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", @@ -3901,7 +3901,7 @@ "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resMessage = jsonData?.message;\n", "// Response body should have \"message\"\npm.test(\"[POST]::/refunds - Content check if 'message' exists\", function() {\n pm.expect(_resMessage !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Refund is not allowed for unsuccessfull payment\" for \"message\"\nif (_resMessage !== undefined) {\npm.test(\"[POST]::/refunds - Content check if value for 'message' matches 'Refund is not allowed for unsuccessfull payment'\", function() {\n pm.expect(_resMessage).to.eql(\"Refund is not allowed for unsuccessfull payment\");\n})};\n" + "// Response body should have value \"Refund is not allowed for unsuccessful payment\" for \"message\"\nif (_resMessage !== undefined) {\npm.test(\"[POST]::/refunds - Content check if value for 'message' matches 'Refund is not allowed for unsuccessful payment'\", function() {\n pm.expect(_resMessage).to.eql(\"Refund is not allowed for unsuccessful payment\");\n})};\n" ] } } @@ -3959,7 +3959,7 @@ "exec": [ "// Validate response status code \npm.test(\"[GET]::/payments/:id - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", "// Response body should have \"status\"\npm.test(\"[GET]::/payments/:id - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", @@ -4025,7 +4025,7 @@ "exec": [ "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", "// Response body should have \"status\"\npm.test(\"[POST]::/payments - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", @@ -4093,7 +4093,7 @@ "exec": [ "// Validate response status code \npm.test(\"[GET]::/payments/:id - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", "// Response body should have \"status\"\npm.test(\"[GET]::/payments/:id - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", @@ -4141,7 +4141,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": \"100\",\n \"currency\": \"INR\",\n \"confirm\": true,\n \"capture_method\": \"manual\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": \"100\",\n \"currency\": \"INR\",\n \"confirm\": true,\n \"capture_method\": \"manual\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -4159,7 +4159,7 @@ "exec": [ "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", "// Response body should have \"status\"\npm.test(\"[POST]::/payments - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", @@ -4227,7 +4227,7 @@ "exec": [ "// Validate response status code \npm.test(\"[GET]::/payments/:id - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", "// Response body should have \"status\"\npm.test(\"[GET]::/payments/:id - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", @@ -4293,7 +4293,7 @@ "exec": [ "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", "// Response body should have \"status\"\npm.test(\"[POST]::/payments - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", @@ -4361,7 +4361,7 @@ "exec": [ "// Validate response status code \npm.test(\"[GET]::/payments/:id - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", "// Response body should have \"status\"\npm.test(\"[GET]::/payments/:id - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", @@ -4409,7 +4409,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -4427,7 +4427,7 @@ "exec": [ "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", "// Response body should have \"status\"\npm.test(\"[POST]::/payments - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", @@ -4472,7 +4472,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n },\n \"merchant_id\": \"123\"\n}", + "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n },\n \"merchant_id\": \"123\"\n}", "options": { "raw": { "language": "json" @@ -4535,7 +4535,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"United\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": 6540,\n \"currency\": \"United\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -4598,7 +4598,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -4661,7 +4661,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"Man\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"Man\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -4724,7 +4724,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": \"abc\",\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": \"abc\",\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -4787,7 +4787,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": \"-20\",\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": \"-20\",\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -4850,7 +4850,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card123\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card123\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -4913,7 +4913,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": \"6550\",\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": \"6550\",\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -4976,7 +4976,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -5057,7 +5057,7 @@ "exec": [ "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", "// Response body should have \"status\"\npm.test(\"[POST]::/payments - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", @@ -5108,7 +5108,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -5126,7 +5126,7 @@ "exec": [ "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", "// Response body should have \"status\"\npm.test(\"[POST]::/payments - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", @@ -5177,7 +5177,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"OnsessionCustomer\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"on_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"OnsessionCustomer\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"on_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -5195,7 +5195,7 @@ "exec": [ "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resMandateId = jsonData?.mandate_id;\n", "// Response body should have \"mandate_id\"\npm.test(\"[POST]::/payments - Content check if 'mandate_id' exists\", function() {\n pm.expect(_resMandateId !== undefined).to.be.true;\n});\n", @@ -5240,7 +5240,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"OffsessionCustomer\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"OffsessionCustomer\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -5258,7 +5258,7 @@ "exec": [ "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resMandateId = jsonData?.mandate_id;\n", "// Response body should have \"mandate_id\"\npm.test(\"[POST]::/payments - Content check if 'mandate_id' exists\", function() {\n pm.expect(_resMandateId !== undefined).to.be.true;\n});\n", @@ -5303,7 +5303,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -5366,7 +5366,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -5429,7 +5429,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -5492,7 +5492,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -5562,7 +5562,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -5580,7 +5580,7 @@ "exec": [ "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", "// Response body should have \"status\"\npm.test(\"[POST]::/payments - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", @@ -5648,7 +5648,7 @@ "exec": [ "// Validate response status code \npm.test(\"[GET]::/payments/:id - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", "// Response body should have \"status\"\npm.test(\"[GET]::/payments/:id - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", @@ -5727,7 +5727,7 @@ "exec": [ "// Validate response status code \npm.test(\"[POST]::/payments/:id/confirm - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id/confirm - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id/confirm - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resMessage = jsonData?.message;\n", "// Response body should have \"message\"\npm.test(\"[POST]::/payments/:id/confirm - Content check if 'message' exists\", function() {\n pm.expect(_resMessage !== undefined).to.be.true;\n});\n", @@ -5772,7 +5772,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": false,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": false,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -5790,7 +5790,7 @@ "exec": [ "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", "// Response body should have \"status\"\npm.test(\"[POST]::/payments - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", @@ -5858,7 +5858,7 @@ "exec": [ "// Validate response status code \npm.test(\"[GET]::/payments/:id - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", "// Response body should have \"status\"\npm.test(\"[GET]::/payments/:id - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", @@ -5937,7 +5937,7 @@ "exec": [ "// Validate response status code \npm.test(\"[POST]::/payments/:id/confirm - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id/confirm - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id/confirm - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", "// Response body should have \"status\"\npm.test(\"[POST]::/payments/:id/confirm - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", @@ -6005,7 +6005,7 @@ "exec": [ "// Validate response status code \npm.test(\"[GET]::/payments/:id - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", "// Response body should have \"status\"\npm.test(\"[GET]::/payments/:id - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", @@ -6071,7 +6071,7 @@ "exec": [ "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", "// Response body should have \"status\"\npm.test(\"[POST]::/payments - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", @@ -6139,7 +6139,7 @@ "exec": [ "// Validate response status code \npm.test(\"[GET]::/payments/:id - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", "// Response body should have \"status\"\npm.test(\"[GET]::/payments/:id - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", @@ -6218,7 +6218,7 @@ "exec": [ "// Validate response status code \npm.test(\"[POST]::/payments/:id/confirm - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id/confirm - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id/confirm - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", "// Response body should have \"status\"\npm.test(\"[POST]::/payments/:id/confirm - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", @@ -6269,7 +6269,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": \"100\",\n \"currency\": \"INR\",\n \"confirm\": true,\n \"capture_method\": \"manual\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": \"100\",\n \"currency\": \"INR\",\n \"confirm\": true,\n \"capture_method\": \"manual\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -6287,7 +6287,7 @@ "exec": [ "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", "// Response body should have \"status\"\npm.test(\"[POST]::/payments - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", @@ -6355,7 +6355,7 @@ "exec": [ "// Validate response status code \npm.test(\"[GET]::/payments/:id - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", "// Response body should have \"status\"\npm.test(\"[GET]::/payments/:id - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", @@ -6421,7 +6421,7 @@ "exec": [ "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", "// Response body should have \"status\"\npm.test(\"[POST]::/payments - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", @@ -6489,7 +6489,7 @@ "exec": [ "// Validate response status code \npm.test(\"[GET]::/payments/:id - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", "// Response body should have \"status\"\npm.test(\"[GET]::/payments/:id - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", @@ -6537,7 +6537,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -6555,7 +6555,7 @@ "exec": [ "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", "// Response body should have \"status\"\npm.test(\"[POST]::/payments - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", @@ -6600,7 +6600,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n },\n \"merchant_id\": \"123\"\n}", + "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n },\n \"merchant_id\": \"123\"\n}", "options": { "raw": { "language": "json" @@ -6663,7 +6663,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"United\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": 6540,\n \"currency\": \"United\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -6726,7 +6726,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -6789,7 +6789,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"Man\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"Man\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -6852,7 +6852,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": \"abc\",\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": \"abc\",\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -6915,7 +6915,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": \"-20\",\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": \"-20\",\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -6978,7 +6978,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card123\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card123\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -7041,7 +7041,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": \"6550\",\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": \"6550\",\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -7104,7 +7104,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -7185,7 +7185,7 @@ "exec": [ "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", "// Response body should have \"status\"\npm.test(\"[POST]::/payments - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", @@ -7266,7 +7266,7 @@ "exec": [ "// Validate response status code \npm.test(\"[POST]::/payments/:id - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[POST]::/payments/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", "// Response body should have \"status\"\npm.test(\"[POST]::/payments/:id - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", @@ -7347,7 +7347,7 @@ "exec": [ "// Validate response status code \npm.test(\"[POST]::/payments/:id - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[POST]::/payments/:id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments/:id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", "// Response body should have \"status\"\npm.test(\"[POST]::/payments/:id - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", @@ -7398,7 +7398,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"mandate_id\": \"mandate_iwer89rnjef349dni3\",\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -7416,7 +7416,7 @@ "exec": [ "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resStatus = jsonData?.status;\n", "// Response body should have \"status\"\npm.test(\"[POST]::/payments - Content check if 'status' exists\", function() {\n pm.expect(_resStatus !== undefined).to.be.true;\n});\n", @@ -7437,9 +7437,9 @@ }, { "id": "535b66dc-ce0a-452a-a3b0-187fa82fa6fb", - "name": "Payments - Update[Update Succeded payment]", + "name": "Payments - Update[Update Succeeded payment]", "request": { - "name": "Payments - Update[Update Succeded payment]", + "name": "Payments - Update[Update Succeeded payment]", "description": { "content": "To update the properties of a PaymentIntent object. This may include attaching a payment method, or attaching customer object or metadata fields after the Payment is created ", "type": "text/plain" @@ -7549,7 +7549,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"OnsessionCustomer\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"on_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"OnsessionCustomer\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"on_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -7567,7 +7567,7 @@ "exec": [ "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resMandateId = jsonData?.mandate_id;\n", "// Response body should have \"mandate_id\"\npm.test(\"[POST]::/payments - Content check if 'mandate_id' exists\", function() {\n pm.expect(_resMandateId !== undefined).to.be.true;\n});\n", @@ -7612,7 +7612,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"OffsessionCustomer\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"OffsessionCustomer\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -7630,7 +7630,7 @@ "exec": [ "// Validate response status code \npm.test(\"[POST]::/payments - Response status code is 200\", function () {\n pm.expect(pm.response.code).to.equal(200);\n});\n", "// Validate if response has JSON Body \npm.test(\"[POST]::/payments - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n", - "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_recieved\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", + "// Response Validation\nconst schema = {\"oneOf\":[{\"type\":\"object\",\"required\":[\"payment_id\",\"status\",\"amount\",\"currency\",\"mandate_id\"],\"description\":\"Payment Response\",\"properties\":{\"payment_id\":{\"type\":\"string\",\"description\":\"Unique Identifier for the Payment. It is always recommended to provide this ID while creating a payment.\\nIf the identifiers in not provided in the Payment Request, this filed shall be auto generated and provide in the API response. It is suggested to keep the payment_id length as a maximum of 30 alphanumeric characters irrespective of payment methods and gateways. \\nSequential and only numeric characters are not recommended.\\n\",\"maxLength\":30,\"example\":\"pay_mbabizu24mvu3mela5njyhpit4\"},\"status\":{\"type\":\"string\",\"description\":\"The status of the payment\",\"enum\":[\"succeeded\",\"failed\",\"processing\",\"requires_customer_action\",\"requires_payment_method\",\"requires_confirmation\",\"required_capture\"],\"example\":\"succeeded\"},\"amount\":{\"type\":\"integer\",\"description\":\"The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\n\",\"minimum\":100,\"example\":6540},\"currency\":{\"type\":\"string\",\"description\":\"The three-letter ISO currency code\\n\",\"example\":\"USD\",\"maxLength\":3,\"minLength\":3},\"cancellation_reason\":{\"type\":[\"string\",\"null\"],\"description\":\"The reason for cancelling the payment\",\"maxLength\":255,\"example\":\"Payment attempt expired\"},\"capture_method\":{\"type\":\"string\",\"description\":\"This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method. Capture request may happen in three types: (1) AUTOMATIC: Post the payment authorization, the capture will be executed on the full amount immediately, (2) MANUAL: The capture will happen only if the merchant triggers a Capture API request, (3) SCHEDULED: The capture can be scheduled to automatically get triggered at a specific date & time\",\"enum\":[\"automatic\",\"manual\",\"scheduled\"],\"default\":\"automatic\",\"example\":\"automatic\"},\"capture_on\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the payment should be captured.\\nProviding this field will automatically set `capture` to true\\n\",\"allOf\":[{\"type\":\"string\",\"description\":\"ISO 8601 timestamp\",\"format\":\"date-time\"}]},\"amount_to_capture\":{\"type\":[\"integer\",\"null\"],\"description\":\"The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\\nIf not provided, the default amount_to_capture will be the payment amount.\\n\",\"minimum\":100,\"example\":6540},\"amount_capturable\":{\"type\":[\"integer\",\"null\"],\"description\":\"The maximum amount that could be captured from the payment\",\"minimum\":100,\"example\":6540},\"amount_received\":{\"type\":[\"integer\",\"null\"],\"description\":\"The amount which is already captured from the payment\",\"minimum\":100,\"example\":6540},\"customer_id\":{\"type\":[\"string\",\"null\"],\"description\":\"The identifier for the customer object. If not provided the customer ID will be autogenerated.\",\"maxLength\":255,\"example\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"},\"email\":{\"type\":[\"string\",\"null\"],\"format\":\"email\",\"description\":\"The customer's email address\",\"maxLength\":255,\"example\":\"[email protected]\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's name\",\"maxLength\":255,\"example\":\"John Test\"},\"phone\":{\"type\":[\"string\",\"null\"],\"description\":\"The customer's phone number\",\"maxLength\":255,\"example\":9999999999},\"phone_country_code\":{\"type\":[\"string\",\"null\"],\"description\":\"The country code for the customer phone number\",\"maxLength\":255,\"example\":\"+65\"},\"client_secret\":{\"type\":[\"string\",\"null\"],\"description\":\"This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK\",\"example\":\"secret_k2uj3he2893ein2d\",\"maxLength\":30,\"minLength\":30},\"description\":{\"type\":[\"string\",\"null\"],\"description\":\"A description of the payment\",\"maxLength\":255,\"example\":\"Its my first payment request\"},\"setup_future_usage\":{\"type\":\"string\",\"description\":\"Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.\",\"enum\":[\"on_session\",\"off_session\"],\"example\":\"off_session\"},\"off_session\":{\"type\":\"boolean\",\"description\":\"Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.\",\"example\":true},\"mandate_id\":{\"type\":\"string\",\"description\":\"ID of the mandate used for this payment. This parameter can only be used with confirm = true. This parameter should be passed for Merchant Initiated Transaction scenarios where the user has already registered for a mandate and raw payment method details are not passed\",\"example\":\"mandate_iwer89rnjef349dni3\"},\"mandate_data\":{\"type\":\"object\",\"description\":\"This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.\",\"properties\":{\"customer_acceptance\":{\"type\":\"object\",\"description\":\"Details about the customer’s acceptance.\",\"properties\":{\"accepted_at\":{\"description\":\"A timestamp (ISO 8601 code) that determines when the refund was created.\",\"type\":\"string\",\"format\":\"date-time\"},\"online\":{\"type\":\"object\",\"description\":\"If this is a Mandate accepted online, this hash contains details about the online acceptance.\",\"properties\":{\"ip_address\":{\"type\":\"string\",\"description\":\"The IP address from which the Mandate was accepted by the customer.\",\"example\":\"127.0.0.1\"},\"user_agent\":{\"type\":\"string\",\"description\":\"The user agent of the browser from which the Mandate was accepted by the customer.\",\"example\":\"device\"}}},\"acceptance_type\":{\"type\":\"string\",\"description\":\"The type of customer acceptance information included with the Mandate. One of online or offline.\",\"enum\":[\"online\",\"offline\"],\"example\":\"online\"}}}}},\"authentication_type\":{\"type\":\"string\",\"description\":\"The transaction authentication can be set to undergo payer authentication. Possible values are: (i) THREE_DS: If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuer, (ii) NO_THREE_DS: 3DS based authentication will not be activated. The liability of chargeback stays with the merchant. By default, the authentication will be marked as NO_THREE_DS\",\"enum\":[\"three_ds\",\"no_three_ds\"],\"default\":\"no_three_ds\",\"example\":\"no_three_ds\"},\"billing\":{\"type\":[\"object\",\"null\"],\"description\":\"The billing address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"shipping\":{\"type\":[\"object\",\"null\"],\"description\":\"The shipping address for the payment\",\"properties\":{\"line1\":{\"type\":\"string\",\"description\":\"The first line of the address\",\"maxLength\":200,\"example\":\"Juspay Router\"},\"line2\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Koramangala\"},\"line3\":{\"type\":\"string\",\"description\":\"The second line of the address\",\"maxLength\":200,\"example\":\"Stallion\"},\"city\":{\"type\":\"string\",\"description\":\"The address city\",\"maxLength\":50,\"example\":\"Bangalore\"},\"state\":{\"type\":\"string\",\"description\":\"The address state\",\"maxLength\":50,\"example\":\"Karnataka\"},\"zip\":{\"type\":\"string\",\"description\":\"The address zip/postal code\",\"maxLength\":50,\"example\":\"560095\"},\"country\":{\"type\":\"string\",\"description\":\"The two-letter ISO country code\",\"example\":\"IN\",\"maxLength\":2,\"minLength\":2}}},\"statement_descriptor_name\":{\"type\":[\"string\",\"null\"],\"description\":\"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.\",\"maxLength\":255,\"example\":\"Juspay Router\"},\"statement_descriptor_suffix\":{\"type\":[\"string\",\"null\"],\"description\":\"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.\",\"maxLength\":255,\"example\":\"Payment for shoes purchase\"},\"next_action\":{\"type\":\"object\",\"description\":\"Provides information about the user action required to complete the payment.\",\"properties\":{\"redirect_to_url\":{\"type\":\"string\",\"description\":\"The URL to which the customer needs to be redirected for completing the payment.\",\"example\":\"https://pg-redirect-page.com\"},\"display_qr_code\":{\"type\":\"string\",\"description\":\"The QR code data to be displayed to the customer.\",\"example\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAA1AQAAAADJnZ7dAAABs0lEQVR4nAGoAVf+AgFqqzCrHAACfO2eCXLx8ALIuWcFE2AgAgDMJY+7KAACAMP1N48IAAI4wJ9v8kDgAoT27OLpdxAC/g8wHJSz+ALG5FSP+HnIAt7Si9v6m+AC+hZxUPoJWAKN7C4q3rTAAi/TeN30+6ACMYHnWkM8uALzviwJR9UIAs36kzcuuqACxsgBlqjsSAJrqdLoS4QAAimoq+YS7zgCM3EsnwNXeALqzAWMrDxgAnp3ZKuU/qACbmkC+I8riALKwNCjMUMoAs3w0GTalKgCdysPb\"},\"invoke_payment_app\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"invoke_sdk_client\":{\"type\":\"object\",\"description\":\"Contains the data for invoking the sdk client for completing the payment.\",\"example\":{\"sdk_name\":\"gpay\",\"sdk_params\":{\"param1\":\"value\",\"param2\":\"value\"},\"intent_uri\":\"upi://pay?pa=hhferf@abc&pn=merchant%20com&mc=5815&tid=pnf20200807108614390166&tr=20200807108614390166&tn=Transaction_Note&am=1&cu=INR\"}},\"trigger_api\":{\"type\":\"object\",\"description\":\"Provides the instructions on the next API to be triggered to complete the payment. This is applicable in cases wherein the merchant has to display a UI to the user for collecting information such as OTP, 2factor authentication details.\",\"example\":{\"api_name\":\"submit_otp\",\"doc\":\"https://router.juspay.io/api-reference/submit_otp\"}}}},\"metadata\":{\"type\":[\"object\",\"null\"],\"description\":\"You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\",\"maxLength\":255,\"example\":{\"city\":\"NY\",\"unit\":\"245\"}}}}]}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/payments - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n", "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resMandateId = jsonData?.mandate_id;\n", "// Response body should have \"mandate_id\"\npm.test(\"[POST]::/payments - Content check if 'mandate_id' exists\", function() {\n pm.expect(_resMandateId !== undefined).to.be.true;\n});\n", @@ -7675,7 +7675,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -7738,7 +7738,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -7801,7 +7801,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -7864,7 +7864,7 @@ "method": "POST", "body": { "mode": "raw", - "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"ea dout amet veniamconsequatco\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", + "raw": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"pay_mbabizu24mvu3mela5njyhpit4\",\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2003-10-22T01:21:42.284Z\",\n \"amount_to_capture\": 6540,\n \"customer_id\": \"cus_y3oqhf46pyzuxjbcn2giaqnb44\",\n \"description\": \"Its my first payment request\",\n \"email\": \"[email protected]\",\n \"name\": \"John Test\",\n \"phone\": \"culpa non Duis\",\n \"phone_country_code\": \"+65\",\n \"return_url\": \"https://juspay.io/\",\n \"setup_future_usage\": \"off_session\",\n \"off_session\": true,\n \"mandate_data\": {\n \"customer_acceptance\": {\n \"accepted_at\": \"1965-09-27T13:50:59.144Z\",\n \"online\": {\n \"ip_address\": \"127.0.0.1\",\n \"user_agent\": \"device\"\n },\n \"acceptance_type\": \"online\"\n }\n },\n \"authentication_type\": \"no_three_ds\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"1234 1234 1234 1234\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"John Doe\",\n \"card_cvc\": \"123\",\n \"card_token\": \"dolore cupidatat exinadipisici\"\n }\n },\n \"billing\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"shipping\": {\n \"line1\": \"Juspay Router\",\n \"line2\": \"Koramangala\",\n \"line3\": \"Stallion\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\",\n \"zip\": \"560095\",\n \"country\": \"IN\"\n },\n \"statement_descriptor_name\": \"Juspay Router\",\n \"statement_descriptor_suffix\": \"Payment for shoes purchase\",\n \"metadata\": {\n \"city\": \"NY\",\n \"unit\": \"245\"\n }\n}", "options": { "raw": { "language": "json" @@ -8163,7 +8163,7 @@ "// Set response object as internal variable\nlet jsonData = {};\ntry {jsonData = pm.response.json();}catch(e){}\n", "// Set property value as variable\nconst _resMessage = jsonData?.message;\n", "// Response body should have \"message\"\npm.test(\"[POST]::/refunds - Content check if 'message' exists\", function() {\n pm.expect(_resMessage !== undefined).to.be.true;\n});\n", - "// Response body should have value \"Refund is not allowed for unsuccessfull payment\" for \"message\"\nif (_resMessage !== undefined) {\npm.test(\"[POST]::/refunds - Content check if value for 'message' matches 'Refund is not allowed for unsuccessfull payment'\", function() {\n pm.expect(_resMessage).to.eql(\"Refund is not allowed for unsuccessfull payment\");\n})};\n" + "// Response body should have value \"Refund is not allowed for unsuccessful payment\" for \"message\"\nif (_resMessage !== undefined) {\npm.test(\"[POST]::/refunds - Content check if value for 'message' matches 'Refund is not allowed for unsuccessful payment'\", function() {\n pm.expect(_resMessage).to.eql(\"Refund is not allowed for unsuccessful payment\");\n})};\n" ] } } diff --git a/postman/portman-config.json b/postman/portman-config.json index 6db827e975a..cdfb2b65944 100644 --- a/postman/portman-config.json +++ b/postman/portman-config.json @@ -1890,7 +1890,7 @@ "responseBodyTests": [ { "key": "message", - "value": "Refund is not allowed for unsuccessfull payment" + "value": "Refund is not allowed for unsuccessful payment" } ] } @@ -3623,7 +3623,7 @@ "openApiResponse": "400", "variations": [ { - "name": "Update Succeded payment", + "name": "Update Succeeded payment", "overwrites": [ { "overwriteRequestPathVariables": [ diff --git a/scripts/add_connector.sh b/scripts/add_connector.sh index ba3d80642a5..494cc4a87e8 100644 --- a/scripts/add_connector.sh +++ b/scripts/add_connector.sh @@ -33,7 +33,7 @@ cd $conn/ # generate template files for the connector cargo install cargo-generate cargo gen-pg $pg -# move sub files and test files to appropiate folder +# move sub files and test files to appropriate folder mv $pg/mod.rs $pg.rs mv $pg/test.rs ${tests}/$pg.rs # remove changes from tests if already done for this connector
chore
fix typos and introduce ci check (#390)
03423a1f76d324453052da985f998fd3f957ce90
2024-11-26 13:46:56
Mani Chandra
feat(users): Send welcome to community email in magic link signup (#6639)
false
diff --git a/crates/router/src/consts/user.rs b/crates/router/src/consts/user.rs index aa427992082..32ca4ad31d7 100644 --- a/crates/router/src/consts/user.rs +++ b/crates/router/src/consts/user.rs @@ -41,3 +41,5 @@ pub const EMAIL_SUBJECT_INVITATION: &str = "You have been invited to join Hypers pub const EMAIL_SUBJECT_MAGIC_LINK: &str = "Unlock Hyperswitch: Use Your Magic Link to Sign In"; pub const EMAIL_SUBJECT_RESET_PASSWORD: &str = "Get back to Hyperswitch - Reset Your Password Now"; pub const EMAIL_SUBJECT_NEW_PROD_INTENT: &str = "New Prod Intent"; +pub const EMAIL_SUBJECT_WELCOME_TO_COMMUNITY: &str = + "Thank you for signing up on Hyperswitch Dashboard!"; diff --git a/crates/router/src/core/user.rs b/crates/router/src/core/user.rs index bff6205f5db..eedd9ac5672 100644 --- a/crates/router/src/core/user.rs +++ b/crates/router/src/core/user.rs @@ -246,26 +246,41 @@ pub async fn connect_account( ) .await?; - let email_contents = email_types::VerifyEmail { + let magic_link_email = email_types::VerifyEmail { recipient_email: domain::UserEmail::from_pii_email(user_from_db.get_email())?, settings: state.conf.clone(), subject: consts::user::EMAIL_SUBJECT_SIGNUP, auth_id, }; - let send_email_result = state + let magic_link_result = state .email_client .compose_and_send_email( - Box::new(email_contents), + Box::new(magic_link_email), state.conf.proxy.https_url.as_ref(), ) .await; - logger::info!(?send_email_result); + logger::info!(?magic_link_result); + + let welcome_to_community_email = email_types::WelcomeToCommunity { + recipient_email: domain::UserEmail::from_pii_email(user_from_db.get_email())?, + subject: consts::user::EMAIL_SUBJECT_WELCOME_TO_COMMUNITY, + }; + + let welcome_email_result = state + .email_client + .compose_and_send_email( + Box::new(welcome_to_community_email), + state.conf.proxy.https_url.as_ref(), + ) + .await; + + logger::info!(?welcome_email_result); return Ok(ApplicationResponse::Json( user_api::ConnectAccountResponse { - is_email_sent: send_email_result.is_ok(), + is_email_sent: magic_link_result.is_ok(), user_id: user_from_db.get_user_id().to_string(), }, )); diff --git a/crates/router/src/services/email/assets/welcome_to_community.html b/crates/router/src/services/email/assets/welcome_to_community.html new file mode 100644 index 00000000000..05f7fac1d55 --- /dev/null +++ b/crates/router/src/services/email/assets/welcome_to_community.html @@ -0,0 +1,306 @@ +<!DOCTYPE html> +<html lang="en"> + +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>Email Template</title> + <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap" rel="stylesheet"> + <style> + @media only screen and (max-width: 600px) { + .card-container { + display: block !important; + width: 100% !important; + padding: 0 !important; + } + + .card { + width: 100% !important; + max-width: 100% !important; + margin-bottom: 15px !important; + display: block !important; + box-sizing: border-box; + } + + .repocard, + .communitycard, + .devdocs-card { + width: 100% !important; + padding: 0 !important; + margin-bottom: 10px !important; + } + + .card-content { + width: 100% !important; + max-width: 100% !important; + height: auto !important; + min-height: 100px !important; + padding: 20px 0 0 20px !important; + box-sizing: border-box; + } + + + .docscard-content { + width: 100% !important; + max-width: 100% !important; + height: auto !important; + min-height: 100px !important; + padding: 0 20px 0 20px !important; + box-sizing: border-box; + } + + .divider { + width: 100% !important; + padding: 0 !important; + } + + .footer-section { + text-align: center !important; + margin: 0 auto; + width: 100%; + } + + td.card-container, + td.card { + width: 100% !important; + padding: 0 !important; + display: block !important; + } + + .logo-section { + text-align: center !important; + width: 100% !important; + } + + .logo-section img { + display: block; + margin: 0 auto; + } + } + + a.card-link { + text-decoration: none !important; + color: inherit !important; + } + + .card-content td { + color: #151A1F !important; + } + + .card-content td img { + display: block !important; + } + </style> +</head> + +<body style="margin: 0; padding: 0; background-color: #f6f6f8; font-family: 'Inter', Arial, sans-serif;"> + <center> + <table width="100%" cellspacing="0" cellpadding="0" + style="border-spacing: 0; margin: 0; padding: 0; background-color: #f6f6f8;"> + <tr> + <td align="center"> + <table role="presentation" width="600" cellspacing="0" cellpadding="0" class="container" + style="max-width: 600px; background-color: #ffffff; border-radius: 10px; border-collapse: collapse;"> + + <!-- Header Section --> + <tr> + <td align="center" bgcolor="#283652" + style="padding: 40px 30px; color: white; border-top-left-radius: 20px; border-top-right-radius: 20px;"> + <table width="100%" role="presentation" cellspacing="0" cellpadding="0"> + <tr> + <td align="left"> + <img src="https://app.hyperswitch.io/assets/welcome-email/logotext.png" + alt="Hyperswitch Logo" width="150" + style="display: block; margin-bottom: 20px;"> + </td> + </tr> + <tr> + <td align="left" + style="font-size: 36px; line-height: 40px; font-weight: 500; color: white;"> + Welcome to + <span style="font-weight: 700;">Hyperswitch</span> + <img src="https://app.hyperswitch.io/assets/welcome-email/star.png" + alt="Star Icon" width="30" + style="display: inline-block; vertical-align: middle; position: relative; top: -3px; margin-left: -2px;"> + </td> + </tr> + </table> + </td> + </tr> + + <!-- Body Section --> + <tr> + <td align="left" + style="padding: 30px; background-color: #FFFFFF; color: #151A1F; font-size: 16px; font-family: 'Inter', Arial, sans-serif; font-weight: 400; line-height: 23.68px; text-align: left;"> + <p style="margin-bottom: 20px; font-weight: 500;">Hello,</p> + <p style="margin-bottom: 20px;">I wanted to reach out and introduce our community to + you.</p> + <p style="margin-bottom: 20px;">I’m Neeraj. I work in Community Growth here at + Hyperswitch. We are a bunch of passionate people solving for payment diversity, + complexity, and innovation. Juspay, our parent organization, processes 125 Mn + transactions every day and has been providing payment platform solutions to large + digital enterprises for the past 12 years. We wish to empower global businesses to + expand their reach and enhance customer experiences through diverse payment + solutions.</p> + <p style="margin-bottom: 20px;">Our mission is to provide a Fast, Reliable, Affordable & + Transparent payments platform, allowing businesses the flexibility to choose between + open-source and SaaS solution.</p> + </td> + </tr> + + <!-- CTA Cards Section (GitHub & Slack) --> + <tr> + <td align="center" style="padding: 0 30px;"> + <table width="100%" cellspacing="0" cellpadding="0"> + <tr> + <!-- GitHub Repo Card --> + <td width="50%" class="card" valign="top" style="padding-right: 10px;"> + <a href="https://github.com/juspay/hyperswitch" target="_blank" + class="card-link"> + <table class="card-content" width="100%" cellspacing="0" cellpadding="0" + style="background-color: #F6F6F6; border-radius: 16px; padding: 20px 0 0 20px;"> + <tr> + <td align="left" + style="vertical-align: top; font-size: 22px; font-weight: 600; padding-right: 20px;"> + Star <br /> our repo + </td> + <td align="right" + style="vertical-align: top; padding: 0 20px 0 0;"> + <img src="https://app.hyperswitch.io/assets/welcome-email/repoArrow.png" + alt="Arrow Icon" width="24" height="24" + style="border-radius: 50%; padding: 7px; background-color: #fff;"> + </td> + </tr> + <tr> + <td colspan="2" align="right"> + <img src="https://app.hyperswitch.io/assets/welcome-email/github-logo1.png" + alt="GitHub Icon" width="98" height="98" + style="display: block;"> + </td> + </tr> + </table> + </a> + </td> + + <!-- Slack Community Card --> + <td width="50%" class="card" valign="top" style="padding-left: 10px;"> + <a href="https://hyperswitch-io.slack.com/join/shared_invite/zt-2jqxmpsbm-WXUENx022HjNEy~Ark7Orw#/shared-invite/email" + target="_blank" class="card-link"> + <table class="card-content" width="100%" cellspacing="0" cellpadding="0" + style="background-color: #F6F6F6; border-radius: 16px; padding: 20px 0 0 20px;"> + <tr> + <td align="left" + style="vertical-align: top; font-size: 22px; font-weight: 600; padding-right: 20px;"> + Join our <br /> Community + </td> + <td align="right" + style="vertical-align: top; padding: 0 20px 0 0;"> + <img src="https://app.hyperswitch.io/assets/welcome-email/communityArrow.png" + alt="Arrow Icon" width="24" height="24" + style="border-radius: 50%; padding: 7px; background-color: #fff;"> + </td> + </tr> + <tr> + <td colspan="2" align="right"> + <img src="https://app.hyperswitch.io/assets/welcome-email/slack.png" + alt="Slack Icon" width="98" height="98" + style="display: block;"> + </td> + </tr> + </table> + </a> + </td> + </tr> + </table> + </td> + </tr> + + <!-- Read Dev Docs Section --> + <tr> + <td style="padding: 10px 30px 0 30px ;"> + <a href="https://api-reference.hyperswitch.io/introduction" target="_blank" + class="card-link"> + <table class="docscard-content" width="100%" cellspacing="0" cellpadding="0" + style="background-color: #FFEFEF; border-radius: 16px; padding: 20px;"> + <tr> + <td style="vertical-align: middle;"> + <table> + <tr> + <td style="vertical-align: middle;"> + <img src="https://app.hyperswitch.io/assets/welcome-email/docs.png" + alt="docs icon" width="24" height="29" + style="margin-right: 10px;"> + </td> + <td style="vertical-align: middle;"> + <span style="font-size: 22px; font-weight: 600;">Read dev + docs</span> + </td> + </tr> + </table> + </td> + <td align="right" style="vertical-align: middle;"> + <img src="https://app.hyperswitch.io/assets/welcome-email/docsArrow.png" + alt="Arrow Icon" width="24" height="24" + style="border-radius: 50%; padding: 7px; background-color: #fff;"> + </td> + </tr> + </table> + </a> + </td> + </tr> + + <!-- Divider and Footer Section --> + <tr> + <td style="padding: 40px 0 0 0;"> + <!-- Divider (Top Border) --> + <table width="100%" class="divider" cellpadding="0" cellspacing="0" + style="border-top: 1px solid #F2F2F2;"> + <tr> + <td align="center"> + <table cellspacing="0" cellpadding="0" + style="margin: 0 auto; padding: 30px 0; max-width: 378px; width: 100%;"> + <tr> + <td align="center" style="padding: 0;" class="logo-section"> + <img src="https://app.hyperswitch.io/assets/welcome-email/logo.png" + alt="Icon" width="82" height="40" style="display: block;"> + </td> + </tr> + </table> + </td> + </tr> + </table> + </td> + </tr> + + </table> + </td> + </tr> + + <!-- Footer Section with max-width 600px --> + <tr> + <td align="center" style="padding: 16px 4px 0 4px; background-color: #f6f6f8;"> + <table width="100%" cellspacing="0" cellpadding="0" style="max-width: 601px;"> + <tr> + <!-- Follow us on and Social Media Icons --> + <td align="left" + style="font-family: 'Inter', Arial, sans-serif; font-size: 12px; font-weight: 500; line-height: 16px; color: #63605F;"> + Follow us on + <a href="https://x.com/hyperswitchio" + style="margin-right: 10px; text-decoration: none;"> + <img src="https://app.hyperswitch.io/assets/welcome-email/twitter.png" alt="Twitter" + width="14" height="14" style="vertical-align: -3px;"> + </a> + <a href="https://www.linkedin.com/company/hyperswitch/" style="text-decoration: none;"> + <img src="https://app.hyperswitch.io/assets/welcome-email/linkedin.png" + alt="LinkedIn" width="13.33" height="13.33" style="vertical-align: -3px;"> + </a> + </td> + </tr> + </table> + </td> + </tr> + </table> + </center> +</body> + +</html> diff --git a/crates/router/src/services/email/types.rs b/crates/router/src/services/email/types.rs index cedd17828f1..d092afdc5de 100644 --- a/crates/router/src/services/email/types.rs +++ b/crates/router/src/services/email/types.rs @@ -57,6 +57,7 @@ pub enum EmailBody { api_key_name: String, prefix: String, }, + WelcomeToCommunity, } pub mod html { @@ -145,6 +146,9 @@ Email : {user_email} prefix = prefix, expires_in = expires_in, ), + EmailBody::WelcomeToCommunity => { + include_str!("assets/welcome_to_community.html").to_string() + } } } } @@ -505,3 +509,21 @@ impl EmailData for ApiKeyExpiryReminder { }) } } + +pub struct WelcomeToCommunity { + pub recipient_email: domain::UserEmail, + pub subject: &'static str, +} + +#[async_trait::async_trait] +impl EmailData for WelcomeToCommunity { + async fn get_email_data(&self) -> CustomResult<EmailContents, EmailError> { + let body = html::get_html_body(EmailBody::WelcomeToCommunity); + + Ok(EmailContents { + subject: self.subject.to_string(), + body: external_services::email::IntermediateString::new(body), + recipient: self.recipient_email.clone().into_inner(), + }) + } +}
feat
Send welcome to community email in magic link signup (#6639)
18b84c428f2732f4f468cdf4ec6f91154d637883
2023-04-11 14:21:05
Nishant Joshi
feat(process_tracker): changing runner selection to dyn dispatch (#853)
false
diff --git a/crates/router/src/scheduler.rs b/crates/router/src/scheduler.rs index acee091e784..a08cfc2908b 100644 --- a/crates/router/src/scheduler.rs +++ b/crates/router/src/scheduler.rs @@ -24,7 +24,9 @@ pub async fn start_process_tracker( ) -> CustomResult<(), errors::ProcessTrackerError> { match scheduler_flow { SchedulerFlow::Producer => producer::start_producer(state, scheduler_settings).await?, - SchedulerFlow::Consumer => consumer::start_consumer(state, scheduler_settings).await?, + SchedulerFlow::Consumer => { + consumer::start_consumer(state, scheduler_settings, workflows::runner_from_task).await? + } SchedulerFlow::Cleaner => { error!("This flow has not been implemented yet!"); } diff --git a/crates/router/src/scheduler/consumer.rs b/crates/router/src/scheduler/consumer.rs index a2e36d0e98c..b41744c892d 100644 --- a/crates/router/src/scheduler/consumer.rs +++ b/crates/router/src/scheduler/consumer.rs @@ -36,6 +36,7 @@ pub fn valid_business_statuses() -> Vec<&'static str> { pub async fn start_consumer( state: &AppState, settings: sync::Arc<settings::SchedulerSettings>, + workflow_selector: workflows::WorkflowSelectorFn, ) -> CustomResult<(), errors::ProcessTrackerError> { use std::time::Duration; @@ -78,6 +79,7 @@ pub async fn start_consumer( logger::error!(%err); }, sync::Arc::clone(&consumer_operation_counter), + workflow_selector, )); } Ok(()) | Err(oneshot::error::TryRecvError::Closed) => { @@ -108,6 +110,7 @@ pub async fn start_consumer( pub async fn consumer_operations( state: &AppState, settings: &settings::SchedulerSettings, + workflow_selector: workflows::WorkflowSelectorFn, ) -> CustomResult<(), errors::ProcessTrackerError> { let stream_name = settings.stream.clone(); let group_name = settings.consumer.consumer_group.clone(); @@ -135,7 +138,7 @@ pub async fn consumer_operations( pt_utils::add_histogram_metrics(&pickup_time, task, &stream_name); metrics::TASK_CONSUMED.add(&metrics::CONTEXT, 1, &[]); - let runner = pt_utils::runner_from_task(task)?; + let runner = workflow_selector(task)?.ok_or(errors::ProcessTrackerError::UnexpectedFlow)?; handler.push(tokio::task::spawn(start_workflow( state.clone(), task.clone(), @@ -190,21 +193,21 @@ pub async fn fetch_consumer_tasks( } // Accept flow_options if required -#[instrument(skip(state), fields(workflow_id))] +#[instrument(skip(state, runner), fields(workflow_id))] pub async fn start_workflow( state: AppState, process: storage::ProcessTracker, _pickup_time: PrimitiveDateTime, - runner: workflows::PTRunner, + runner: Box<dyn ProcessTrackerWorkflow>, ) { tracing::Span::current().record("workflow_id", Uuid::new_v4().to_string()); - workflows::perform_workflow_execution(&state, process, runner).await + run_executor(&state, process, runner).await } -pub async fn run_executor<'a>( - state: &'a AppState, +pub async fn run_executor( + state: &AppState, process: storage::ProcessTracker, - operation: &(impl ProcessTrackerWorkflow + Send + Sync), + operation: Box<dyn ProcessTrackerWorkflow>, ) { let output = operation.execute_workflow(state, process.clone()).await; match output { diff --git a/crates/router/src/scheduler/utils.rs b/crates/router/src/scheduler/utils.rs index dba7992318e..24ddf6b2a86 100644 --- a/crates/router/src/scheduler/utils.rs +++ b/crates/router/src/scheduler/utils.rs @@ -19,7 +19,6 @@ use crate::{ self, enums::{self, ProcessTrackerStatus}, }, - utils::{OptionExt, StringExt}, }; pub async fn divide_and_append_tasks( @@ -246,6 +245,7 @@ pub async fn consumer_operation_handler<E>( settings: sync::Arc<SchedulerSettings>, error_handler_fun: E, consumer_operation_counter: sync::Arc<atomic::AtomicU64>, + workflow_selector: workflows::WorkflowSelectorFn, ) where // Error handler function E: FnOnce(error_stack::Report<errors::ProcessTrackerError>), @@ -253,7 +253,7 @@ pub async fn consumer_operation_handler<E>( consumer_operation_counter.fetch_add(1, atomic::Ordering::Release); let start_time = std_time::Instant::now(); - match consumer::consumer_operations(&state, &settings).await { + match consumer::consumer_operations(&state, &settings, workflow_selector).await { Ok(_) => (), Err(err) => error_handler_fun(err), } @@ -265,14 +265,6 @@ pub async fn consumer_operation_handler<E>( logger::info!("Current tasks being executed: {}", current_count); } -pub fn runner_from_task( - task: &storage::ProcessTracker, -) -> Result<workflows::PTRunner, errors::ProcessTrackerError> { - let runner = task.runner.clone().get_required_value("runner")?; - - Ok(runner.parse_enum("PTRunner")?) -} - pub fn add_histogram_metrics( pickup_time: &time::PrimitiveDateTime, task: &mut storage::ProcessTracker, diff --git a/crates/router/src/scheduler/workflows.rs b/crates/router/src/scheduler/workflows.rs index 09085bb59cc..edf38c84d9f 100644 --- a/crates/router/src/scheduler/workflows.rs +++ b/crates/router/src/scheduler/workflows.rs @@ -1,9 +1,13 @@ use async_trait::async_trait; -use router_env::{instrument, tracing}; use serde::{Deserialize, Serialize}; use strum::EnumString; -use crate::{core::errors, routes::AppState, scheduler::consumer, types::storage}; +use crate::{ + core::errors, + routes::AppState, + types::storage, + utils::{OptionExt, StringExt}, +}; pub mod payment_sync; pub mod refund_router; pub mod tokenized_data; @@ -23,17 +27,19 @@ macro_rules! runners { pub struct $body; } )* - #[instrument(skip(state))] - pub async fn perform_workflow_execution<'a>(state: &AppState, process: storage::ProcessTracker, runner: PTRunner) - where - { - match runner { - $( PTRunner::$body => { - let flow = &$body; - consumer::run_executor(state, process, flow).await + pub fn runner_from_task(task: &storage::ProcessTracker) -> Result<Option<Box<dyn ProcessTrackerWorkflow>>, errors::ProcessTrackerError> { + let runner = task.runner.clone().get_required_value("runner")?; + let runner: Option<PTRunner> = runner.parse_enum("PTRunner").ok(); + Ok(match runner { + $( Some( PTRunner::$body ) => { + Some(Box::new($body)) } ,)* - } + None => { + None + } + }) + } }; } @@ -49,6 +55,11 @@ runners! { DeleteTokenizeDataWorkflow } +pub type WorkflowSelectorFn = + fn( + &storage::ProcessTracker, + ) -> Result<Option<Box<dyn ProcessTrackerWorkflow>>, errors::ProcessTrackerError>; + #[async_trait] pub trait ProcessTrackerWorkflow: Send + Sync { // The core execution of the workflow
feat
changing runner selection to dyn dispatch (#853)
c2ad2002c0e6d673f62ec4c72c8fd98b07a05c0b
2023-10-12 13:23:06
Azanul Haque
feat(connector): [ACI] Use connector_request_reference_id as reference to the connector (#2549)
false
diff --git a/crates/router/src/connector/aci/transformers.rs b/crates/router/src/connector/aci/transformers.rs index 30ed9f5d8db..7d30c80c49c 100644 --- a/crates/router/src/connector/aci/transformers.rs +++ b/crates/router/src/connector/aci/transformers.rs @@ -203,7 +203,9 @@ impl bank_account_iban: None, billing_country: Some(country.to_owned()), merchant_customer_id: Some(Secret::new(item.get_customer_id()?)), - merchant_transaction_id: Some(Secret::new(item.payment_id.clone())), + merchant_transaction_id: Some(Secret::new( + item.connector_request_reference_id.clone(), + )), customer_email: None, })) }
feat
[ACI] Use connector_request_reference_id as reference to the connector (#2549)
da2dc10f3d7233a0a9eae7d23cb07f7e8fafad78
2024-05-23 12:23:25
Swangi Kumari
refactor(bank-redirect): dynamic field changes for bankredirect payment method (#4650)
false
diff --git a/crates/router/src/configs/defaults.rs b/crates/router/src/configs/defaults.rs index 213492ac0d9..1fe86a209e3 100644 --- a/crates/router/src/configs/defaults.rs +++ b/crates/router/src/configs/defaults.rs @@ -5672,23 +5672,32 @@ impl Default for super::settings::RequiredFields { non_mandate: HashMap::new(), common: HashMap::from([ ( - "payment_method_data.bank_redirect.bancontact_card.billing_details.email".to_string(), + "billing.email".to_string(), RequiredFieldInfo { - required_field: "payment_method_data.bank_redirect.bancontact_card.billing_details.email".to_string(), + required_field: "payment_method_data.billing.email".to_string(), display_name: "email".to_string(), field_type: enums::FieldType::UserEmailAddress, value: None, } ), ( - "payment_method_data.bank_redirect.bancontact_card.billing_details.billing_name".to_string(), + "billing.address.first_name".to_string(), RequiredFieldInfo { - required_field: "payment_method_data.bank_redirect.bancontact_card.billing_details.billing_name".to_string(), + required_field: "payment_method_data.billing.address.first_name".to_string(), display_name: "billing_name".to_string(), - field_type: enums::FieldType::UserBillingName, + field_type: enums::FieldType::UserFullName, value: None, } - ) + ), + ( + "billing.address.last_name".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.address.last_name".to_string(), + display_name: "billing_name".to_string(), + field_type: enums::FieldType::UserFullName, + value: None, + } + ), ]), } ), @@ -5726,14 +5735,23 @@ impl Default for super::settings::RequiredFields { } ), ( - "payment_method_data.bank_redirect.bancontact_card.card_holder_name".to_string(), + "billing.address.first_name".to_string(), RequiredFieldInfo { - required_field: "payment_method_data.bank_redirect.bancontact_card.card_holder_name".to_string(), + required_field: "payment_method_data.billing.address.first_name".to_string(), display_name: "card_holder_name".to_string(), field_type: enums::FieldType::UserFullName, value: None, } - ) + ), + ( + "billing.address.last_name".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.address.last_name".to_string(), + display_name: "card_holder_name".to_string(), + field_type: enums::FieldType::UserFullName, + value: None, + } + ), ]), } ) @@ -5750,9 +5768,9 @@ impl Default for super::settings::RequiredFields { mandate: HashMap::new(), non_mandate: HashMap::from([ ( - "payment_method_data.bank_redirect.giropay.country".to_string(), + "billing.address.country".to_string(), RequiredFieldInfo { - required_field: "payment_method_data.bank_redirect.giropay.country".to_string(), + required_field: "payment_method_data.billing.address.country".to_string(), display_name: "country".to_string(), field_type: enums::FieldType::UserCountry { options: vec![ @@ -5856,9 +5874,10 @@ impl Default for super::settings::RequiredFields { RequiredFieldFinal { mandate: HashMap::new(), non_mandate: HashMap::from([ - ("payment_method_data.bank_redirect.giropay.country".to_string(), + ( + "billing.address.country".to_string(), RequiredFieldInfo { - required_field: "payment_method_data.bank_redirect.giropay.country".to_string(), + required_field: "payment_method_data.billing.address.country".to_string(), display_name: "country".to_string(), field_type: enums::FieldType::UserCountry { options: vec![ @@ -5869,14 +5888,23 @@ impl Default for super::settings::RequiredFields { } ), ( - "payment_method_data.bank_redirect.giropay.billing_details.billing_name".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.bank_redirect.giropay.billing_details.billing_name".to_string(), - display_name: "billing_name".to_string(), - field_type: enums::FieldType::UserBillingName, - value: None, - } - ) + "billing.address.first_name".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.address.first_name".to_string(), + display_name: "billing_name".to_string(), + field_type: enums::FieldType::UserBillingName, + value: None, + } + ), + ( + "billing.address.last_name".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.address.last_name".to_string(), + display_name: "billing_name".to_string(), + field_type: enums::FieldType::UserBillingName, + value: None, + } + ) ]), common: HashMap::new(), } @@ -5886,14 +5914,24 @@ impl Default for super::settings::RequiredFields { RequiredFieldFinal { mandate: HashMap::new(), non_mandate: HashMap::from([ - ("payment_method_data.bank_redirect.giropay.billing_details.billing_name".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.bank_redirect.giropay.billing_details.billing_name".to_string(), - display_name: "billing_name".to_string(), - field_type: enums::FieldType::UserBillingName, - value: None, - } - ) + ( + "billing.address.first_name".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.address.first_name".to_string(), + display_name: "billing_name".to_string(), + field_type: enums::FieldType::UserBillingName, + value: None, + } + ), + ( + "billing.address.last_name".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.address.last_name".to_string(), + display_name: "billing_name".to_string(), + field_type: enums::FieldType::UserBillingName, + value: None, + } + ) ]), common: HashMap::new(), } @@ -5986,9 +6024,9 @@ impl Default for super::settings::RequiredFields { } ), ( - "payment_method_data.bank_redirect.ideal.country".to_string(), + "billing.address.country".to_string(), RequiredFieldInfo { - required_field: "payment_method_data.bank_redirect.ideal.country".to_string(), + required_field: "payment_method_data.billing.address.country".to_string(), display_name: "country".to_string(), field_type: enums::FieldType::UserCountry { options: vec![ @@ -6100,9 +6138,9 @@ impl Default for super::settings::RequiredFields { mandate: HashMap::new(), non_mandate: HashMap::from([ ( - "payment_method_data.bank_redirect.ideal.country".to_string(), + "billing.address.country".to_string(), RequiredFieldInfo { - required_field: "payment_method_data.bank_redirect.ideal.country".to_string(), + required_field: "payment_method_data.billing.address.country".to_string(), display_name: "country".to_string(), field_type: enums::FieldType::UserCountry{ options: vec![ @@ -6121,19 +6159,28 @@ impl Default for super::settings::RequiredFields { RequiredFieldFinal { mandate: HashMap::new(), non_mandate: HashMap::from([ - ( - "payment_method_data.bank_redirect.ideal.billing_details.billing_name".to_string(), + ( + "billing.address.first_name".to_string(), RequiredFieldInfo { - required_field: "payment_method_data.bank_redirect.ideal.billing_details.billing_name".to_string(), + required_field: "payment_method_data.billing.address.first_name".to_string(), display_name: "billing_name".to_string(), - field_type: enums::FieldType::UserFullName, + field_type: enums::FieldType::UserBillingName, value: None, } ), ( - "payment_method_data.bank_redirect.ideal.country".to_string(), + "billing.address.last_name".to_string(), RequiredFieldInfo { - required_field: "payment_method_data.bank_redirect.ideal.country".to_string(), + required_field: "payment_method_data.billing.address.last_name".to_string(), + display_name: "billing_name".to_string(), + field_type: enums::FieldType::UserBillingName, + value: None, + } + ), + ( + "billing.address.country".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.address.country".to_string(), display_name: "country".to_string(), field_type: enums::FieldType::UserCountry{ options: vec![ @@ -6152,18 +6199,27 @@ impl Default for super::settings::RequiredFields { RequiredFieldFinal { mandate: HashMap::from([ ( - "payment_method_data.bank_redirect.ideal.billing_details.billing_name".to_string(), + "billing.address.first_name".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.address.first_name".to_string(), + display_name: "billing_name".to_string(), + field_type: enums::FieldType::UserFullName, + value: None, + } + ), + ( + "billing.address.last_name".to_string(), RequiredFieldInfo { - required_field: "payment_method_data.bank_redirect.ideal.billing_details.billing_name".to_string(), + required_field: "payment_method_data.billing.address.last_name".to_string(), display_name: "billing_name".to_string(), field_type: enums::FieldType::UserFullName, value: None, } ), ( - "payment_method_data.bank_redirect.ideal.billing_details.email".to_string(), + "billing.email".to_string(), RequiredFieldInfo { - required_field: "payment_method_data.bank_redirect.ideal.billing_details.email".to_string(), + required_field: "payment_method_data.billing.email".to_string(), display_name: "billing_email".to_string(), field_type: enums::FieldType::UserEmailAddress, value: None, @@ -6244,9 +6300,9 @@ impl Default for super::settings::RequiredFields { RequiredFieldFinal { mandate: HashMap::new(), non_mandate: HashMap::from([ - ("payment_method_data.bank_redirect.sofort.country".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.bank_redirect.sofort.country".to_string(), + ("billing.address.country".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.address.country".to_string(), display_name: "country".to_string(), field_type: enums::FieldType::UserCountry { options: vec![ @@ -6384,9 +6440,9 @@ impl Default for super::settings::RequiredFields { RequiredFieldFinal { mandate: HashMap::new(), non_mandate: HashMap::from([ - ("payment_method_data.bank_redirect.sofort.country".to_string(), + ( "billing.address.country".to_string(), RequiredFieldInfo { - required_field: "payment_method_data.bank_redirect.sofort.country".to_string(), + required_field: "payment_method_data.billing.address.country".to_string(), display_name: "country".to_string(), field_type: enums::FieldType::UserCountry { options: vec![ @@ -6401,15 +6457,24 @@ impl Default for super::settings::RequiredFields { value: None, } ), - ( - "payment_method_data.bank_redirect.sofort.billing_details.billing_name".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.bank_redirect.sofort.billing_details.billing_name".to_string(), - display_name: "billing_name".to_string(), - field_type: enums::FieldType::UserBillingName, - value: None, - } - ) + ( + "billing.address.first_name".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.address.first_name".to_string(), + display_name: "billing_name".to_string(), + field_type: enums::FieldType::UserBillingName, + value: None, + } + ), + ( + "billing.address.last_name".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.address.last_name".to_string(), + display_name: "billing_name".to_string(), + field_type: enums::FieldType::UserBillingName, + value: None, + } + ) ]), common: HashMap::new(), } @@ -6427,18 +6492,27 @@ impl Default for super::settings::RequiredFields { RequiredFieldFinal { mandate: HashMap::from([ ( - "payment_method_data.bank_redirect.sofort.billing_details.email".to_string(), + "billing.email".to_string(), RequiredFieldInfo { - required_field: "payment_method_data.bank_redirect.sofort.billing_details.email".to_string(), + required_field: "payment_method_data.billing.email".to_string(), display_name: "email".to_string(), field_type: enums::FieldType::UserEmailAddress, value: None, } ), ( - "payment_method_data.bank_redirect.sofort.billing_details.billing_name".to_string(), + "billing.address.first_name".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.address.first_name".to_string(), + display_name: "billing_name".to_string(), + field_type: enums::FieldType::UserBillingName, + value: None, + } + ), + ( + "billing.address.last_name".to_string(), RequiredFieldInfo { - required_field: "payment_method_data.bank_redirect.sofort.billing_details.billing_name".to_string(), + required_field: "payment_method_data.billing.address.last_name".to_string(), display_name: "billing_name".to_string(), field_type: enums::FieldType::UserBillingName, value: None, @@ -6446,9 +6520,9 @@ impl Default for super::settings::RequiredFields { ) ]), non_mandate : HashMap::from([ - ("payment_method_data.bank_redirect.sofort.country".to_string(), + ("billing.address.country".to_string(), RequiredFieldInfo { - required_field: "payment_method_data.bank_redirect.sofort.country".to_string(), + required_field: "payment_method_data.billing.address.country".to_string(), display_name: "country".to_string(), field_type: enums::FieldType::UserCountry { options: vec![ @@ -6567,14 +6641,23 @@ impl Default for super::settings::RequiredFields { mandate: HashMap::new(), non_mandate: HashMap::from([ ( - "payment_method_data.bank_redirect.eps.billing_details.billing_name".to_string(), + "billing.address.first_name".to_string(), RequiredFieldInfo { - required_field: "payment_method_data.bank_redirect.eps.billing_details.billing_name".to_string(), + required_field: "payment_method_data.billing.address.first_name".to_string(), display_name: "billing_name".to_string(), field_type: enums::FieldType::UserFullName, value: None, } - ) + ), + ( + "billing.address.last_name".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.address.last_name".to_string(), + display_name: "billing_name".to_string(), + field_type: enums::FieldType::UserFullName, + value: None, + } + ), ]), common: HashMap::new(), } @@ -6585,9 +6668,9 @@ impl Default for super::settings::RequiredFields { mandate: HashMap::new(), non_mandate: HashMap::from([ ( - "payment_method_data.bank_redirect.eps.country".to_string(), + "billing.address.country".to_string(), RequiredFieldInfo { - required_field: "payment_method_data.bank_redirect.eps.country".to_string(), + required_field: "payment_method_data.billing.address.country".to_string(), display_name: "bank_account_country".to_string(), field_type: enums::FieldType::UserCountry { options: vec![ @@ -6637,18 +6720,27 @@ impl Default for super::settings::RequiredFields { mandate: HashMap::new(), non_mandate: HashMap::from([ ( - "payment_method_data.bank_redirect.eps.billing_details.billing_name".to_string(), + "billing.address.first_name".to_string(), RequiredFieldInfo { - required_field: "payment_method_data.bank_redirect.eps.billing_details.billing_name".to_string(), + required_field: "payment_method_data.billing.address.first_name".to_string(), display_name: "billing_name".to_string(), field_type: enums::FieldType::UserFullName, value: None, } ), ( - "payment_method_data.bank_redirect.eps.country".to_string(), + "billing.address.last_name".to_string(), RequiredFieldInfo { - required_field: "payment_method_data.bank_redirect.eps.country".to_string(), + required_field: "payment_method_data.billing.address.last_name".to_string(), + display_name: "billing_name".to_string(), + field_type: enums::FieldType::UserFullName, + value: None, + } + ), + ( + "billing.address.country".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.address.country".to_string(), display_name: "bank_account_country".to_string(), field_type: enums::FieldType::UserCountry { options: vec![
refactor
dynamic field changes for bankredirect payment method (#4650)
bc25f3fa40e807cc92d2d53a2287b92eff727d3c
2024-04-04 12:54:23
ivor-juspay
feat(payout-events): add kafka events for payout analytics (#4211)
false
diff --git a/config/config.example.toml b/config/config.example.toml index 074028c208a..0ed971c18bd 100644 --- a/config/config.example.toml +++ b/config/config.example.toml @@ -568,6 +568,7 @@ connector_logs_topic = "topic" # Kafka topic to be used for connector api outgoing_webhook_logs_topic = "topic" # Kafka topic to be used for outgoing webhook events dispute_analytics_topic = "topic" # Kafka topic to be used for Dispute events audit_events_topic = "topic" # Kafka topic to be used for Payment Audit events +payout_analytics_topic = "topic" # Kafka topic to be used for Payout events # File storage configuration [file_storage] diff --git a/config/deployments/env_specific.toml b/config/deployments/env_specific.toml index 8472076dc0c..e0caafa7d72 100644 --- a/config/deployments/env_specific.toml +++ b/config/deployments/env_specific.toml @@ -80,6 +80,7 @@ connector_logs_topic = "topic" # Kafka topic to be used for connector api outgoing_webhook_logs_topic = "topic" # Kafka topic to be used for outgoing webhook events dispute_analytics_topic = "topic" # Kafka topic to be used for Dispute events audit_events_topic = "topic" # Kafka topic to be used for Payment Audit events +payout_analytics_topic = "topic" # Kafka topic to be used for Payout events # File storage configuration [file_storage] diff --git a/config/development.toml b/config/development.toml index 39911248ccd..3b62ec3ca58 100644 --- a/config/development.toml +++ b/config/development.toml @@ -559,6 +559,7 @@ connector_logs_topic = "hyperswitch-connector-api-events" outgoing_webhook_logs_topic = "hyperswitch-outgoing-webhook-events" dispute_analytics_topic = "hyperswitch-dispute-events" audit_events_topic = "hyperswitch-audit-events" +payout_analytics_topic = "hyperswitch-payout-events" [analytics] source = "sqlx" diff --git a/config/docker_compose.toml b/config/docker_compose.toml index 0209b3f48e9..769fdd8f842 100644 --- a/config/docker_compose.toml +++ b/config/docker_compose.toml @@ -409,6 +409,7 @@ connector_logs_topic = "hyperswitch-connector-api-events" outgoing_webhook_logs_topic = "hyperswitch-outgoing-webhook-events" dispute_analytics_topic = "hyperswitch-dispute-events" audit_events_topic = "hyperswitch-audit-events" +payout_analytics_topic = "hyperswitch-payout-events" [analytics] source = "sqlx" diff --git a/crates/analytics/docs/clickhouse/scripts/payouts.sql b/crates/analytics/docs/clickhouse/scripts/payouts.sql new file mode 100644 index 00000000000..0358c0e9375 --- /dev/null +++ b/crates/analytics/docs/clickhouse/scripts/payouts.sql @@ -0,0 +1,109 @@ +CREATE TABLE payout_queue ( + `payout_id` String, + `merchant_id` String, + `customer_id` String, + `address_id` String, + `payout_type` LowCardinality(String), + `payout_method_id` Nullable(String), + `amount` UInt64, + `destination_currency` LowCardinality(String), + `source_currency` LowCardinality(String), + `description` Nullable(String), + `recurring` Bool, + `auto_fulfill` Bool, + `return_url` Nullable(String), + `entity_type` LowCardinality(String), + `metadata` Nullable(String), + `created_at` DateTime CODEC(T64, LZ4), + `last_modified_at` DateTime CODEC(T64, LZ4), + `attempt_count` UInt16, + `profile_id` String, + `status` LowCardinality(String), + `sign_flag` Int8 +) ENGINE = Kafka SETTINGS kafka_broker_list = 'kafka0:29092', +kafka_topic_list = 'hyperswitch-payout-events', +kafka_group_name = 'hyper-c1', +kafka_format = 'JSONEachRow', +kafka_handle_error_mode = 'stream'; + +CREATE TABLE payout ( + `payout_id` String, + `merchant_id` String, + `customer_id` String, + `address_id` String, + `payout_type` LowCardinality(String), + `payout_method_id` Nullable(String), + `amount` UInt64, + `destination_currency` LowCardinality(String), + `source_currency` LowCardinality(String), + `description` Nullable(String), + `recurring` Bool, + `auto_fulfill` Bool, + `return_url` Nullable(String), + `entity_type` LowCardinality(String), + `metadata` Nullable(String), + `created_at` DateTime DEFAULT now() CODEC(T64, LZ4), + `last_modified_at` DateTime DEFAULT now() CODEC(T64, LZ4), + `attempt_count` UInt16, + `profile_id` String, + `status` LowCardinality(String), + `inserted_at` DateTime DEFAULT now() CODEC(T64, LZ4), + `sign_flag` Int8, + INDEX payoutTypeIndex payout_type TYPE bloom_filter GRANULARITY 1, + INDEX destinationCurrencyIndex destination_currency TYPE bloom_filter GRANULARITY 1, + INDEX sourceCurrencyIndex source_currency TYPE bloom_filter GRANULARITY 1, + INDEX entityTypeIndex entity_type TYPE bloom_filter GRANULARITY 1, + INDEX statusIndex status TYPE bloom_filter GRANULARITY 1 +) ENGINE = CollapsingMergeTree(sign_flag) PARTITION BY toStartOfDay(created_at) +ORDER BY + (created_at, merchant_id, payout_id) TTL created_at + toIntervalMonth(6); + +CREATE MATERIALIZED VIEW kafka_parse_payout TO payout ( + `payout_id` String, + `merchant_id` String, + `customer_id` String, + `address_id` String, + `payout_type` LowCardinality(String), + `payout_method_id` Nullable(String), + `amount` UInt64, + `destination_currency` LowCardinality(String), + `source_currency` LowCardinality(String), + `description` Nullable(String), + `recurring` Bool, + `auto_fulfill` Bool, + `return_url` Nullable(String), + `entity_type` LowCardinality(String), + `metadata` Nullable(String), + `created_at` DateTime64(3), + `last_modified_at` DateTime64(3), + `attempt_count` UInt16, + `profile_id` String, + `status` LowCardinality(String), + `inserted_at` DateTime64(3), + `sign_flag` Int8 +) AS +SELECT + payout_id, + merchant_id, + customer_id, + address_id, + payout_type, + payout_method_id, + amount, + destination_currency, + source_currency, + description, + recurring, + auto_fulfill, + return_url, + entity_type, + metadata, + created_at, + last_modified_at, + attempt_count, + profile_id, + status, + now() as inserted_at, + sign_flag +FROM + payout_queue; \ No newline at end of file diff --git a/crates/router/src/db/kafka_store.rs b/crates/router/src/db/kafka_store.rs index dc8b9b791d4..427c66daa07 100644 --- a/crates/router/src/db/kafka_store.rs +++ b/crates/router/src/db/kafka_store.rs @@ -1546,9 +1546,20 @@ impl PayoutsInterface for KafkaStore { payout_update: storage::PayoutsUpdate, storage_scheme: MerchantStorageScheme, ) -> CustomResult<storage::Payouts, errors::DataStorageError> { - self.diesel_store + let payout = self + .diesel_store .update_payout(this, payout_update, storage_scheme) + .await?; + + if let Err(er) = self + .kafka_producer + .log_payout(&payout, Some(this.clone())) .await + { + logger::error!(message="Failed to add analytics entry for Payout {payout:?}", error_message=?er); + }; + + Ok(payout) } async fn insert_payout( @@ -1556,9 +1567,16 @@ impl PayoutsInterface for KafkaStore { payout: storage::PayoutsNew, storage_scheme: MerchantStorageScheme, ) -> CustomResult<storage::Payouts, errors::DataStorageError> { - self.diesel_store + let payout = self + .diesel_store .insert_payout(payout, storage_scheme) - .await + .await?; + + if let Err(er) = self.kafka_producer.log_payout(&payout, None).await { + logger::error!(message="Failed to add analytics entry for Payout {payout:?}", error_message=?er); + }; + + Ok(payout) } async fn find_optional_payout_by_merchant_id_payout_id( diff --git a/crates/router/src/events.rs b/crates/router/src/events.rs index 5f6d978d455..2a0944b2f26 100644 --- a/crates/router/src/events.rs +++ b/crates/router/src/events.rs @@ -26,6 +26,7 @@ pub enum EventType { OutgoingWebhookLogs, Dispute, AuditEvent, + Payout, } #[derive(Debug, Default, Deserialize, Clone)] @@ -39,6 +40,7 @@ pub enum EventsConfig { Logs, } +#[allow(clippy::large_enum_variant)] #[derive(Debug, Clone)] pub enum EventsHandler { Kafka(KafkaProducer), diff --git a/crates/router/src/services/kafka.rs b/crates/router/src/services/kafka.rs index 373c268f85b..e4708f86681 100644 --- a/crates/router/src/services/kafka.rs +++ b/crates/router/src/services/kafka.rs @@ -11,17 +11,23 @@ use crate::events::EventType; mod dispute; mod payment_attempt; mod payment_intent; +mod payout; mod refund; use data_models::payments::{payment_attempt::PaymentAttempt, PaymentIntent}; use diesel_models::refund::Refund; use serde::Serialize; use time::OffsetDateTime; +#[cfg(feature = "payouts")] +use self::payout::KafkaPayout; use self::{ dispute::KafkaDispute, payment_attempt::KafkaPaymentAttempt, payment_intent::KafkaPaymentIntent, refund::KafkaRefund, }; use crate::types::storage::Dispute; +#[cfg(feature = "payouts")] +use crate::types::storage::Payouts; + // Using message queue result here to avoid confusion with Kafka result provided by library pub type MQResult<T> = CustomResult<T, KafkaError>; @@ -91,6 +97,7 @@ pub struct KafkaSettings { outgoing_webhook_logs_topic: String, dispute_analytics_topic: String, audit_events_topic: String, + payout_analytics_topic: String, } impl KafkaSettings { @@ -156,6 +163,12 @@ impl KafkaSettings { )) })?; + common_utils::fp_utils::when(self.payout_analytics_topic.is_default_or_empty(), || { + Err(ApplicationError::InvalidConfigurationValueError( + "Kafka Payout Analytics topic must not be empty".into(), + )) + })?; + Ok(()) } } @@ -171,6 +184,7 @@ pub struct KafkaProducer { outgoing_webhook_logs_topic: String, dispute_analytics_topic: String, audit_events_topic: String, + payout_analytics_topic: String, } struct RdKafkaProducer(ThreadedProducer<DefaultProducerContext>); @@ -210,6 +224,7 @@ impl KafkaProducer { outgoing_webhook_logs_topic: conf.outgoing_webhook_logs_topic.clone(), dispute_analytics_topic: conf.dispute_analytics_topic.clone(), audit_events_topic: conf.audit_events_topic.clone(), + payout_analytics_topic: conf.payout_analytics_topic.clone(), }) } @@ -224,6 +239,7 @@ impl KafkaProducer { EventType::OutgoingWebhookLogs => &self.outgoing_webhook_logs_topic, EventType::Dispute => &self.dispute_analytics_topic, EventType::AuditEvent => &self.audit_events_topic, + EventType::Payout => &self.payout_analytics_topic, }; self.producer .0 @@ -340,6 +356,30 @@ impl KafkaProducer { .attach_printable_lazy(|| format!("Failed to add positive dispute event {dispute:?}")) } + #[cfg(feature = "payouts")] + pub async fn log_payout(&self, payout: &Payouts, old_payout: Option<Payouts>) -> MQResult<()> { + if let Some(negative_event) = old_payout { + self.log_event(&KafkaEvent::old(&KafkaPayout::from_storage( + &negative_event, + ))) + .attach_printable_lazy(|| { + format!("Failed to add negative payout event {negative_event:?}") + })?; + }; + self.log_event(&KafkaEvent::new(&KafkaPayout::from_storage(payout))) + .attach_printable_lazy(|| format!("Failed to add positive payout event {payout:?}")) + } + + #[cfg(feature = "payouts")] + pub async fn log_payout_delete(&self, delete_old_payout: &Payouts) -> MQResult<()> { + self.log_event(&KafkaEvent::old(&KafkaPayout::from_storage( + delete_old_payout, + ))) + .attach_printable_lazy(|| { + format!("Failed to add negative payout event {delete_old_payout:?}") + }) + } + pub fn get_topic(&self, event: EventType) -> &str { match event { EventType::ApiLogs => &self.api_logs_topic, @@ -350,6 +390,7 @@ impl KafkaProducer { EventType::OutgoingWebhookLogs => &self.outgoing_webhook_logs_topic, EventType::Dispute => &self.dispute_analytics_topic, EventType::AuditEvent => &self.audit_events_topic, + EventType::Payout => &self.payout_analytics_topic, } } } diff --git a/crates/router/src/services/kafka/payout.rs b/crates/router/src/services/kafka/payout.rs new file mode 100644 index 00000000000..7e181e3d1f6 --- /dev/null +++ b/crates/router/src/services/kafka/payout.rs @@ -0,0 +1,74 @@ +use common_utils::pii; +use diesel_models::enums as storage_enums; +use time::OffsetDateTime; + +#[cfg(feature = "payouts")] +use crate::types::storage::Payouts; + +#[derive(serde::Serialize, Debug)] +pub struct KafkaPayout<'a> { + pub payout_id: &'a String, + pub merchant_id: &'a String, + pub customer_id: &'a String, + pub address_id: &'a String, + pub payout_type: &'a storage_enums::PayoutType, + pub payout_method_id: Option<&'a String>, + pub amount: i64, + pub destination_currency: &'a storage_enums::Currency, + pub source_currency: &'a storage_enums::Currency, + pub description: Option<&'a String>, + pub recurring: bool, + pub auto_fulfill: bool, + pub return_url: Option<&'a String>, + pub entity_type: &'a storage_enums::PayoutEntityType, + pub metadata: Option<&'a pii::SecretSerdeValue>, + #[serde(default, with = "time::serde::timestamp")] + pub created_at: OffsetDateTime, + #[serde(default, with = "time::serde::timestamp")] + pub last_modified_at: OffsetDateTime, + pub attempt_count: i16, + pub profile_id: &'a String, + pub status: &'a storage_enums::PayoutStatus, +} + +#[cfg(feature = "payouts")] +impl<'a> KafkaPayout<'a> { + pub fn from_storage(payout: &'a Payouts) -> Self { + Self { + payout_id: &payout.payout_id, + merchant_id: &payout.merchant_id, + customer_id: &payout.customer_id, + address_id: &payout.address_id, + payout_type: &payout.payout_type, + payout_method_id: payout.payout_method_id.as_ref(), + amount: payout.amount, + destination_currency: &payout.destination_currency, + source_currency: &payout.source_currency, + description: payout.description.as_ref(), + recurring: payout.recurring, + auto_fulfill: payout.auto_fulfill, + return_url: payout.return_url.as_ref(), + entity_type: &payout.entity_type, + metadata: payout.metadata.as_ref(), + created_at: payout.created_at.assume_utc(), + last_modified_at: payout.last_modified_at.assume_utc(), + attempt_count: payout.attempt_count, + profile_id: &payout.profile_id, + status: &payout.status, + } + } +} + +impl<'a> super::KafkaMessage for KafkaPayout<'a> { + fn key(&self) -> String { + format!("{}_{}", self.merchant_id, self.payout_id) + } + + fn creation_timestamp(&self) -> Option<i64> { + Some(self.last_modified_at.unix_timestamp()) + } + + fn event_type(&self) -> crate::events::EventType { + crate::events::EventType::Payout + } +}
feat
add kafka events for payout analytics (#4211)
1be197f6f0b664c281650caed4c2971e96360759
2023-11-28 21:55:57
github-actions
chore(version): v1.91.0
false
diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b3abf1d578..dfe703192a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,38 @@ All notable changes to HyperSwitch will be documented here. - - - +## 1.91.0 (2023-11-28) + +### Features + +- **core:** + - [Paypal] Add Preprocessing flow to CompleteAuthorize for Card 3DS Auth Verification ([#2757](https://github.com/juspay/hyperswitch/pull/2757)) ([`77fc92c`](https://github.com/juspay/hyperswitch/commit/77fc92c99a99aaf76d270ba5b981928183a05768)) + - Enable payment refund when payment is partially captured ([#2991](https://github.com/juspay/hyperswitch/pull/2991)) ([`837480d`](https://github.com/juspay/hyperswitch/commit/837480d935cce8cc35f07c5ccb3560285909bc52)) +- **currency_conversion:** Add currency conversion feature ([#2948](https://github.com/juspay/hyperswitch/pull/2948)) ([`c0116db`](https://github.com/juspay/hyperswitch/commit/c0116db271f6afc1b93c04705209bfc346228c68)) +- **payment_methods:** Receive `card_holder_name` in confirm flow when using token for payment ([#2982](https://github.com/juspay/hyperswitch/pull/2982)) ([`e7ad3a4`](https://github.com/juspay/hyperswitch/commit/e7ad3a4db8823f3ae8d381771739670d8350e6da)) + +### Bug Fixes + +- **connector:** [Adyen] `ErrorHandling` in case of Balance Check for Gift Cards ([#1976](https://github.com/juspay/hyperswitch/pull/1976)) ([`bd889c8`](https://github.com/juspay/hyperswitch/commit/bd889c834dd5e201b055233016f7226fa2187aea)) +- **core:** Replace euclid enum with RoutableConnectors enum ([#2994](https://github.com/juspay/hyperswitch/pull/2994)) ([`ff6a0dd`](https://github.com/juspay/hyperswitch/commit/ff6a0dd0b515778b64a3e28ef905154eee85ec78)) +- Remove error propagation if card name not found in locker ([#2998](https://github.com/juspay/hyperswitch/pull/2998)) ([`1c5a9b5`](https://github.com/juspay/hyperswitch/commit/1c5a9b5452afc33b18f45389bf3bdfd80820f476)) + +### Refactors + +- **events:** Adding changes to type of API events to Kafka ([#2992](https://github.com/juspay/hyperswitch/pull/2992)) ([`d63f6f7`](https://github.com/juspay/hyperswitch/commit/d63f6f7224f35018e7c707353508bbacc2baed5c)) +- **masking:** Use empty enums as masking:Strategy<T> types ([#2874](https://github.com/juspay/hyperswitch/pull/2874)) ([`0e66b1b`](https://github.com/juspay/hyperswitch/commit/0e66b1b5dcce6dd87c9d743c9eb73d0cd8e330b2)) +- **router:** Add openapi spec support for merchant_connector apis ([#2997](https://github.com/juspay/hyperswitch/pull/2997)) ([`cdbb385`](https://github.com/juspay/hyperswitch/commit/cdbb3853cd44443f8487abc16a9ba5d99f22e475)) +- Added min idle and max lifetime for database config ([#2900](https://github.com/juspay/hyperswitch/pull/2900)) ([`b3c51e6`](https://github.com/juspay/hyperswitch/commit/b3c51e6eb55c58adc024ee32b59c3910b2b72131)) + +### Testing + +- **postman:** Update postman collection files ([`af6b05c`](https://github.com/juspay/hyperswitch/commit/af6b05c504b6fdbec7db77fa7f71535d7fea3e7a)) + +**Full Changelog:** [`v1.90.0...v1.91.0`](https://github.com/juspay/hyperswitch/compare/v1.90.0...v1.91.0) + +- - - + + ## 1.90.0 (2023-11-27) ### Features
chore
v1.91.0
4d58bdbe2939b9952baf6c8faa48fff09a2409f7
2023-09-06 19:45:33
Sai Harsha Vardhan
fix(router): send connection_closed errors as 5xx instead of 2xx (#2093)
false
diff --git a/crates/router/src/consts.rs b/crates/router/src/consts.rs index 34d1c0ab8f1..d432bfeec8a 100644 --- a/crates/router/src/consts.rs +++ b/crates/router/src/consts.rs @@ -13,9 +13,6 @@ pub(crate) const ALPHABETS: [char; 62] = [ pub const REQUEST_TIME_OUT: u64 = 30; pub const REQUEST_TIMEOUT_ERROR_CODE: &str = "TIMEOUT"; pub const REQUEST_TIMEOUT_ERROR_MESSAGE: &str = "Connector did not respond in specified time"; -pub const CONNECTION_CLOSED_ERROR_CODE: &str = "CONNECTION_CLOSED"; -pub const CONNECTION_CLOSED_ERROR_MESSAGE: &str = - "Connection closed before a message could complete"; ///Payment intent fulfillment default timeout (in seconds) pub const DEFAULT_FULFILLMENT_TIME: i64 = 15 * 60; diff --git a/crates/router/src/services/api.rs b/crates/router/src/services/api.rs index f2ff6bb9773..2c844958fdf 100644 --- a/crates/router/src/services/api.rs +++ b/crates/router/src/services/api.rs @@ -395,18 +395,6 @@ where router_data.response = Err(error_response); router_data.connector_http_status_code = Some(504); Ok(router_data) - } else if error.current_context().is_connection_closed() { - let error_response = ErrorResponse { - code: consts::CONNECTION_CLOSED_ERROR_CODE.to_string(), - message: consts::CONNECTION_CLOSED_ERROR_MESSAGE.to_string(), - reason: Some( - consts::CONNECTION_CLOSED_ERROR_MESSAGE.to_string(), - ), - status_code: 504, - }; - router_data.response = Err(error_response); - router_data.connector_http_status_code = Some(504); - Ok(router_data) } else { Err(error.change_context( errors::ConnectorError::ProcessingStepFailed(None),
fix
send connection_closed errors as 5xx instead of 2xx (#2093)
567aa9392088c74c97ec17a1f8c3a16a6d0fba89
2022-12-20 18:23:21
Abhishek
refactor(router): removed build.rs file from router which was not in module tree (#186)
false
diff --git a/crates/router/build.rs b/crates/router/build.rs deleted file mode 100644 index 4b07385af68..00000000000 --- a/crates/router/build.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - router_env::vergen::generate_cargo_instructions(); -}
refactor
removed build.rs file from router which was not in module tree (#186)
0eaadc42b77e0f27cc4bb26c7e04d7c4f762b6d9
2024-08-26 12:20:11
Hrithikesh
chore: create v2 route for organization (#5679)
false
diff --git a/api-reference-v2/api-reference/organization/organization--create.mdx b/api-reference-v2/api-reference/organization/organization--create.mdx new file mode 100644 index 00000000000..07f4e13222b --- /dev/null +++ b/api-reference-v2/api-reference/organization/organization--create.mdx @@ -0,0 +1,3 @@ +--- +openapi: post /v2/organization +--- \ No newline at end of file diff --git a/api-reference-v2/api-reference/organization/organization--retrieve.mdx b/api-reference-v2/api-reference/organization/organization--retrieve.mdx new file mode 100644 index 00000000000..5cd3175b04f --- /dev/null +++ b/api-reference-v2/api-reference/organization/organization--retrieve.mdx @@ -0,0 +1,3 @@ +--- +openapi: get /v2/organization/{organization_id} +--- \ No newline at end of file diff --git a/api-reference-v2/api-reference/organization/organization--update.mdx b/api-reference-v2/api-reference/organization/organization--update.mdx new file mode 100644 index 00000000000..1ac924b71bc --- /dev/null +++ b/api-reference-v2/api-reference/organization/organization--update.mdx @@ -0,0 +1,3 @@ +--- +openapi: put /v2/organization/{organization_id} +--- \ No newline at end of file diff --git a/api-reference-v2/mint.json b/api-reference-v2/mint.json index 375f50636ae..b93e4e60006 100644 --- a/api-reference-v2/mint.json +++ b/api-reference-v2/mint.json @@ -34,6 +34,14 @@ "essentials/go-live" ] }, + { + "group": "Organization", + "pages": [ + "api-reference/organization/organization--create", + "api-reference/organization/organization--retrieve", + "api-reference/organization/organization--update" + ] + }, { "group": "Merchant Account", "pages": [ diff --git a/api-reference-v2/openapi_spec.json b/api-reference-v2/openapi_spec.json index 275a2716164..d0f5152f154 100644 --- a/api-reference-v2/openapi_spec.json +++ b/api-reference-v2/openapi_spec.json @@ -20,7 +20,7 @@ } ], "paths": { - "/organization": { + "/v2/organization": { "post": { "tags": [ "Organization" @@ -67,7 +67,7 @@ ] } }, - "/organization/{organization_id}": { + "/v2/organization/{organization_id}": { "get": { "tags": [ "Organization" diff --git a/crates/openapi/src/routes/organization.rs b/crates/openapi/src/routes/organization.rs index 8f1a35f7d64..c31ff70a79f 100644 --- a/crates/openapi/src/routes/organization.rs +++ b/crates/openapi/src/routes/organization.rs @@ -1,4 +1,4 @@ -#[cfg(any(feature = "v1", feature = "v2"))] +#[cfg(feature = "v1")] /// Organization - Create /// /// Create a new organization @@ -25,7 +25,7 @@ )] pub async fn organization_create() {} -#[cfg(any(feature = "v1", feature = "v2"))] +#[cfg(feature = "v1")] /// Organization - Retrieve /// /// Retrieve an existing organization @@ -43,7 +43,7 @@ pub async fn organization_create() {} )] pub async fn organization_retrieve() {} -#[cfg(any(feature = "v1", feature = "v2"))] +#[cfg(feature = "v1")] /// Organization - Update /// /// Create a new organization for . @@ -70,3 +70,76 @@ pub async fn organization_retrieve() {} security(("admin_api_key" = [])) )] pub async fn organization_update() {} + +#[cfg(feature = "v2")] +/// Organization - Create +/// +/// Create a new organization +#[utoipa::path( + post, + path = "/v2/organization", + request_body( + content = OrganizationRequest, + examples( + ( + "Create an organization with organization_name" = ( + value = json!({"organization_name": "organization_abc"}) + ) + ), + ) + ), + responses( + (status = 200, description = "Organization Created", body =OrganizationResponse), + (status = 400, description = "Invalid data") + ), + tag = "Organization", + operation_id = "Create an Organization", + security(("admin_api_key" = [])) +)] +pub async fn organization_create() {} + +#[cfg(feature = "v2")] +/// Organization - Retrieve +/// +/// Retrieve an existing organization +#[utoipa::path( + get, + path = "/v2/organization/{organization_id}", + params (("organization_id" = String, Path, description = "The unique identifier for the Organization")), + responses( + (status = 200, description = "Organization Created", body =OrganizationResponse), + (status = 400, description = "Invalid data") + ), + tag = "Organization", + operation_id = "Retrieve an Organization", + security(("admin_api_key" = [])) +)] +pub async fn organization_retrieve() {} + +#[cfg(feature = "v2")] +/// Organization - Update +/// +/// Create a new organization for . +#[utoipa::path( + put, + path = "/v2/organization/{organization_id}", + request_body( + content = OrganizationRequest, + examples( + ( + "Update organization_name of the organization" = ( + value = json!({"organization_name": "organization_abcd"}) + ) + ), + ) + ), + params (("organization_id" = String, Path, description = "The unique identifier for the Organization")), + responses( + (status = 200, description = "Organization Created", body =OrganizationResponse), + (status = 400, description = "Invalid data") + ), + tag = "Organization", + operation_id = "Update an Organization", + security(("admin_api_key" = [])) +)] +pub async fn organization_update() {} diff --git a/crates/router/src/routes/app.rs b/crates/router/src/routes/app.rs index d8e1614110e..4fb171996e0 100644 --- a/crates/router/src/routes/app.rs +++ b/crates/router/src/routes/app.rs @@ -1137,7 +1137,12 @@ impl Blocklist { #[cfg(feature = "olap")] pub struct Organization; -#[cfg(feature = "olap")] + +#[cfg(all( + feature = "olap", + any(feature = "v1", feature = "v2"), + not(feature = "merchant_account_v2") +))] impl Organization { pub fn server(state: AppState) -> Scope { web::scope("/organization") @@ -1151,6 +1156,20 @@ impl Organization { } } +#[cfg(all(feature = "v2", feature = "olap", feature = "merchant_account_v2"))] +impl Organization { + pub fn server(state: AppState) -> Scope { + web::scope("/v2/organization") + .app_data(web::Data::new(state)) + .service(web::resource("").route(web::post().to(organization_create))) + .service( + web::resource("/{id}") + .route(web::get().to(organization_retrieve)) + .route(web::put().to(organization_update)), + ) + } +} + pub struct MerchantAccount; #[cfg(all(feature = "v2", feature = "olap", feature = "merchant_account_v2"))]
chore
create v2 route for organization (#5679)
7b5783e2da6839b7c23164e637eaf9bb8fea974c
2022-12-05 13:05:40
Sanchith Hegde
build(deps): bump `futures-locks` crate from 0.6 to 0.7.0 (#59)
false
diff --git a/Cargo.lock b/Cargo.lock index a7c0e5b31ff..d5ab115e30c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11,7 +11,7 @@ dependencies = [ "actix-rt", "actix_derive", "bitflags", - "bytes 1.3.0", + "bytes", "crossbeam-channel", "futures-core", "futures-sink", @@ -20,9 +20,9 @@ dependencies = [ "log", "once_cell", "parking_lot 0.12.1", - "pin-project-lite 0.2.9", + "pin-project-lite", "smallvec", - "tokio 1.22.0", + "tokio", "tokio-util 0.7.4", ] @@ -33,13 +33,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57a7559404a7f3573127aab53c08ce37a6c6a315c374a31070f3c91cd1b4a7fe" dependencies = [ "bitflags", - "bytes 1.3.0", + "bytes", "futures-core", "futures-sink", "log", "memchr", - "pin-project-lite 0.2.9", - "tokio 1.22.0", + "pin-project-lite", + "tokio", "tokio-util 0.7.4", ] @@ -72,7 +72,7 @@ dependencies = [ "base64", "bitflags", "brotli", - "bytes 1.3.0", + "bytes", "bytestring", "derive_more", "encoding_rs", @@ -87,7 +87,7 @@ dependencies = [ "local-channel", "mime", "percent-encoding", - "pin-project-lite 0.2.9", + "pin-project-lite", "rand", "sha1", "smallvec", @@ -126,7 +126,7 @@ checksum = "7ea16c295198e958ef31930a6ef37d0fb64e9ca3b6116e6b93a8bdae96ee1000" dependencies = [ "actix-macros", "futures-core", - "tokio 1.22.0", + "tokio", ] [[package]] @@ -143,7 +143,7 @@ dependencies = [ "mio", "num_cpus", "socket2", - "tokio 1.22.0", + "tokio", "tracing 0.1.36", ] @@ -155,7 +155,7 @@ checksum = "3b894941f818cfdc7ccc4b9e60fa7e53b5042a2e8567270f9147d5591893373a" dependencies = [ "futures-core", "paste", - "pin-project-lite 0.2.9", + "pin-project-lite", ] [[package]] @@ -171,7 +171,7 @@ dependencies = [ "futures-core", "http", "log", - "pin-project-lite 0.2.9", + "pin-project-lite", "tokio-rustls 0.23.4", "tokio-util 0.7.4", "webpki-roots", @@ -184,7 +184,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88a1dcdff1466e3c2488e1cb5c36a71822750ad43839937f85d2f4d9f8b705d8" dependencies = [ "local-waker", - "pin-project-lite 0.2.9", + "pin-project-lite", ] [[package]] @@ -203,7 +203,7 @@ dependencies = [ "actix-utils", "actix-web-codegen", "ahash", - "bytes 1.3.0", + "bytes", "bytestring", "cfg-if", "cookie", @@ -217,7 +217,7 @@ dependencies = [ "log", "mime", "once_cell", - "pin-project-lite 0.2.9", + "pin-project-lite", "regex", "serde", "serde_json", @@ -328,7 +328,7 @@ dependencies = [ "bb8", "diesel", "thiserror", - "tokio 1.22.0", + "tokio", ] [[package]] @@ -394,7 +394,7 @@ dependencies = [ "actix-utils", "ahash", "base64", - "bytes 1.3.0", + "bytes", "cfg-if", "cookie", "derive_more", @@ -406,13 +406,13 @@ dependencies = [ "log", "mime", "percent-encoding", - "pin-project-lite 0.2.9", + "pin-project-lite", "rand", "rustls 0.20.7", "serde", "serde_json", "serde_urlencoded", - "tokio 1.22.0", + "tokio", ] [[package]] @@ -431,13 +431,13 @@ dependencies = [ "aws-smithy-json", "aws-smithy-types", "aws-types", - "bytes 1.3.0", + "bytes", "hex", "http", "hyper", "ring", "time", - "tokio 1.22.0", + "tokio", "tower", "tracing 0.1.36", "zeroize", @@ -466,12 +466,12 @@ dependencies = [ "aws-smithy-http", "aws-smithy-types", "aws-types", - "bytes 1.3.0", + "bytes", "http", "http-body", "lazy_static", "percent-encoding", - "pin-project-lite 0.2.9", + "pin-project-lite", "tracing 0.1.36", ] @@ -491,7 +491,7 @@ dependencies = [ "aws-smithy-json", "aws-smithy-types", "aws-types", - "bytes 1.3.0", + "bytes", "http", "tokio-stream", "tower", @@ -513,7 +513,7 @@ dependencies = [ "aws-smithy-json", "aws-smithy-types", "aws-types", - "bytes 1.3.0", + "bytes", "http", "tokio-stream", "tower", @@ -536,7 +536,7 @@ dependencies = [ "aws-smithy-types", "aws-smithy-xml", "aws-types", - "bytes 1.3.0", + "bytes", "http", "tower", ] @@ -579,8 +579,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc604f278bae64bbd15854baa9c46ed69a56dfb0669d04aab80974749f2d6599" dependencies = [ "futures-util", - "pin-project-lite 0.2.9", - "tokio 1.22.0", + "pin-project-lite", + "tokio", "tokio-stream", ] @@ -594,15 +594,15 @@ dependencies = [ "aws-smithy-http", "aws-smithy-http-tower", "aws-smithy-types", - "bytes 1.3.0", + "bytes", "fastrand", "http", "http-body", "hyper", "hyper-rustls", "lazy_static", - "pin-project-lite 0.2.9", - "tokio 1.22.0", + "pin-project-lite", + "tokio", "tower", "tracing 0.1.36", ] @@ -614,7 +614,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "014a0ef5c4508fc2f6a9d3925c214725af19f020ea388db48e20196cc4cc9d6d" dependencies = [ "aws-smithy-types", - "bytes 1.3.0", + "bytes", "bytes-utils", "futures-core", "http", @@ -622,8 +622,8 @@ dependencies = [ "hyper", "once_cell", "percent-encoding", - "pin-project-lite 0.2.9", - "tokio 1.22.0", + "pin-project-lite", + "tokio", "tokio-util 0.7.4", "tracing 0.1.36", ] @@ -635,10 +635,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "deecb478dc3cc40203e0e97ac0fb92947e0719754bbafd0026bdc49318e2fd03" dependencies = [ "aws-smithy-http", - "bytes 1.3.0", + "bytes", "http", "http-body", - "pin-project-lite 0.2.9", + "pin-project-lite", "tower", "tracing 0.1.36", ] @@ -708,7 +708,7 @@ dependencies = [ "async-trait", "axum-core", "bitflags", - "bytes 1.3.0", + "bytes", "futures-util", "http", "http-body", @@ -718,7 +718,7 @@ dependencies = [ "memchr", "mime", "percent-encoding", - "pin-project-lite 0.2.9", + "pin-project-lite", "rustversion", "serde", "sync_wrapper", @@ -735,7 +735,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79b8558f5a0581152dc94dcd289132a1d377494bdeafcd41869b3258e3e2ad92" dependencies = [ "async-trait", - "bytes 1.3.0", + "bytes", "futures-util", "http", "http-body", @@ -761,7 +761,7 @@ dependencies = [ "futures-channel", "futures-util", "parking_lot 0.12.1", - "tokio 1.22.0", + "tokio", ] [[package]] @@ -836,12 +836,6 @@ version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" -[[package]] -name = "bytes" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" - [[package]] name = "bytes" version = "1.3.0" @@ -854,7 +848,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e47d3a8076e283f3acd27400535992edb3ba4b5bb72f8891ad8fbe7932a7d4b9" dependencies = [ - "bytes 1.3.0", + "bytes", "either", ] @@ -864,7 +858,7 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7f83e57d9154148e355404702e2694463241880b939570d7c97c014da7a69a1" dependencies = [ - "bytes 1.3.0", + "bytes", ] [[package]] @@ -901,7 +895,7 @@ dependencies = [ name = "common_utils" version = "0.1.0" dependencies = [ - "bytes 1.3.0", + "bytes", "error-stack", "masking", "router_env", @@ -1260,7 +1254,7 @@ dependencies = [ "arc-swap", "arcstr", "async-trait", - "bytes 1.3.0", + "bytes", "bytes-utils", "cfg-if", "float-cmp", @@ -1274,7 +1268,7 @@ dependencies = [ "redis-protocol", "semver", "sha-1", - "tokio 1.22.0", + "tokio", "tokio-native-tls", "tokio-stream", "tokio-util 0.6.10", @@ -1333,12 +1327,13 @@ checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" [[package]] name = "futures-locks" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c4e684ddb2d8a4db5ca8a02b35156da129674ba4412b6f528698d58c594954" +checksum = "3eb42d4fb72227be5778429f9ef5240a38a358925a49f05b5cf702ce7c7e558a" dependencies = [ - "futures", - "tokio 0.2.25", + "futures-channel", + "futures-task", + "tokio", ] [[package]] @@ -1377,7 +1372,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.9", + "pin-project-lite", "pin-utils", "slab", ] @@ -1444,7 +1439,7 @@ version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" dependencies = [ - "bytes 1.3.0", + "bytes", "fnv", "futures-core", "futures-sink", @@ -1452,7 +1447,7 @@ dependencies = [ "http", "indexmap", "slab", - "tokio 1.22.0", + "tokio", "tokio-util 0.7.4", "tracing 0.1.36", ] @@ -1502,7 +1497,7 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" dependencies = [ - "bytes 1.3.0", + "bytes", "fnv", "itoa 1.0.4", ] @@ -1513,9 +1508,9 @@ version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ - "bytes 1.3.0", + "bytes", "http", - "pin-project-lite 0.2.9", + "pin-project-lite", ] [[package]] @@ -1551,7 +1546,7 @@ version = "0.14.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" dependencies = [ - "bytes 1.3.0", + "bytes", "futures-channel", "futures-core", "futures-util", @@ -1561,9 +1556,9 @@ dependencies = [ "httparse", "httpdate", "itoa 1.0.4", - "pin-project-lite 0.2.9", + "pin-project-lite", "socket2", - "tokio 1.22.0", + "tokio", "tower-service", "tracing 0.1.36", "want", @@ -1581,7 +1576,7 @@ dependencies = [ "log", "rustls 0.19.1", "rustls-native-certs", - "tokio 1.22.0", + "tokio", "tokio-rustls 0.22.0", "webpki 0.21.4", ] @@ -1593,8 +1588,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" dependencies = [ "hyper", - "pin-project-lite 0.2.9", - "tokio 1.22.0", + "pin-project-lite", + "tokio", "tokio-io-timeout", ] @@ -1604,10 +1599,10 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ - "bytes 1.3.0", + "bytes", "hyper", "native-tls", - "tokio 1.22.0", + "tokio", "tokio-native-tls", ] @@ -1815,7 +1810,7 @@ dependencies = [ name = "masking" version = "0.1.0" dependencies = [ - "bytes 1.3.0", + "bytes", "diesel", "serde", "serde_json", @@ -2083,7 +2078,7 @@ dependencies = [ "opentelemetry-proto", "prost", "thiserror", - "tokio 1.22.0", + "tokio", "tonic", ] @@ -2110,7 +2105,7 @@ dependencies = [ "indexmap", "js-sys", "once_cell", - "pin-project-lite 0.2.9", + "pin-project-lite", "thiserror", ] @@ -2131,7 +2126,7 @@ dependencies = [ "percent-encoding", "rand", "thiserror", - "tokio 1.22.0", + "tokio", "tokio-stream", ] @@ -2290,12 +2285,6 @@ dependencies = [ "syn", ] -[[package]] -name = "pin-project-lite" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" - [[package]] name = "pin-project-lite" version = "0.2.9" @@ -2398,7 +2387,7 @@ version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0b18e655c21ff5ac2084a5ad0611e827b3f92badf79f4910b5a5c58f4d87ff0" dependencies = [ - "bytes 1.3.0", + "bytes", "prost-derive", ] @@ -2492,7 +2481,7 @@ version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c31deddf734dc0a39d3112e73490e88b61a05e83e074d211f348404cee4d2c6" dependencies = [ - "bytes 1.3.0", + "bytes", "bytes-utils", "cookie-factory", "crc16", @@ -2504,7 +2493,7 @@ dependencies = [ name = "redis_interface" version = "0.1.0" dependencies = [ - "bytes 1.3.0", + "bytes", "common_utils", "error-stack", "fred", @@ -2566,7 +2555,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68cc60575865c7831548863cc02356512e3f1dc2f3f82cb837d7fc4cc8f3c97c" dependencies = [ "base64", - "bytes 1.3.0", + "bytes", "encoding_rs", "futures-core", "futures-util", @@ -2582,11 +2571,11 @@ dependencies = [ "native-tls", "once_cell", "percent-encoding", - "pin-project-lite 0.2.9", + "pin-project-lite", "serde", "serde_json", "serde_urlencoded", - "tokio 1.22.0", + "tokio", "tokio-native-tls", "tower-service", "url", @@ -2638,7 +2627,7 @@ dependencies = [ "aws-sdk-kms", "base64", "bb8", - "bytes 1.3.0", + "bytes", "common_utils", "config", "crc32fast", @@ -2677,7 +2666,7 @@ dependencies = [ "strum", "thiserror", "time", - "tokio 1.22.0", + "tokio", "toml", "url", "uuid", @@ -2711,7 +2700,7 @@ dependencies = [ "serde_urlencoded", "strum", "time", - "tokio 1.22.0", + "tokio", "tracing 0.1.36", "tracing-actix-web", "tracing-appender", @@ -3217,17 +3206,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" -[[package]] -name = "tokio" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6703a273949a90131b290be1fe7b039d0fc884aa1935860dfcbe056f28cd8092" -dependencies = [ - "bytes 0.5.6", - "pin-project-lite 0.1.12", - "slab", -] - [[package]] name = "tokio" version = "1.22.0" @@ -3235,13 +3213,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d76ce4a75fb488c605c54bf610f221cea8b0dafb53333c1a67e8ee199dcd2ae3" dependencies = [ "autocfg", - "bytes 1.3.0", + "bytes", "libc", "memchr", "mio", "num_cpus", "parking_lot 0.12.1", - "pin-project-lite 0.2.9", + "pin-project-lite", "signal-hook-registry", "socket2", "tokio-macros", @@ -3254,8 +3232,8 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" dependencies = [ - "pin-project-lite 0.2.9", - "tokio 1.22.0", + "pin-project-lite", + "tokio", ] [[package]] @@ -3276,7 +3254,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" dependencies = [ "native-tls", - "tokio 1.22.0", + "tokio", ] [[package]] @@ -3286,7 +3264,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" dependencies = [ "rustls 0.19.1", - "tokio 1.22.0", + "tokio", "webpki 0.21.4", ] @@ -3297,7 +3275,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ "rustls 0.20.7", - "tokio 1.22.0", + "tokio", "webpki 0.22.0", ] @@ -3308,8 +3286,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d660770404473ccd7bc9f8b28494a811bc18542b915c0855c51e8f419d5223ce" dependencies = [ "futures-core", - "pin-project-lite 0.2.9", - "tokio 1.22.0", + "pin-project-lite", + "tokio", ] [[package]] @@ -3318,12 +3296,12 @@ version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" dependencies = [ - "bytes 1.3.0", + "bytes", "futures-core", "futures-sink", "log", - "pin-project-lite 0.2.9", - "tokio 1.22.0", + "pin-project-lite", + "tokio", ] [[package]] @@ -3332,11 +3310,11 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" dependencies = [ - "bytes 1.3.0", + "bytes", "futures-core", "futures-sink", - "pin-project-lite 0.2.9", - "tokio 1.22.0", + "pin-project-lite", + "tokio", "tracing 0.1.36", ] @@ -3359,7 +3337,7 @@ dependencies = [ "async-trait", "axum", "base64", - "bytes 1.3.0", + "bytes", "futures-core", "futures-util", "h2", @@ -3371,7 +3349,7 @@ dependencies = [ "pin-project", "prost", "prost-derive", - "tokio 1.22.0", + "tokio", "tokio-stream", "tokio-util 0.7.4", "tower", @@ -3391,10 +3369,10 @@ dependencies = [ "futures-util", "indexmap", "pin-project", - "pin-project-lite 0.2.9", + "pin-project-lite", "rand", "slab", - "tokio 1.22.0", + "tokio", "tokio-util 0.7.4", "tower-layer", "tower-service", @@ -3408,13 +3386,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c530c8675c1dbf98facee631536fa116b5fb6382d7dd6dc1b118d970eafe3ba" dependencies = [ "bitflags", - "bytes 1.3.0", + "bytes", "futures-core", "futures-util", "http", "http-body", "http-range-header", - "pin-project-lite 0.2.9", + "pin-project-lite", "tower", "tower-layer", "tower-service", @@ -3440,7 +3418,7 @@ checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307" dependencies = [ "cfg-if", "log", - "pin-project-lite 0.2.9", + "pin-project-lite", "tracing-attributes", "tracing-core 0.1.30", ] @@ -3451,7 +3429,7 @@ version = "0.2.0" source = "git+https://github.com/jarnura/tracing?rev=16d277227f60788750528e4f4cc1db4f36b0869f#16d277227f60788750528e4f4cc1db4f36b0869f" dependencies = [ "cfg-if", - "pin-project-lite 0.2.9", + "pin-project-lite", "tracing-core 0.2.0", ] diff --git a/crates/router/Cargo.toml b/crates/router/Cargo.toml index afbb401c141..b5d21ae3070 100644 --- a/crates/router/Cargo.toml +++ b/crates/router/Cargo.toml @@ -38,6 +38,8 @@ dyn-clone = "1.0.9" encoding_rs = "0.8.31" error-stack = "0.2.1" fred = { version = "5.2.0", features = ["metrics", "partial-tracing"] , optional = true } +futures = "0.3.25" +futures-locks = "0.7.0" hex = "0.4.3" http = "0.2.8" josekit = "0.8.1" @@ -62,8 +64,6 @@ time = { version = "0.3.14", features = ["serde", "serde-well-known", "std"] } tokio = { version = "1.21.2", features = ["macros", "rt-multi-thread"] } url = { version = "2.3.1", features = ["serde"] } uuid = { version = "1.1.2", features = ["serde", "v4"] } -futures-locks = "0.6" -futures = "0.3" # First party crates common_utils = { version = "0.1.0", path = "../common_utils" }
build
bump `futures-locks` crate from 0.6 to 0.7.0 (#59)
2e6cd6d31e4e3168b97427de936724de94df6415
2024-10-19 19:27:53
Sandeep Kumar
feat(opensearch): add additional global search filters and create sessionizer indexes for local (#6352)
false
diff --git a/config/config.example.toml b/config/config.example.toml index c0358d91a26..8f04ba49831 100644 --- a/config/config.example.toml +++ b/config/config.example.toml @@ -728,6 +728,10 @@ payment_attempts = "hyperswitch-payment-attempt-events" payment_intents = "hyperswitch-payment-intent-events" refunds = "hyperswitch-refund-events" disputes = "hyperswitch-dispute-events" +sessionizer_payment_attempts = "sessionizer-payment-attempt-events" +sessionizer_payment_intents = "sessionizer-payment-intent-events" +sessionizer_refunds = "sessionizer-refund-events" +sessionizer_disputes = "sessionizer-dispute-events" [saved_payment_methods] sdk_eligible_payment_methods = "card" diff --git a/config/deployments/env_specific.toml b/config/deployments/env_specific.toml index 5dce5be9c96..cfefe9a130f 100644 --- a/config/deployments/env_specific.toml +++ b/config/deployments/env_specific.toml @@ -252,6 +252,10 @@ payment_attempts = "hyperswitch-payment-attempt-events" payment_intents = "hyperswitch-payment-intent-events" refunds = "hyperswitch-refund-events" disputes = "hyperswitch-dispute-events" +sessionizer_payment_attempts = "sessionizer-payment-attempt-events" +sessionizer_payment_intents = "sessionizer-payment-intent-events" +sessionizer_refunds = "sessionizer-refund-events" +sessionizer_disputes = "sessionizer-dispute-events" # Configuration for the Key Manager Service [key_manager] diff --git a/config/development.toml b/config/development.toml index 4c2f1cf718e..8e5d9582e2f 100644 --- a/config/development.toml +++ b/config/development.toml @@ -734,6 +734,10 @@ payment_attempts = "hyperswitch-payment-attempt-events" payment_intents = "hyperswitch-payment-intent-events" refunds = "hyperswitch-refund-events" disputes = "hyperswitch-dispute-events" +sessionizer_payment_attempts = "sessionizer-payment-attempt-events" +sessionizer_payment_intents = "sessionizer-payment-intent-events" +sessionizer_refunds = "sessionizer-refund-events" +sessionizer_disputes = "sessionizer-dispute-events" [saved_payment_methods] sdk_eligible_payment_methods = "card" diff --git a/config/docker_compose.toml b/config/docker_compose.toml index d55e722b3e0..dde0902af91 100644 --- a/config/docker_compose.toml +++ b/config/docker_compose.toml @@ -562,6 +562,10 @@ payment_attempts = "hyperswitch-payment-attempt-events" payment_intents = "hyperswitch-payment-intent-events" refunds = "hyperswitch-refund-events" disputes = "hyperswitch-dispute-events" +sessionizer_payment_attempts = "sessionizer-payment-attempt-events" +sessionizer_payment_intents = "sessionizer-payment-intent-events" +sessionizer_refunds = "sessionizer-refund-events" +sessionizer_disputes = "sessionizer-dispute-events" [saved_payment_methods] sdk_eligible_payment_methods = "card" diff --git a/config/vector.yaml b/config/vector.yaml index 54ff25cab5a..3f0709ae03c 100644 --- a/config/vector.yaml +++ b/config/vector.yaml @@ -18,6 +18,15 @@ sources: decoding: codec: json + sessionized_kafka_tx_events: + type: kafka + bootstrap_servers: kafka0:29092 + group_id: sessionizer + topics: + - ^sessionizer + decoding: + codec: json + app_logs: type: docker_logs include_labels: @@ -35,10 +44,19 @@ sources: encoding: json transforms: + events_create_ts: + inputs: + - kafka_tx_events + source: |- + .timestamp = from_unix_timestamp(.created_at, unit: "seconds") ?? now() + ."@timestamp" = from_unix_timestamp(.created_at, unit: "seconds") ?? now() + type: remap + plus_1_events: type: filter inputs: - - kafka_tx_events + - events_create_ts + - sessionized_events_create_ts condition: ".sign_flag == 1" hs_server_logs: @@ -54,13 +72,13 @@ transforms: source: |- .message = parse_json!(.message) - events: + sessionized_events_create_ts: type: remap inputs: - - plus_1_events + - sessionized_kafka_tx_events source: |- - .timestamp = from_unix_timestamp!(.created_at, unit: "seconds") - ."@timestamp" = from_unix_timestamp(.created_at, unit: "seconds") ?? now() + .timestamp = from_unix_timestamp(.created_at, unit: "milliseconds") ?? now() + ."@timestamp" = from_unix_timestamp(.created_at, unit: "milliseconds") ?? now() sdk_transformed: type: throttle @@ -74,7 +92,7 @@ sinks: opensearch_events_1: type: elasticsearch inputs: - - events + - plus_1_events endpoints: - "https://opensearch:9200" id_key: message_key @@ -98,7 +116,7 @@ sinks: opensearch_events_2: type: elasticsearch inputs: - - events + - plus_1_events endpoints: - "https://opensearch:9200" id_key: message_key @@ -120,6 +138,33 @@ sinks: # Add a date suffixed index for better grouping index: "vector-{{ .topic }}-%Y-%m-%d" + opensearch_events_3: + type: elasticsearch + inputs: + - plus_1_events + endpoints: + - "https://opensearch:9200" + id_key: message_key + api_version: v7 + tls: + verify_certificate: false + verify_hostname: false + auth: + strategy: basic + user: admin + password: 0penS3arc# + encoding: + except_fields: + - message_key + - offset + - partition + - topic + - clickhouse_database + - last_synced + - sign_flag + bulk: + index: "{{ .topic }}" + opensearch_logs: type: elasticsearch inputs: @@ -143,6 +188,7 @@ sinks: type: loki inputs: - kafka_tx_events + - sessionized_kafka_tx_events endpoint: http://loki:3100 labels: source: vector diff --git a/crates/analytics/src/opensearch.rs b/crates/analytics/src/opensearch.rs index 3be9688d8f7..a6e6c486ebe 100644 --- a/crates/analytics/src/opensearch.rs +++ b/crates/analytics/src/opensearch.rs @@ -42,6 +42,10 @@ pub struct OpenSearchIndexes { pub payment_intents: String, pub refunds: String, pub disputes: String, + pub sessionizer_payment_attempts: String, + pub sessionizer_payment_intents: String, + pub sessionizer_refunds: String, + pub sessionizer_disputes: String, } #[derive(Debug, Clone, Copy, serde::Serialize, serde::Deserialize, PartialEq, Eq, Hash)] @@ -81,6 +85,10 @@ impl Default for OpenSearchConfig { payment_intents: "hyperswitch-payment-intent-events".to_string(), refunds: "hyperswitch-refund-events".to_string(), disputes: "hyperswitch-dispute-events".to_string(), + sessionizer_payment_attempts: "sessionizer-payment-attempt-events".to_string(), + sessionizer_payment_intents: "sessionizer-payment-intent-events".to_string(), + sessionizer_refunds: "sessionizer-refund-events".to_string(), + sessionizer_disputes: "sessionizer-dispute-events".to_string(), }, } } @@ -219,6 +227,14 @@ impl OpenSearchClient { SearchIndex::PaymentIntents => self.indexes.payment_intents.clone(), SearchIndex::Refunds => self.indexes.refunds.clone(), SearchIndex::Disputes => self.indexes.disputes.clone(), + SearchIndex::SessionizerPaymentAttempts => { + self.indexes.sessionizer_payment_attempts.clone() + } + SearchIndex::SessionizerPaymentIntents => { + self.indexes.sessionizer_payment_intents.clone() + } + SearchIndex::SessionizerRefunds => self.indexes.sessionizer_refunds.clone(), + SearchIndex::SessionizerDisputes => self.indexes.sessionizer_disputes.clone(), } } @@ -324,6 +340,36 @@ impl OpenSearchIndexes { )) })?; + when( + self.sessionizer_payment_attempts.is_default_or_empty(), + || { + Err(ApplicationError::InvalidConfigurationValueError( + "Opensearch Sessionizer Payment Attempts index must not be empty".into(), + )) + }, + )?; + + when( + self.sessionizer_payment_intents.is_default_or_empty(), + || { + Err(ApplicationError::InvalidConfigurationValueError( + "Opensearch Sessionizer Payment Intents index must not be empty".into(), + )) + }, + )?; + + when(self.sessionizer_refunds.is_default_or_empty(), || { + Err(ApplicationError::InvalidConfigurationValueError( + "Opensearch Sessionizer Refunds index must not be empty".into(), + )) + })?; + + when(self.sessionizer_disputes.is_default_or_empty(), || { + Err(ApplicationError::InvalidConfigurationValueError( + "Opensearch Sessionizer Disputes index must not be empty".into(), + )) + })?; + Ok(()) } } diff --git a/crates/analytics/src/search.rs b/crates/analytics/src/search.rs index c81ff2f416b..f53b07b1232 100644 --- a/crates/analytics/src/search.rs +++ b/crates/analytics/src/search.rs @@ -92,6 +92,44 @@ pub async fn msearch_results( .switch()?; } }; + if let Some(connector) = filters.connector { + if !connector.is_empty() { + query_builder + .add_filter_clause("connector.keyword".to_string(), connector.clone()) + .switch()?; + } + }; + if let Some(payment_method_type) = filters.payment_method_type { + if !payment_method_type.is_empty() { + query_builder + .add_filter_clause( + "payment_method_type.keyword".to_string(), + payment_method_type.clone(), + ) + .switch()?; + } + }; + if let Some(card_network) = filters.card_network { + if !card_network.is_empty() { + query_builder + .add_filter_clause("card_network.keyword".to_string(), card_network.clone()) + .switch()?; + } + }; + if let Some(card_last_4) = filters.card_last_4 { + if !card_last_4.is_empty() { + query_builder + .add_filter_clause("card_last_4.keyword".to_string(), card_last_4.clone()) + .switch()?; + } + }; + if let Some(payment_id) = filters.payment_id { + if !payment_id.is_empty() { + query_builder + .add_filter_clause("payment_id.keyword".to_string(), payment_id.clone()) + .switch()?; + } + }; }; if let Some(time_range) = req.time_range { @@ -217,6 +255,44 @@ pub async fn search_results( .switch()?; } }; + if let Some(connector) = filters.connector { + if !connector.is_empty() { + query_builder + .add_filter_clause("connector.keyword".to_string(), connector.clone()) + .switch()?; + } + }; + if let Some(payment_method_type) = filters.payment_method_type { + if !payment_method_type.is_empty() { + query_builder + .add_filter_clause( + "payment_method_type.keyword".to_string(), + payment_method_type.clone(), + ) + .switch()?; + } + }; + if let Some(card_network) = filters.card_network { + if !card_network.is_empty() { + query_builder + .add_filter_clause("card_network.keyword".to_string(), card_network.clone()) + .switch()?; + } + }; + if let Some(card_last_4) = filters.card_last_4 { + if !card_last_4.is_empty() { + query_builder + .add_filter_clause("card_last_4.keyword".to_string(), card_last_4.clone()) + .switch()?; + } + }; + if let Some(payment_id) = filters.payment_id { + if !payment_id.is_empty() { + query_builder + .add_filter_clause("payment_id.keyword".to_string(), payment_id.clone()) + .switch()?; + } + }; }; if let Some(time_range) = search_req.time_range { diff --git a/crates/api_models/src/analytics/search.rs b/crates/api_models/src/analytics/search.rs index 24dd0effcbb..a33dd100c79 100644 --- a/crates/api_models/src/analytics/search.rs +++ b/crates/api_models/src/analytics/search.rs @@ -9,6 +9,11 @@ pub struct SearchFilters { pub status: Option<Vec<String>>, pub customer_email: Option<Vec<HashedString<common_utils::pii::EmailStrategy>>>, pub search_tags: Option<Vec<HashedString<WithType>>>, + pub connector: Option<Vec<String>>, + pub payment_method_type: Option<Vec<String>>, + pub card_network: Option<Vec<String>>, + pub card_last_4: Option<Vec<String>>, + pub payment_id: Option<Vec<String>>, } impl SearchFilters { pub fn is_all_none(&self) -> bool { @@ -17,6 +22,11 @@ impl SearchFilters { && self.status.is_none() && self.customer_email.is_none() && self.search_tags.is_none() + && self.connector.is_none() + && self.payment_method_type.is_none() + && self.card_network.is_none() + && self.card_last_4.is_none() + && self.payment_id.is_none() } } @@ -58,6 +68,10 @@ pub enum SearchIndex { PaymentIntents, Refunds, Disputes, + SessionizerPaymentAttempts, + SessionizerPaymentIntents, + SessionizerRefunds, + SessionizerDisputes, } #[derive(Debug, strum::EnumIter, Clone, serde::Deserialize, serde::Serialize, Copy)] diff --git a/crates/router/src/consts/opensearch.rs b/crates/router/src/consts/opensearch.rs index 277b0e946ba..c9eeec1b343 100644 --- a/crates/router/src/consts/opensearch.rs +++ b/crates/router/src/consts/opensearch.rs @@ -1,12 +1,16 @@ use api_models::analytics::search::SearchIndex; -pub const fn get_search_indexes() -> [SearchIndex; 4] { +pub const fn get_search_indexes() -> [SearchIndex; 8] { [ SearchIndex::PaymentAttempts, SearchIndex::PaymentIntents, SearchIndex::Refunds, SearchIndex::Disputes, + SearchIndex::SessionizerPaymentAttempts, + SearchIndex::SessionizerPaymentIntents, + SearchIndex::SessionizerRefunds, + SearchIndex::SessionizerDisputes, ] } -pub const SEARCH_INDEXES: [SearchIndex; 4] = get_search_indexes(); +pub const SEARCH_INDEXES: [SearchIndex; 8] = get_search_indexes();
feat
add additional global search filters and create sessionizer indexes for local (#6352)